gws.docs.replace_text
Replace all literal occurrences of a specified substring in a Google Doc with replacement text. Supports case-sensitive matching and returns the count of changes applied.
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 |