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

# MCP server

> Connect an AI assistant or coding tool to your Klatt organization through the Model Context Protocol, with an organization API key.

Klatt runs a [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server so AI assistants and coding tools can look up and extend your organization's setup.

| | |
| - | - |
| Endpoint | `https://api.klatt.ai/api/v1/mcp/` (keep the trailing slash) |
| Transport | Streamable HTTP (stateless) |
| Authentication | Organization API key in `Authorization: Bearer <key>` |

The server is available to MCP clients that let you set **request headers** for a remote server. It does not use OAuth, so clients that can only sign in through an OAuth flow cannot connect.

> [!WARNING]
>
> The key gives the client access to your organization. Prefer an environment variable or a secret prompt over typing the key into a file, and never commit a key to a repository or share a configuration file that contains one. Delete the key in the console if it leaks.

## Quick start

**1. Create a key**

Create an [organization API key](https://docs.klatt.ai/api-reference/authentication.md) and set it in your shell as `KLATT_API_KEY`.

**2. Add the server to your client**

Follow the tab for your client in [Connect a client](#connect-a-client). In Claude Code it is one command:

```bash theme={null}
claude mcp add --transport http klatt https://api.klatt.ai/api/v1/mcp/ \
  --header "Authorization: Bearer $KLATT_API_KEY"
```

**3. Check the connection**

Paste this prompt into the client. It only reads:

Check that your assistant can reach Klatt

Use the klatt MCP server to list my voice agents. Show each agent's name and id in a table. Only read data: do not create, change or delete anything.

## Connect a client

Create an [organization API key](https://docs.klatt.ai/api-reference/authentication.md), then set it in your shell as `KLATT_API_KEY`.

> [tab] Claude Code
>
> Add the server from the command line ([Claude Code MCP documentation](https://code.claude.com/docs/en/mcp)). Your shell expands `$KLATT_API_KEY`, so Claude Code stores the literal key in its configuration. For a project you share, use the `.mcp.json` form below instead:
>
> ```bash theme={null}
> claude mcp add --transport http klatt https://api.klatt.ai/api/v1/mcp/ \
>   --header "Authorization: Bearer $KLATT_API_KEY"
> ```
>
> Or share the server through a `.mcp.json` file. Claude Code expands `${KLATT_API_KEY}` from the environment, so the key stays out of the file:
>
> ```json .mcp.json theme={null}
> {
>   "mcpServers": {
>     "klatt": {
>       "type": "http",
>       "url": "https://api.klatt.ai/api/v1/mcp/",
>       "headers": {
>         "Authorization": "Bearer ${KLATT_API_KEY}"
>       }
>     }
>   }
> }
> ```

> [tab] Cursor
>
> Add the server to `.cursor/mcp.json` in a project, or to `~/.cursor/mcp.json` for all projects ([Cursor MCP documentation](https://cursor.com/docs/context/mcp)). Cursor reads `${env:KLATT_API_KEY}` from the environment:
>
> ```json .cursor/mcp.json theme={null}
> {
>   "mcpServers": {
>     "klatt": {
>       "url": "https://api.klatt.ai/api/v1/mcp/",
>       "headers": {
>         "Authorization": "Bearer ${env:KLATT_API_KEY}"
>       }
>     }
>   }
> }
> ```

> [tab] VS Code
>
> Add the server to `.vscode/mcp.json` ([VS Code MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration)). VS Code asks for the key when the server starts and does not store it in the file:
>
> ```json .vscode/mcp.json theme={null}
> {
>   "inputs": [
>     {
>       "type": "promptString",
>       "id": "klatt-api-key",
>       "description": "Klatt API key",
>       "password": true
>     }
>   ],
>   "servers": {
>     "klatt": {
>       "type": "http",
>       "url": "https://api.klatt.ai/api/v1/mcp/",
>       "headers": {
>         "Authorization": "Bearer ${input:klatt-api-key}"
>       }
>     }
>   }
> }
> ```

Other clients can connect if they support remote Streamable HTTP servers with custom headers. Check that client's documentation for how to set the header.

## Prompts to try

Copy a prompt into any connected client. The first two only read.

Review the last week of conversations

Use the klatt MCP server. Call `list_conversations` with since set to 7 days ago and read every page. Summarize why customers contacted us, which questions the agents could not answer, and any conversation that ended badly. Only read data: do not change anything.

Find gaps in an agent's knowledge

Use the klatt MCP server. List my voice agents and ask me which one to review. Read my knowledge documents and knowledge entries, then call `list_conversations` with that agent's `agent_uuid` and find the questions it could not answer. Suggest knowledge entries to add. Only read data: do not change anything.

Change an agent safely

Use the klatt MCP server. Before you call any tool that creates, changes or deletes something, show me the current value, the exact change and the tool you will call, and wait for my OK. Now help me change one of my voice agents.

## Tools

The server has one tool for every operation of [API v1](https://docs.klatt.ai/api-reference/introduction.md), plus the integration tools, `search_docs`, `get_setup_guide` and `audit_agent`. Every tool acts on the organization that owns the key; an id from another organization is reported as not found, or matches nothing when used as a filter. Tool names are the snake\_case form of the operation ids in the endpoint reference.

### Inputs and results

* **Inputs.** The path and query parameters of the operation keep their names, for example `agent_uuid`, `limit` and `cursor`. The request body goes in one `body` argument with the same properties as the REST request body.
* **Results.** Each tool returns one JSON text block with the documented fields of the REST response. Empty lists come back as `[]`, and delete tools return `{"deleted": true}`.
* **Errors.** A failed call is a tool error (`isError: true`). Usually its text is JSON, `{"status": <HTTP status>, "detail": ...}`, with the same status and `detail` as the REST API (see [Errors](https://docs.klatt.ai/api-reference/errors.md)). For example, a key without the needed permission returns `{"status": 403, "detail": "permission_required"}`. Arguments that do not match the input schema of the tool return a plain-text validation message instead of a `422`. Unexpected server errors return only a generic message. The integration tools are the exception, except for a missing or invalid `guide_token` on `create_integration` and `update_integration`, which is a tool error (see [Guides and guide\_token](#guides-and-guide_token)), not a result with `created: false`. Otherwise they report their own failures in a normal result instead: `created`, `updated` or `found` is `false`, with an `error_code` and an `error`. `list_integrations` returns an empty list instead of an error, and `search_docs` reports `error: "docs_unavailable"` when the guides cannot be read. A key without the needed permission is still a tool error with status 403.
* **Text written by third parties.** `list_conversations`, `search_conversations`, `update_conversation_state`, `get_knowledge_document_text`, `update_knowledge_document_text`, `list_knowledge_entries`, `create_knowledge_entry`, `update_knowledge_entry` and the contact tools (`list_contacts`, `search_contacts`, `create_contact`, `get_contact`, `update_contact`) return two text blocks. The first is a notice that what follows is data written by third parties (callers, contacts, documents) and not instructions. The second is the usual JSON between `<untrusted-data-ID>` and `</untrusted-data-ID>`, where `ID` is random on every call, so text inside the data cannot fake the closing tag. The JSON itself is unchanged: read the JSON between the tags. This helps an assistant tell data from instructions, but it is not a guarantee; see [Security](#security).
* **Polling.** MCP has no conditional polling (`ETag` and `If-None-Match`). To poll conversations, pass `since` to `list_conversations`.

### Guides and guide\_token

Before an assistant creates, changes or deletes anything, it loads the matching guide with `get_setup_guide` (`start`, `create_agent`, `review_agent`, `change_agent` or `connect_service`). The result includes a `guide_token`.

* **Every write needs it.** Pass the `guide_token` to each tool that creates, changes or deletes something: every tool that is not a Read tool, `create_integration` and `update_integration` included. The token is optional in the input schema, but a write without a valid one fails before it runs and changes nothing.
* **It lasts 2 hours.** It belongs to the organization and the API key that loaded the guide, so another key cannot use it. Loading a guide again gives a new one.
* **The error carries the guide.** A missing, expired or foreign token returns a plain tool error that starts with, for example, `Load the guide first: call get_setup_guide with guide "create_agent" and pass its guide_token here. Nothing was changed.` It then includes that guide and a new `guide_token` for the caller, so an assistant whose tool list predates `get_setup_guide` can follow the guide and retry without reconnecting. A client that cannot send `guide_token` must reconnect to refresh its tools. Reads never need a token.
* **Writes return `setup`.** The tools that create or change an agent, a webhook or a transfer target answer with `setup`: whether the agent is ready and what is still missing.

### Tool annotations

Each tool carries MCP tool annotations, so a client can decide when to ask you before a call. Annotations are hints. Klatt still checks every call on the server.

| Class | Annotations | Meaning |
| - | - | - |
| **Read** | `readOnlyHint: true` | Reads and searches. |
| **Create** | `readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: false` | Adds something new. Calling it twice creates two. |
| **Change** | `readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: true` | Reversible changes, such as marking a conversation or renaming a list. |
| **Destructive** | `readOnlyHint: false`, `destructiveHint: true`, `idempotentHint: true` | Replaces or deletes data. |

All tools set `openWorldHint: false`, except `update_chat_agent`. It sets `openWorldHint: true` because saving a chat agent can submit a WhatsApp message template to Meta for review.

### Voice agents

The public API does not accept or return the language model, the speech provider or the speech model. Send a catalog voice key in `voice_settings.voice`. A value for the language model or the speech provider is refused with `model_selection_unavailable`.

Voice and chat agents have a `language` (the default language) and an `additional_languages` list. The supported languages are `es-ES`, `en`, `fr-FR`, `it-IT`, `de-DE`, `pt-PT`, `ca-ES` (Catalan), `gl-ES` (Galician) and `eu-ES` (Basque). Catalan, Galician and Basque work like any other language. Voice agents accept them once Klatt has enabled them for voice, and refuse them with `cooficial_voice_unavailable` before that; a new voice agent created in one of them gets a voice that speaks it, or is refused with `voice_catalog_unavailable` when there is none. The list holds the other languages the agent also serves and is empty by default. When it is not empty, the agent detects which of its languages the person speaks and answers in it; the console shows the list as **Also serves in**, and its **All** option saves every other language the agent can use. To make an agent multilingual, send `additional_languages` with the codes it should also serve. Creating an agent takes only `name` and `language`, so set `additional_languages` when you update the agent. Sending the list replaces it, and `[]` makes the agent single-language. The list cannot repeat a language or include `language`.

Voice and chat agents also have `outcome_fields`: the data Klatt extracts from each conversation when its analysis finishes, shown in the console as **Capture data** and sent to [webhooks](https://docs.klatt.ai/voice-agent/webhooks.md#captured-data). It is returned by `get_voice_agent` and `get_chat_agent` and can be set with `update_voice_agent` and `update_chat_agent`, not when creating an agent. Each field has a `key` (lowercase letters, digits and `_`, starting with a letter, up to 40 characters; used as `{{outcome.<key>}}`), a `label`, a `kind` (`text`, `number`, `boolean`, `enum` or `date`), `options` (only for `enum`, up to 50) and an optional `description`. An agent has up to 20 fields. Sending the list replaces it, and `[]` removes all fields. Keep the `key` of existing fields when you update, because webhooks refer to it.

| Tool | What it does | Class |
| - | - | - |
| `list_voice_agents` | List voice agents | Read |
| `get_voice_agent` | Get a voice agent | Read |
| `create_voice_agent` | Create a voice agent | Create |
| `update_voice_agent` | Update a voice agent | Destructive |
| `duplicate_voice_agent` | Duplicate a voice agent | Create |
| `delete_voice_agent` | Delete a voice agent | Destructive |

### Transfer targets

| Tool | What it does | Class |
| - | - | - |
| `list_transfer_targets` | List the transfer targets of a voice agent | Read |
| `create_transfer_target` | Create a transfer target | Create |
| `update_transfer_target` | Update a transfer target | Destructive |
| `delete_transfer_target` | Delete a transfer target | Destructive |

A transfer target created or changed over MCP toward a phone number or SIP address that your organization does not use yet is saved with `pending_activation: true`. The agent does not transfer to it until a user activates it in the console. Only a signed-in user can activate it; an API key cannot. The result adds `console_url` and `next_step`. The public REST API holds nothing back, because your own code calls it, not a model reading transcripts.

### Chat agents

| Tool | What it does | Class |
| - | - | - |
| `list_chat_agents` | List chat agents | Read |
| `get_chat_agent` | Get a chat agent | Read |
| `create_chat_agent` | Create a chat agent | Create |
| `update_chat_agent` | Update a chat agent. Can submit a WhatsApp message template to Meta for review. | Destructive |
| `duplicate_chat_agent` | Duplicate a chat agent | Create |
| `delete_chat_agent` | Delete a chat agent | Destructive |

### Conversations

| Tool | What it does | Class |
| - | - | - |
| `list_conversations` | List calls and chats, newest first, one page at a time | Read |
| `search_conversations` | Search conversations by text and filters | Read |
| `update_conversation_state` | Update a conversation's state | Change |

### Contact lists, fields and contacts

| Tool | What it does | Class |
| - | - | - |
| `list_contact_lists` | List contact lists | Read |
| `create_contact_list` | Create a contact list | Create |
| `rename_contact_list` | Rename a contact list | Change |
| `update_contact_list_settings` | Update the settings of a contact list | Destructive |
| `list_contact_fields` | List the contact fields of a list | Read |
| `create_contact_field` | Create a contact field | Create |
| `update_contact_field` | Update a contact field | Destructive |
| `delete_contact_field` | Delete a contact field | Destructive |
| `list_contacts` | List the contacts of a list | Read |
| `search_contacts` | Search the contacts of a list | Read |
| `get_contact` | Get a contact | Read |
| `create_contact` | Create a contact | Create |
| `update_contact` | Update a contact | Destructive |
| `delete_contact` | Delete a contact | Destructive |

Contacts can have an owner, set only in the console. `update_contact` replaces the whole contact, as the REST update does, so it clears the owner.

### Knowledge documents

| Tool | What it does | Class |
| - | - | - |
| `list_knowledge_documents` | List knowledge documents | Read |
| `get_knowledge_document` | Get a knowledge document | Read |
| `get_knowledge_document_text` | Get a document's text | Read |
| `update_knowledge_document_text` | Update a document's text | Destructive |
| `preview_knowledge_document_deletion` | Preview which agents would lose a document | Read |
| `delete_knowledge_document` | Delete a document permanently | Destructive |

To delete a document:

1. Call `preview_knowledge_document_deletion` and review the agents that would lose the document.
2. Call `delete_knowledge_document` with the `etag` from the preview as `if_match`.

Without `if_match`, the call fails with status `428` and the preview. If the affected agents changed since the preview, it fails with status `412` and a new preview. These errors carry `status`, `error_code` and `preview`. Deletion cannot be undone.

Uploading documents is not available over MCP. Use the console.

### Knowledge entries

| Tool | What it does | Class |
| - | - | - |
| `list_knowledge_entries` | List knowledge entries | Read |
| `create_knowledge_entry` | Create a knowledge entry | Create |
| `update_knowledge_entry` | Update a knowledge entry | Destructive |
| `delete_knowledge_entry` | Delete a knowledge entry | Destructive |

### Integrations

A webhook is an HTTP request integration (`integration_key` is `http_request`). In the console, agents are called assistants, and webhooks are listed under **Abilities → Webhooks**.

The tool classes are the ones in [Tool annotations](#tool-annotations): `list_integrations`, `get_integration`, `search_docs`, `get_setup_guide` and `audit_agent` are Read, `create_integration` is Create, and `update_integration` is Destructive.

#### `list_integrations`

Lists the integrations of one agent.

| Input | Type | Description |
| - | - | - |
| `agent_uuid` | string (UUID) | The agent. Required. |
| `kind` | `"voice"` or `"chat"` | The type of agent. Defaults to `"voice"`. |

Returns a list. Each item has `integration_uuid`, `integration_key` (`http_request` for a webhook), `name`, `icon`, `mode` (when it runs), `schedule_mode`, `is_active`, `inactive_reason`, `pending_activation`, `template_count`, `page_urls`, `message_names` and, for a webhook, `credential`. The list is empty when the agent has no integrations or is not in your organization. An integration belongs to its agent; to reuse one on another agent, duplicate the agent.

#### `create_integration`

Adds a webhook (an HTTP request integration) to one **voice** agent.

| Input | Type | Description |
| - | - | - |
| `agent_uuid` | string (UUID) | The voice agent. Required. |
| `config` | object | The integration settings. Required. |

`config` has these settings:

* `name`.
* `execution.mode`: `DURING_CONVERSATION` (the default: the agent calls it when `execution.toolDescription` says so), `PRE_CONVERSATION` (before the call starts) or `POST_CONVERSATION` (when the conversation ends).
* `execution.toolDescription`.
* `request.url`, `request.method`, `request.headersTemplate`, `request.secretHeaders`, `request.bodyTemplate` and `request.auth`.
* An optional `advanced` object: `timeout`, `onlyIf`, `duringExecutionMessage`, `parameters`, `presetParameters` and `operationPolicy`.

On voice, a webhook that changes data during the call (any method other than GET) also needs caller verification, which only the console sets. The tool then fails with `integration_config_invalid`, and the result adds `console_url` (the assistant's page in the console) and a `next_step`. You can set it up in the console, use GET, or run the webhook before or after the conversation.

Do not send secrets through MCP. `request.auth` can name a credential, for example `{"type": "custom_header", "headerName": "klatt-key"}`, but it must not contain a `secret` key, whatever its value. The tool also refuses caller verification, a signing secret and common credential headers such as `Authorization` or `X-API-Key`. Never put a token in `request.url` or in a plain header of `request.headersTemplate`, because those values are stored as plain configuration. A secret header can be added by name only: its value is never accepted through MCP, and it also stays pending until you fill it in the console. A credential without its key creates a pending integration: the agent does not offer it and it sends nothing until the key is added in the console. When `request.url` is a Supabase Edge Function (`https://<project-ref>.supabase.co/functions/v1/<name>`), the tool sets `request.auth` to `{"type": "custom_header", "headerName": "klatt-key"}`, the header the [Supabase guide](https://docs.klatt.ai/integrations/supabase.md) has the function check, so the console opens on the Supabase key steps. It leaves `request.auth` as sent when `request.secretHeaders` already names `klatt-key`. When `request.url` is an n8n production webhook (its path starts with `/webhook/`) and `request.auth` is `api_key`, the tool stores a `custom_header` instead, with the header name you sent or `X-Webhook-Key`, as the [n8n guide](https://docs.klatt.ai/integrations/n8n.md) sets up Header Auth. Any other credential, or none, stays as sent. When the tool changes `request.auth`, the result also returns `auth` with what it stored.

On success it returns `created: true`, `integration_uuid`, `agent_uuid`, `integration_key` and `pending_secrets`, the settings that still need a key (for example `["config.request.auth.secret"]`; secret header names can be listed too). It is always returned, and it is an empty list when nothing is missing. When the list is not empty it also returns:

* `console_url`: a link that opens the webhook on **Authentication**, or on **Headers** when only secret headers are pending.
* `next_step`: a sentence to pass on to the user. It says to press **Generate key** only when the credential is a custom header or a bearer token, because only those show that button. For an API key, the user pastes the key their service gave them, and for a username and password they type both. For secret headers, the user types each value in **Headers**. When the user has both to do, it says both. When the key is made in Klatt, it also says where to store the same key: in the Supabase function as the secret `KLATT_KEY_<FUNCTION>` (the function name in upper case, other characters turned into `_`, for example `KLATT_KEY_BUSCAR_CLIENTE`), in the n8n Webhook node's Header Auth credential under the header name, or where the user's endpoint checks it.

Webhooks of your organization that call the same endpoint share one key, because the endpoint keeps one secret. The endpoint is the URL without query string, fragment or trailing `/`, the authentication header and, for basic auth, the username. When a new webhook has no key and the other webhooks on that endpoint (on any agent) all hold the same key, the new one uses it: `pending_secrets` is `[]`, there is no `console_url` or `next_step`, and `credential.shared_with` lists those webhooks (`uuid`, `name`, `agent_name`). Only the authentication key is shared, never secret headers or caller verification.

A webhook created or changed over MCP is saved with `pending_activation: true` unless an activated webhook of your organization already sends exactly the same request: the URL including its query, the method, the headers, the body and the fixed parameter values. A second webhook to the same endpoint with a different body is therefore held once too, while its key is still reused. Klatt sends nothing to a webhook that is pending until a user activates it in the console (**Activate** on the webhook). Only a signed-in user can activate it; an API key cannot. The result adds `console_url` and `next_step`, and when a key is also missing it is the same visit. The first webhook of an organization is always held. An after-conversation webhook activated within 24 hours of a call still delivers that call, because the after-call sweep retries for 24 hours. A delivery still queued when an update puts the webhook on hold is dropped, never sent to the new address. The public REST API does not hold anything.

Never ask the user for the key in chat. On failure it returns `created: false`, a machine-readable `error_code` and a readable `error`. An invalid `config` returns `integration_config_invalid` with an `errors` list of the settings to fix. Other codes include `integration_secret_not_allowed`, `agent_not_found`, `integration_function_name_conflict`, `tool_budget_exceeded` and `create_failed`. A key without the needed permission returns a tool error with status 403, like any other tool.

#### `get_integration`

Reads one HTTP request integration (a webhook) of your organization.

| Input | Type | Description |
| - | - | - |
| `integration_uuid` | string (UUID) | The integration. Required. |

Returns `integration_uuid`, `integration_key`, `agent`, `config`, `connection_uuid`, `schedule_mode`, `is_active`, `inactive_reason`, `created_at`, `updated_at`, `credential` and `pending_secrets`. `credential.status` is `configured`, `pending` (no key yet) or `mismatch` (webhooks on the same endpoint hold different keys, so one of them fails: fix it in the console), and `credential.shared_with` lists the webhooks that hold the same key. The key itself is never returned. `pending_activation` is `true` while the webhook waits for a user to activate it (see `create_integration`), and then nothing is sent to it. While a key is missing, the agent does not use the webhook, and the result adds `console_url` and `next_step`, as `create_integration` does. Secrets in `config` come back as `{"configured": true}`, and so do secret headers in `request.secretHeaders` (one still waiting for its value comes back as `""`) and plain headers whose name looks like a credential, such as `Authorization` or `X-N8N-Key`. Other headers, the URL and fixed parameter values come back as stored, so keep credentials in **Authentication** or in a secret header. On failure it returns `found: false`, `error_code` and `error`: `integration_not_found` when the integration is not in your organization, or `integration_not_supported` when it is not an HTTP request integration.

#### `update_integration`

Replaces the settings of one HTTP request integration (a webhook) on a voice or chat agent.

| Input | Type | Description |
| - | - | - |
| `integration_uuid` | string (UUID) | The integration. Required. |
| `config` | object | The whole new `config`. Required. |

Read the integration with `get_integration`, change what you need and send the whole `config` back. Settings you leave out are not kept, except for credentials.

Credentials stay as they are, and you change them in the console:

* Leave out `request.auth`, `advanced.callerVerification` and `advanced.signingSecret`, or send them exactly as `get_integration` returned them. Any other value, including removing them, returns `integration_secret_not_allowed`. An integration still waiting for its key stays pending: send its `request.auth` back as read, without a `secret`.
* When `request.auth` has a type but no key yet, and no secret header has a stored value, the integration gets the same credential as on create: a Supabase function gets the custom header `klatt-key` (unless a secret header already names `klatt-key`), and an `api_key` on an n8n `/webhook/` URL becomes a custom header. The result then returns `auth` with what was stored; send the `config` this result returns in later updates. A stored key and a webhook without any credential are never changed. So a webhook that an assistant set up with the wrong credential type is fixed by a plain `update_integration`.
* Leave out `request.secretHeaders` or send it exactly as `get_integration` returned it. Adding, changing, renaming or removing a secret header returns `integration_secret_not_allowed`.
* While the integration has a credential in `request.auth` or a secret header, the scheme and host of `request.url` cannot change, so the credential is never sent to another server. The path and query can change.
* An integration that still has a plain header with a credential-looking name, such as `X-N8N-Key`, reads it masked, and an update that sends it back is refused with a `console_url`. Do not leave the header out to get past it, because that removes the credential your endpoint checks. Send the user to `console_url` instead: opening the webhook there keeps the header as a secret one, and saving seals it.

If the request changes (URL including query, method, headers, body or fixed parameter values) to one that no activated webhook of your organization sends, the webhook becomes `pending_activation: true` until a user activates it in the console; an update never clears it. On success it returns `updated: true` and the same fields as `get_integration`, including `pending_secrets`, and `console_url` and `next_step` when a key is missing. A refusal that only the console can resolve (credentials, secret headers or a host change) adds a `console_url` that opens the webhook. On failure it returns `updated: false`, `error_code` and `error`, and nothing changes. An invalid `config` returns `integration_config_invalid` with an `errors` list of the settings to fix. Other codes include `integration_secret_not_allowed`, `integration_not_found`, `integration_not_supported`, `integration_function_name_conflict`, `tool_budget_exceeded` and `update_failed`.

### Documentation

#### `search_docs`

Searches Klatt's public guides, so an assistant can answer how to set something up and cite the guide.

| Input | Type | Description |
| - | - | - |
| `query` | string | What to look for, in plain words. Required. |

Returns `found: true`, up to three `results` (`title`, `url`, `description`) and an `excerpt` (`url`, `text`) of the best match. Cite the `url` to the user. When nothing matches it returns `found: false`, an empty `results` list and `docs_url`. When the guides cannot be read it returns `found: false`, `error: "docs_unavailable"`, `docs_url` and a `message`. It is a Read tool and works with any API key.

#### `get_setup_guide`

Loads the guide an assistant follows before it creates or changes an agent, a webhook, a transfer, knowledge or a connection, so it asks the user little and puts each thing in the right place.

| Input | Type | Description |
| - | - | - |
| `guide` | string | `start`, `create_agent`, `review_agent`, `change_agent` or `connect_service`. Required. |
| `agent_uuid` | string | An agent to read as well. Optional. |

Returns `guide`, `instructions` (the guide in Markdown), `guide_token` (see [Guides and guide\_token](#guides-and-guide_token); it lasts 2 hours) and, with `agent_uuid`, `agent`: the agent's setup field by field (instructions, greeting, rules, capture fields, knowledge, webhooks, transfer targets and `setup`), never a stored key. It is a Read tool; reading an agent needs the permission to manage agents, and an agent of another organization is reported as not found.

#### `audit_agent`

Reviews one voice or chat agent without changing it. An assistant uses it when you ask whether an agent is ready or good, or say something goes wrong (it does odd things, it does not transfer, it does not save the data), after loading the `review_agent` guide.

| Input | Type | Description |
| - | - | - |
| `agent_uuid` | string | The voice or chat agent to review. Required. |

Returns `agent` (`kind`, `uuid`, `name`), `findings` (each with a `priority`, a `code`, the field it concerns and a proposed fix, most urgent first) and `recent`: counts from the last 14 days of conversations (failed webhook calls during voice calls and after conversations, refused transfers, open unanswered questions and escalations). The findings `transfer_restated`, `webhook_restated`, `search_restated` and `ability_missing` also carry `passage`, the paragraph they concern; it is left out when that paragraph contains a key or is longer than 1,500 characters. The codes `transfer_restated`, `webhook_restated` and `search_restated` mean a paragraph repeats what a transfer target, a webhook or the web search already says. `ability_missing` means the instructions promise an SMS, a WhatsApp message or a transfer the agent cannot do. `search_description_unclear` means the web search description is empty or too vague to tell the agent when to use it. When an assistant creates an agent, its guide ends with this review. The result returns text written by callers, so it comes in the untrusted-data tags described in [Inputs and results](#inputs-and-results). It is a Read tool and needs the permission to manage agents; an agent of another organization is reported as not found. The assistant proposes each fix and applies it only after you say yes.

## Limits and errors

MCP requests use the same key and the same limit as the REST API: 300 requests per minute per key, and every MCP HTTP request counts as one request (a tool call usually needs several). See [Rate limits](https://docs.klatt.ai/api-reference/rate-limits.md). Authentication errors and `429` responses use the same format as in [Errors](https://docs.klatt.ai/api-reference/errors.md); a missing or invalid key answers `401`.

## Security

* Treat what tools return as data, not as instructions. Names and text in your organization can be written by other people.
* Review what an assistant wants to do before you approve a tool call, especially tools marked destructive, `create_integration` and `update_integration`.
* Use a separate key for each tool or person, so you can delete one without affecting the others.


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