Skip to main content
Glama

Rewrite one section of a Google Doc

replace_google_doc_section
Destructive

Replace the text under one heading of a Google Doc, up to the next heading of the same or a higher level. The heading itself stays. Plain text: each line becomes a paragraph. If the heading isn't found, nothing changes and the document's headings are listed.

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": {
      "mailbox": "<mailbox>",
      "documentId": "<documentId>",
      "heading": "<heading>",
      "content": "<content>"
    },
    "name": "replace_google_doc_section"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentYesThe section's new text
headingYesThe heading's text, as it appears in the document
mailboxYesEmail address of the connected Gmail/Google Workspace mailbox to act on. Call list_authorized_mailboxes to see available options.
documentIdYesThe Google Doc's id, from search_gdrive_items or list_gdrive_items

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the mutation risk is known. The description adds real behavioral detail beyond that: the heading line is preserved, plain text is converted line-by-line into paragraphs, and a missing heading causes no change plus a listing of existing headings. Only irreversibility of the discarded text is left implicit.

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 the scope constraint front-loaded, followed by formatting semantics and then the failure path. Nothing is repeated and nothing is padding.

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?

For a destructive, no-output-schema mutation the description covers scope, formatting interpretation, and the not-found path, which is what an agent needs to call it safely. It stops short of describing the success response or confirming that the overwritten text is unrecoverable, a small remaining gap.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema does not: heading matching determines the section extent, and the content string is interpreted as plain text where each line becomes a paragraph. That formatting semantics is valuable and non-obvious.

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 names a specific verb and resource ("Replace the text under one heading of a Google Doc") and pins down the exact boundary of the edit: "up to the next heading of the same or a higher level." That scope definition is what separates it from whole-document or find-and-replace siblings, so an agent can pick it without opening another schema.

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?

It gives a clear applicability condition (operating on a heading-bounded section) and states the fallback when the heading is absent, which is useful selection context. However, it never explicitly contrasts itself with the whole-document or text-substitution siblings, so the when-not guidance is only implied.

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.

Resources