Skip to main content
Glama

Rewrite a whole Google Doc

replace_google_doc_content
Destructive

Replace everything in a Google Doc with new text written in markdown. The document keeps its id, sharing and version history (an earlier version can be restored from Google Docs' version history). Confirm with the user first: everything in it is replaced. For a smaller change use append_to_google_doc, replace_text_in_google_doc or replace_google_doc_section.

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>",
      "content": "<content>"
    },
    "name": "replace_google_doc_content"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentYesThe whole new text, in markdown
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.7/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, but the description adds real behavior the agent cannot infer: the document id, sharing, and version history survive the rewrite, and a prior version is recoverable via Google Docs' version history. That is precisely the risk/reversibility context an agent needs before invoking a destructive overwrite.

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 sentences, each earning its place: scope first, then reversibility/confirmation, then sibling routing. Nothing is repeated and the destructive warning is front-loaded with the scope statement.

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

Completeness5/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, three-required-parameter mutation, the description covers what gets destroyed, what is preserved, how to recover, and when to use a narrower sibling. Nothing an agent needs in order to call it safely is missing.

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%, so mailbox, documentId, and content are already fully documented, including the markdown format and 200000-char cap. The description restates the markdown/whole-content intent for `content` but adds no syntax, limits, or edge-case meaning beyond the schema; baseline 3 applies.

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?

"Replace everything in a Google Doc with new text written in markdown" gives a specific verb, resource, and explicit scope (everything). The scope word "everything" plus the format detail makes it immediately distinguishable from the partial-edit siblings named later.

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

Usage Guidelines5/5

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

It names three concrete alternatives and the condition that selects them: "For a smaller change use append_to_google_doc, replace_text_in_google_doc or replace_google_doc_section." It also states a usage prerequisite the agent would otherwise miss: confirm with the user first.

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