Skip to main content
Glama

Find and replace text

replace_all_text
DestructiveIdempotent

Replace every occurrence of a literal string throughout a Google Doc, or only within specified tabs. Returns the number of replacements, making it easy to verify if the text was found.

Instructions

Replaces EVERY occurrence of a literal string (no regex) across the whole document, or only in the tabs named by tab_ids. match_case defaults to true. Returns occurrencesChanged in the batchUpdate reply — 0 means the text was not found, not an error. Safer than replace_range for textual substitutions because it does not depend on indexes; use replace_range when position matters (e.g. only one of several occurrences).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
findYesThe literal text to find (no regex).
replaceYesThe replacement text; empty string deletes the occurrences.
tab_idsNoLimit the replacement to these tabs (from list_tabs); omit for all tabs.
match_caseNoCase-sensitive matching (default true).
document_idYesThe document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark the tool as destructive and not read-only, and the description adds valuable behavior beyond that: non-regex literal matching, global occurrence replacement, match_case defaulting to true, and the occurrencesChanged return semantics where 0 means not found. It also explains why this is safer than index-based replacement. No statement contradicts the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the first sentence conveys the core operation and scope, and the remaining sentences add matching defaults, return semantics, and routing guidance. Every sentence earns its place with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even though there is no output schema, the description explains the meaningful return value and the not-found convention. It also covers tab scoping, case sensitivity, regex behavior, and how this tool relates to replace_range. This is sufficient for an agent to select and invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description restates some schema concepts like 'literal string (no regex)' and 'match_case defaults to true', but it does not add new parameter-specific meaning beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: it replaces every occurrence of a literal string across the whole document or selected tabs. It also names replace_range as a distinct alternative, so an agent can tell this tool apart from the closest sibling without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use this tool vs replace_range: use replace_all_text for textual substitutions because it is not dependent on indexes, and use replace_range when position matters. It also clarifies scoping via tab_ids and the match_case default, leaving little ambiguity about invocation context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A1-x-Tech/mcp-google-docs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server