Edit a Google Doc
edit_docReplace an exact text snippet in a Google Doc with new content, using inline markdown for formatting and optional replace-all.
Instructions
Replace an exact unique snippet of text in a Google Doc (like a local file Edit). old_string is matched markup-tolerantly; ambiguous matches return surrounding context to disambiguate. new_string is interpreted as inline markdown (bold, italic, code, text). NOTE: this is a direct edit — the change is applied as live text, not a tracked suggestion (the Docs API cannot create suggestions). If the doc has pending suggestions from other reviewers, flag to the user that your edit will sit alongside them as an accepted change.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Target a specific tab by tabId or title (from list_tabs). Defaults to the first tab. | |
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| documentId | Yes | Google Doc id | |
| new_string | Yes | replacement text | |
| old_string | Yes | exact text to replace (quote a unique slice from read_doc) | |
| replace_all | No | replace every occurrence (default false) |