Skip to main content
Glama
gworkspace-mcp
by ctschak

Replace text

docs_replace_text

Find 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

NameRequiredDescriptionDefault
tabNoTab 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.
dryRunNoReturn the exact requests that would be sent, in the order they would be applied, and send nothing.
accountNoGoogle account to act as. Optional when one is authorised or a default is set.
documentYesDocument URL or file id. Both accepted.
replacementsYesText replacements. These carry no indices, so they are immune to index drift.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral load, and it does disclose the key traits: index-free operation, drift immunity, and dryRun support. It does not state that all occurrences are replaced, whether changes are reversible, or what permission/response behavior to expect from a mutation.

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?

Three short sentences with no filler; the core action comes first and the safety rationale and dryRun note follow in descending priority.

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

Completeness3/5

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

For a simple two-required-parameter mutation with no annotations and no output schema, the description covers action, safety, and dryRun but omits what the call returns and whether replacement is global or first-match only. That leaves a gap an agent would want filled.

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 schema already documents tab, dryRun, account, document, and the replacements shape. The description reinforces dryRun and the index-free nature of replacements but adds no format or default details beyond the schema, so baseline 3 applies.

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

Purpose4/5

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

"Find and replace text throughout a document" gives a specific verb (replace) and resource (document text) with scope (throughout). It implicitly contrasts with index-based editing via the "no indices" framing, though it never names docs_batch_update_raw or docs_find explicitly.

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

Usage Guidelines4/5

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

The description gives clear selection context by declaring this the "safest way to change wording" because it avoids index drift, which steers an agent away from index-based siblings for text edits. It stops short of stating exclusions (e.g., use a different tool for formatting or structural changes).

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