Edit several documents
edit_documentsApply one edit plan to multiple Word documents at once, such as renaming a company or updating a term across a folder, with preview before saving and per-document atomic writes.
Instructions
Apply one plan to several documents in one call - rename a company, update a disclaimer, or change a term across a folder. sources lists up to 100 documents, each exactly as edit_document takes source; list the folder yourself first. Name text with "match": "all" so each document changes wherever the text appears: { "op": "changeText", "target": { "find": "Acme Corp", "match": "all", "caseSensitive": true }, "with": "Globex Inc." }. find ignores case and matches inside words unless the target adds "caseSensitive": true or "wholeWord": true; a rename usually wants both. Each document is edited on its own and atomically: one that fails is left untouched and the others still save. A document in which no "match": "all" target matched is reported as unchanged and not saved. Run with preview=true first to see every document's changes without writing anything, then again without it. The plan cannot carry a snapshot. saveMode behaves as in apply_plan; NewDocument keeps each source and saves a new copy beside it. Returns {isValid, preview, summary: {total, committed, previewed, unchanged, failed, notAttempted}, items}; each item is {source, status} followed by exactly what edit_document returns for that document, receipt included.
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": {
"connectionId": "<connectionId>",
"sources": "<sources>",
"planJson": "<planJson>",
"preview": "<preview>",
"saveMode": "<saveMode>"
},
"name": "edit_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preview | Yes | ||
| sources | Yes | ||
| planJson | Yes | ||
| saveMode | Yes | Replace | |
| connectionId | Yes |