Replace text
docs_replace_textFind and replace text throughout a Google Docs document with index-safe replacements and an optional dry-run preview to verify changes before applying.
Instructions
Find and replace text throughout a document. Carries no indices, so it is immune to index drift and is the safest way to change wording. Supports dryRun.
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": {
"document": "<document>",
"replacements": "<replacements>"
},
"name": "docs_replace_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab id or title, for documents with several tabs. Reads default to the first tab; writes to a multi-tab document REQUIRE this rather than guessing. Get ids from docs_describe. | |
| dryRun | No | Return the exact requests that would be sent, in the order they would be applied, and send nothing. | |
| account | No | Google account to act as. Optional when one is authorised or a default is set. | |
| document | Yes | Document URL or file id. Both accepted. | |
| replacements | Yes | Text replacements. These carry no indices, so they are immune to index drift. |