update_file
Replace a file's content with a new version; writes are rejected when the file changed since your last read, preventing overwrites of others' work.
Instructions
Replace a file's content as a new version. Call precheck_file first. Pass the version_id you read as base_version_id; if someone else changed the file meanwhile, the write is rejected instead of overwriting their work. The result lists approved knowledge your edit marked for re-checking. Requires a files:write key.
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": {
"file_id": "<file_id>",
"base_version_id": "<base_version_id>",
"content": "<content>"
},
"name": "update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Complete new content (replaces the whole file). | |
| file_id | Yes | File ID from list_files. | |
| request_id | No | Optional UUID to make retries idempotent; generated when omitted. | |
| base_version_id | Yes | The version_id you last read. The write is rejected if the file changed since. |