# How to take feedback from agents

Every app with telltale takes feedback at `POST {api_prefix}/feedback`. The route is listed in the app's OpenAPI file, with a description that tells agents what it is for, so an agent reading your API can find it with no setup on your part:

```bash
curl -X POST https://myapp.example.org/api/feedback \
  -H 'Content-Type: application/json' \
  -d '{"text": "search returns nothing for exact titles", "category": "bug"}'
```

If your app has an MCP server, you can also give agents a `send_feedback` tool and time your other tools.

## Add the send_feedback tool

1. Import the tool definition and its handler:

    ```python
    from .vendor.telltale.mcp import SEND_FEEDBACK_TOOL, handle_send_feedback
    ```

2. Register `SEND_FEEDBACK_TOOL` with your MCP server. It is a plain dict with the tool's name, description and input schema.

3. Answer calls with the handler. Pass the `clientInfo` from the MCP handshake, so the note is filed under the agent that sent it:

    ```python
    result = handle_send_feedback(tt, args, client_info)
    ```

    The result is `{"id", "message"}` when the note is taken, or `{"error": ...}` when it is refused, for example over the rate limit.

## Time your MCP tools

Wrap each tool with `tt.mcp_tool`:

```python
@tt.mcp_tool("search")
def search(query: str):
    return run_search(query)
```

An exception, or a returned `{"error": ...}`, counts as a failed call. Requests under `TELLTALE_MCP_PATH` (default `/mcp`) are filed under the `mcp` surface.
