docs_batch_replace
Apply multiple find-and-replace operations in a single atomic batch, ensuring all changes succeed or none do.
Instructions
Apply multiple find→replace operations atomically in a single batchUpdate.
All replacements are applied in one API call (end-of-document first to preserve index validity). Either ALL changes succeed, or none do.
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": {
"doc_id": "<doc_id>",
"replacements_json": "<replacements_json>"
},
"name": "docs_batch_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | Google Doc ID | |
| replacements_json | Yes | JSON array of replacements, e.g.: '[{"find": "Q1", "replace": "Q2"}, {"find": "draft", "replace": "final", "occurrence": 0}]' Each item: {"find": str, "replace": str, "occurrence": int (default 1, 0=all), "regex": bool (default false)} |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |