Add a file to an agent knowledge base
add_agent_knowledge_fileAdd a file to an agent knowledge base
Adds a file as knowledge source to a voice agent, as the dashboard upload does. Send the file as base64 in base64 with its name in fileName. Allowed are PDF, TXT, MD, CSV and JSON files of at most 15 MB; the content must match the extension (a PDF starts with %PDF-, text files are UTF-8), otherwise the request is rejected with 400. Over MCP the whole request may be at most 1 MB, so larger files go through the API directly. The document is created in the voice engine and attached to the agent. When that fails, the request still succeeds and the entry is stored with status failed; delete it and add it again.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agentId": "<agentId>",
"body": "<body>"
},
"name": "add_agent_knowledge_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | The file and its name. | |
| agentId | Yes | Identifier of the voice agent. Accepted either as the public form `agent_12` or as the bare number `12`; the prefix is stripped before the lookup. |