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

# Response formats

> Choose JSON or Toon for UseAgents API and MCP responses, and human, JSON, or Toon for the CLI.

UseAgents supports multiple response encodings so you can optimize for scripts, humans, or LLM token budgets.

| Surface      | Default                             | Options                 | How to choose            |
| ------------ | ----------------------------------- | ----------------------- | ------------------------ |
| **REST API** | `json`                              | `json`, `toon`          | Query param `format`     |
| **MCP**      | `toon`                              | `toon`, `json`          | Tool argument `format`   |
| **CLI**      | `human` in a TTY, `json` when piped | `human`, `json`, `toon` | `--format` (or `--json`) |

[Toon](https://toonformat.dev) (Token-Oriented Object Notation) is a compact, human-readable encoding designed for LLM tool results. Prefer it when an agent will consume the payload; prefer JSON when a conventional HTTP client or script will parse it.

Error responses on the API stay JSON even when `format=toon`, so clients can always parse failures the same way.

## REST API

Add `format=toon` or `format=json` (default) to any tools endpoint:

```bash theme={null}
curl "https://api.useagents.site/tools/search?q=email%20api&format=toon"
curl "https://api.useagents.site/tools/context/resend?format=json"
curl "https://api.useagents.site/tools/docs/resend?q=attachments&format=toon"
```

When `format=toon`, the response body is Toon text with `Content-Type: text/toon; charset=utf-8`.

See also [Tools Search](/api-reference/tools-search) and [Tools Docs Search](/api-reference/tools-docs).

## MCP

Each tool accepts an optional `format` argument. Omit it to keep the default (`toon`):

```json theme={null}
{
  "slug": "resend",
  "query": "how do I send attachments",
  "format": "json"
}
```

Applies to [`search_tools`](/mcp/tools-reference/search-tools), [`get_tool_context`](/mcp/tools-reference/get-tool-context), [`search_docs`](/mcp/tools-reference/search-docs), and [`test_tool`](/mcp/tools-reference/test-tool).

## CLI

```bash theme={null}
useagents docs resend "attachments"                 # human (TTY)
useagents docs resend "attachments" --json          # json
useagents docs resend "attachments" --format toon   # toon
useagents docs resend "attachments" | jq .          # json when piped
```

`--format` wins over `--json` and over the pipe default. See [UseAgents CLI](/agents/cli).
