update_document
Replace an existing document's full content in the knowledge base and re-index it immediately, so updated information becomes searchable without manual reindexing.
Instructions
Update the content of an existing document in the knowledge base.
Mutating — overwrites the file on disk and re-indexes immediately. Old chunks are removed and replaced with new ones. Full content replacement, not a patch. The category is detected again from the path through category_mappings (general when none matches), so a category stored by add_document() or add_from_url() is not kept.
Args: filepath: Full or relative path to the document file. Must be an already-indexed file — list_documents() lists indexed paths, one page at a time. content: New full-text content to replace the existing content entirely
Returns: JSON string with update results (old chunk count, new chunk count, status).
Usage: Use to replace a document's content completely. Use add_document() to create a new file instead. Use remove_document() to delete without replacing. Changes are immediately searchable — 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": {
"filepath": "<filepath>",
"content": "<content>"
},
"name": "update_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| filepath | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |