add_document
Add raw text or markdown documents to a searchable knowledge base, writing the file and indexing it immediately so new content is available to search.
Instructions
Add a new document to the knowledge base from raw text content.
Mutating — writes a file to disk and indexes it immediately. No auth required.
Args: content: Full text content of the document (markdown supported) filepath: Relative path within documents directory (e.g., "security/new-technique.md"). The subdirectory should match the category. category: Category stored with the document (default: general). Any name is accepted, but search_knowledge() filters only by configured categories (category_mappings values, keyword_routes keys, general), and update_document() or re-indexing the file detects it again from the path through category_mappings. list_categories() shows the categories in use.
Returns: JSON string with indexing results (filepath, chunks created, status).
Usage: Use to add new documents from text content. Use add_from_url() instead when the source is a web page. Use update_document() to replace content of an existing file. The document is immediately searchable after this call — no manual reindex needed.
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": {
"content": "<content>",
"filepath": "<filepath>"
},
"name": "add_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| category | No | general | |
| filepath | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |