> ## Documentation Index
> Fetch the complete documentation index at: https://docs.impellabs.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Results and side effects

> How an agent reads your answer, how errors reach it, and what happens when a call may have run.

An agent reads your answer as text or as data. If your tool changes something, the agent also needs to know whether the
change happened.

## MCP results

| Your answer | What the agent gets |
| - | - |
| `content` with `text` items | The text, joined with line breaks. It is cut at 200,000 characters. |
| `content` with `image` or `audio` items | The words `[image left out]` or `[audio left out]`. |
| `structuredContent` as an object | Also passed as data. |
| `isError: true` | An error with your text. This is a real answer: the tool ran and said no. |

Put the facts the agent needs in the text. Do not rely on an image.

## API results

| Your API answers | What the agent gets |
| - | - |
| Status `200` to `299` with a JSON object or array | The parsed JSON as data. |
| Status `200` to `299` with any other body | The body as text, cut at 60,000 characters. |
| Another status below `500` | An error: `The API answered 404.` and the first 1000 characters of the body. |
| Status `500` or more, `408` or `429` | An error that says the request may have run. |
| No answer | An error that says the request may have run. |

If your API answers with a JSON body, send `Content-Type: application/json`. A JSON body with another content type
arrives as text. An answer can be up to 1 MB. A larger one counts as no answer.

If your answer contains the key that ImpelLabs sent, ImpelLabs replaces it with `[hidden]` before the agent sees it.

## Write clear errors

The agent reads the error text and decides what to do next. Say what is wrong and what to change, in one or two
sentences. An error message reaches the agent up to 2000 characters. Do not put secrets or stack traces in it.

## Side effects

A tool with the risk `write`, `send` or `money` changes something outside ImpelLabs. For those, your workspace rules
decide whether the call runs, waits on a card for a person to approve, or is refused. The card shows the operation, the
connection and the fields the call would send.

When a call may have run, the agent gets: "It may have run. Check before you try again." This happens for an MCP server
that answers `5xx`, `408` or `429` or does not answer, and for an API in the cases above. A tool call runs once.
ImpelLabs does not retry it.

Make your side safe for a repeated call:

* Give the agent a read operation that shows the current state, so it can check before it tries again.
* Accept a client-chosen id or key in create operations, and ignore a second request with the same one.
* Return the final state, not only "ok".

## Timeouts

ImpelLabs waits up to 15 seconds for each request to your server. It does not follow redirects. A slow tool needs to
answer with a job id and offer a second operation to read the result.

## Related

* [Tool contract](https://docs.impellabs.tech/developers/own-tools/tool-contract.md)
* [Security model](https://docs.impellabs.tech/developers/own-tools/security.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.