Skip to main content
Glama

docs_replace

Find and replace across a whole Google Doc while keeping surrounding formatting; returns the number of matches replaced.

Instructions

Find and replace across a whole Google Doc using Docs' own Find and replace (keeps surrounding formatting). Returns how many were replaced.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docYesGoogle Docs URL or document id.
findYes
regexNoTreat find as a regular expression (Docs/RE2 syntax). Default false.
accountNoWhich signed-in Google account to use: an index as in /u/N/ URLs (0 = first account) or an email address. Omit for the browser default. Use this for documents owned by a second (e.g. school) account.
replaceYesReplacement text (plain). Empty string deletes every match.
matchCaseNoDefault false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose two useful traits beyond structured data: formatting around matches is preserved, and the return value is a count of replacements. However, it omits the mutation's irreversibility, any permission/account caveats, and behavior on zero matches.

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?

Two tight sentences with the operation and its key caveat front-loaded; nothing is wasted and the return value is stated last where it belongs.

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 mutation tool with no annotations and no output schema, the description covers purpose, a formatting behavior, and the return value, but leaves the safety/permission profile unstated. Adequate but with clear gaps for a write operation.

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 83%, so the schema already documents doc, regex, account, replace, and matchCase meaningfully. The description adds no parameter-level meaning beyond the schema, which is acceptable at this coverage level.

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+resource and scope ('find and replace across a whole Google Doc'), and the parenthetical clarifies the mechanism ('Docs' own Find and replace'). It doesn't explicitly differentiate itself from close siblings like docs_edit or docs_write, but the whole-document replace scope is clear enough to distinguish it.

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

Usage Guidelines3/5

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

Usage is only implied by the tool's name and purpose; there is no explicit when-to-use, when-not, or named alternative (e.g. docs_edit for targeted edits). An agent can infer the intent but gets no routing guidance.

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