patch_document
Apply a unified diff patch to an existing document to create a new version, avoiding full content resends and payload size limits.
Instructions
Apply a unified diff patch to an existing document, producing a new version.
Use instead of push_document when only part of the document changed — avoids sending the full content and works around tool-call payload size limits.
patch must be in unified diff format (output of difflib.unified_diff). base_version must match the current latest version; if not, returns PATCH_BASE_MISMATCH — call get_document to fetch latest and regenerate.
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>",
"doc_id": "<doc_id>",
"base_version": "<base_version>",
"patch": "<patch>"
},
"name": "patch_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| doc_id | Yes | ||
| base_version | Yes | ||
| patch | Yes |