gws.docs.replace_text
Replace every occurrence of a literal text substring in a Google Doc, with case-sensitive matching by default. Returns the number of replacements made.
Instructions
Replace all occurrences of a literal substring in a Google Doc. NOT regex — find is matched as a literal substring. match_case defaults to true. Returns the number of occurrences changed. This tool irreversibly modifies user content. Confirm intent with the user before calling it on documents you did not create in this session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| find | Yes | The literal substring to find | |
| account | No | Account label or email. Uses default if omitted. | |
| replace | Yes | The replacement text (may be empty to delete matches) | |
| match_case | No | Whether the search is case-sensitive (default true) | |
| document_id | Yes | The document ID |