Update file
update_fileUpdates an existing file's metadata, and/or its content if it is small plain text (.md, .txt, .html, or .json) - found by path. Fails if no file exists there - use create_file. Only the fields you pass change; the rest are kept. To replace the bytes of a pdf / doc / ppt / image / .csv / .xls / .xlsx file, or a large file of any kind, use create_upload with the same path instead - uploading to an existing path overwrites it. To replace an IMAGE (.png, .jpg, .jpeg, .gif, .webp, up to 256 KB) in one step, pass content_base64 instead of content: its title, description and tags are kept unless you pass them. To rename or relocate, use move_file.
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": {
"path": "<path>",
"context": "<context>"
},
"name": "update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Full path of the file to update, e.g. '/reports/q3.md'. | |
| tags | No | Replace the tag list. Omit to keep the current one. | |
| type | No | Change the file's category. Omit to keep the current one. The file's category - a lowercase slug you choose ([a-z0-9-]), NOT a mime type or extension. Groups files for the `type` filter when listing. Use 'doc' unless you have a reason to pick another. Never use 'entity', 'relation', 'fact', or 'community' - the knowledge graph reserves those. | |
| title | No | Change the title. Omit to keep the current one. | |
| content | No | New full text content. Omit to change only metadata. | |
| context | Yes | Explain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization." | |
| description | No | Change the one-line summary. Omit to keep the current one. | |
| base_version | No | Optional stale-write guard: the file's currentVersion exactly as read_file or list returned it. If the file has changed since, nothing is written and you get an error naming its current version - re-read, redo your change on the new text, and retry. Omit it to overwrite whatever is there. Covers content only, and is not available with content_base64. | |
| workspace_id | No | Which workspace to act in - a workspace id (whoami returns the id of your default workspace). Omit to use your default workspace. | |
| content_base64 | No | The bytes of an IMAGE file (.png, .jpg, .jpeg, .gif or .webp - not .svg), base64-encoded: standard alphabet, padded, at most 256 KB decoded. Use this instead of `content`, never together with it. The path extension must match the image format. Finishes before the call returns - no create_upload or polling. Larger images, or any other binary format, still need create_upload. |