Skip to main content
Glama

docs_batch_replace

Apply multiple find-and-replace operations in a single atomic batch, ensuring all changes succeed or none do.

Instructions

Apply multiple find→replace operations atomically in a single batchUpdate.

All replacements are applied in one API call (end-of-document first to preserve index validity). Either ALL changes succeed, or none do.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYesGoogle Doc ID
replacements_jsonYesJSON array of replacements, e.g.: '[{"find": "Q1", "replace": "Q2"}, {"find": "draft", "replace": "final", "occurrence": 0}]' Each item: {"find": str, "replace": str, "occurrence": int (default 1, 0=all), "regex": bool (default false)}

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

There are no annotations, so the description carries the behavioral burden. It discloses atomicity ('Either ALL changes succeed, or none do'), single-call execution, and even the internal ordering detail ('end-of-document first to preserve index validity'). This is strong behavioral transparency beyond what the schema provides.

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 states exactly what the tool does, and the second sentence adds critical atomicity and execution-order behavior with no wasted words.

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

Completeness4/5

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

With only two required parameters, 100% schema coverage, and an output schema present, the description covers the essential contract: what it does, how it behaves, and what success guarantees. It could be even more complete by mentioning limits or failure behavior, but nothing critical is missing for correct invocation.

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 coverage is 100%, and the schema already gives detailed descriptions and examples for replacements_json, including the occurrence field. The description adds no parameter-specific semantics beyond what the schema documents, so the baseline of 3 is appropriate.

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 clearly states the verb and resource: 'Apply multiple find→replace operations atomically in a single batchUpdate.' It also distinguishes itself from siblings by emphasizing 'multiple,' 'atomically,' and 'single batchUpdate,' which sets it apart from a presumably non-atomic search/replace tool like docs_search_replace.

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 communicates clear usage context: use this tool when multiple replacements must happen in one call with atomic all-or-nothing semantics. It does not explicitly name alternatives or exclusion criteria, so it stops short of a perfect score, but the context is clear enough for an agent to choose it appropriately.

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

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/dbuxton/google-docs-mcp'

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