Skip to main content
Glama

docs replace text

docs_replace_text
Idempotent

Replaces every occurrence of a string in a Google Doc and reports how many changes were made, with optional case matching.

Instructions

Replace all occurrences of a string in a document; reports how many changed.

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_id": "<document_id>",
      "find": "<find>",
      "replace": "<replace>"
    },
    "name": "docs_replace_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
findYes
replaceYes
match_caseNo
document_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=true and openWorldHint=true, so the safety profile is covered. The description adds the useful behavioral note that all occurrences are replaced and a count is returned, but it omits what happens when no match exists and whether the sweep covers headers, tables or footnotes.

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?

A single sentence with the operation front-loaded and the return behavior trailing; no filler words and nothing that repeats the schema or title verbatim.

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?

An output schema exists, so the return count need not be expanded, and the annotations cover mutation semantics. However, for a four-parameter mutation tool with zero schema descriptions, the definition leaves match_case behavior and document targeting unexplained, which is a real gap for correct invocation.

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

Parameters2/5

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

Schema description coverage is 0% across four parameters, so the description carries the full explanatory burden and does not meet it. It conveys only that 'find' and 'replace' are strings and that replacement is global; document_id and match_case (which defaults to true) are given no meaning anywhere.

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?

States a specific verb and resource ('Replace all occurrences of a string in a document') with explicit scope ('all occurrences') plus a return behavior ('reports how many changed'). It is clear enough to distinguish from docs_append_text/docs_insert_text by the fact that it targets existing text rather than adding new text, though it never names those siblings.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance and no reference to alternatives such as docs_insert_text or docs_append_text. The agent must infer from the verb alone that this is for overwriting existing matches rather than adding content.

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