Skip to main content
Glama

gws-mcp__docs_batch_update

Destructive

Apply batch updates to a Google Doc. Supports inserting text, replacing text, deleting content ranges, and other document modifications. Uses the Google Docs API batchUpdate format.

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>",
      "requests": "<requests>"
    },
    "name": "gws-mcp__docs_batch_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
accountNoOptional email address of the connected account to use (e.g. 'user@gmail.com'). If omitted, the default account is used.
requestsYesArray of Google Docs API request objects, applied in order. Common shapes, with the nesting exactly as the API requires: insertText { insertText: { location: { index: 1 }, text: "Hello" } }; replaceAllText { replaceAllText: { containsText: { text: "old", matchCase: true }, replaceText: "new" } } — note matchCase sits INSIDE containsText, never at the top level of replaceAllText; deleteContentRange { deleteContentRange: { range: { startIndex: 1, endIndex: 10 } } }; updateTextStyle { updateTextStyle: { range: { startIndex: 1, endIndex: 10 }, textStyle: { bold: true }, fields: "bold" } } — fields is required and names which textStyle properties to apply. Indices are the character positions docs_get mode "index" reports.
document_idYesThe Google Docs document ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is covered; the description confirms the destructive surface by naming content-range deletion. It adds that requests follow the Google Docs API batchUpdate format, but omits the key behavioral gotcha that character indices shift after each applied request and that deletions are not undoable via the tool.

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

Conciseness4/5

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

Three short sentences, front-loaded with the action, then capabilities, then the format pointer. The only slack is the trailing catch-all "and other document modifications," which adds little after the explicit list.

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 destructive mutation tool with no output schema, the description covers what it does and what format to use, and annotations cover the destructive flag. It stops short of what an agent needs to call it safely in sequence: that indices must be re-read via docs_get mode "index" between dependent edits, and what the response contains (e.g. per-request replies).

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% and the requests parameter already documents the exact nesting for insertText, replaceAllText, deleteContentRange and updateTextStyle plus index semantics. The description contributes only the pointer to the API batchUpdate format, which is marginally useful because it tells the agent where to resolve shapes not enumerated.

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 concrete verb+resource ("Apply batch updates to a Google Doc") and enumerates the operations covered (insert, replace, delete ranges, other modifications). It does not differentiate from the sibling gws-mcp__docs_write, which also modifies a document, so an agent cannot tell from the description alone which of the two to pick.

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?

The list of supported modifications implies when the tool is appropriate (multi-op, range-level edits), but there is no explicit when-not guidance and no named alternative such as docs_write for simple single edits or docs_get for reading indices first. Usage is inferable rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.