Change a WikiDrive document
wikidrive_edit_docEdit a WikiDrive document by replacing a section or full text, or renaming it; version checks prevent overwriting changes and support merge-and-retry.
Instructions
Change one of the user's WikiDrive documents: replace the text of one section (change 'section'), replace the whole text (change 'replace'), or rename it (change 'title'). Use it when the user asks to correct, reorganize or rename a document, or, when automatic documents are on, to correct something that became wrong in a document an AI made (why 'auto'); a document the user wrote needs why 'asked'. Send base_version, the version you last saw; if the document changed since, nothing is written and the result gives the current version: open it with wikidrive_open, merge, and try once more. A section runs to the next heading of the same or higher level, so its sub-sections are part of it. The previous text stays in the document's history. Same content rules as wikidrive_create_doc. Afterwards tell the user the returned message in one line, in the user's language; it says how to undo.
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": {
"prompt_id": "<prompt_id>",
"change": "<change>",
"base_version": "<base_version>",
"why": "<why>",
"idempotency_key": "<idempotency_key>"
},
"name": "wikidrive_edit_doc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | Yes | 'asked' when the user asked for this in this conversation; 'auto' under the user's automatic-documents setting (only for documents an AI made). | |
| text | No | The new text: of the section without its heading line (change 'section'), or of the whole document (change 'replace'). Keep each heading at most 120 characters, so it can be named later. | |
| title | No | change 'title' only: the new title. | |
| change | Yes | 'section' replaces the text under heading (the section is made when missing); 'replace' replaces the whole text; 'title' only renames. | |
| heading | No | change 'section' only: the section's heading text without the leading #s. | |
| prompt_id | Yes | The document's prompt_id. | |
| base_version | Yes | The version wikidrive_open or the last document message showed. | |
| idempotency_key | Yes | A new random key (e.g. a UUID) for each new save; reuse it only to retry the same save after an unclear result. |