Add knowledge document
add_knowledge_documentAdd text to a knowledge base as one document, stored as the file named by filename, which must end in .txt, .md or .markdown. text is 1 to 80,000 characters; put longer text in several documents, or upload a PDF, DOCX or larger file in the workspace or through POST /v1/knowledge-bases/{id}/documents. The document is processed in the background and becomes searchable when list_knowledge_documents shows it ready. Text identical to a document already in the base returns that document (deduplicated: true), in whatever state it is.
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": {
"project_id": "<project_id>",
"knowledge_base_id": "<knowledge_base_id>",
"filename": "<filename>",
"text": "<text>"
},
"name": "add_knowledge_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The document's text, at most 80,000 characters. | |
| filename | Yes | The document's file name, ending in .txt, .md or .markdown. | |
| project_id | Yes | The workspace project the knowledge base belongs to. | |
| organization_id | No | Optional. Defaults to the authenticated workspace; when supplied it must be that workspace's id. | |
| knowledge_base_id | Yes |