Skip to main content
Glama
Matthew3957

ai-toolkit

by Matthew3957

docs_replace_body

Replace a Google Doc's entire body with plain text, preserving the document's metadata and revision history. Read the current content first, then send the complete new text to overwrite it.

Instructions

Replace a Google Doc's entire body with plain text.

The Doc keeps its id, link, title, sharing, and revision history (the old body is recoverable from version history in the Docs UI), but all formatting is flattened — this is for Docs that work as living text documents, not designed artifacts. Read with docs_read_text first and send the complete new body; this replaces, it does not merge.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
document_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and fully delivers: it discloses formatting flattening, preservation of id/link/title/sharing/revision history, recoverability of the old body via Docs version history, and the replace-not-merge behavior. This gives the agent a complete picture of what is destroyed and what survives.

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?

The core operation is front-loaded in the first sentence, and the overall length is appropriate for the complexity. Each subsequent clause adds distinct value — preservation, recoverability, workflow, and scope — but the information is delivered as one dense paragraph rather than cleanly structured guidance, which slightly reduces scannability.

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?

An output schema exists, so return values need no description-level explanation. The definition covers the mutation's safety profile (formatting destroyed, identity and history preserved), the required read-first workflow, and the intended use case — everything an agent needs to correctly invoke a two-parameter replacement tool with zero annotations.

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 description coverage is 0%, so the description must compensate. It does so for the text parameter by specifying it must be the complete new body in plain text, and the replace-not-merge clause further clarifies its semantics. document_id is never explicitly described, though it is trivially inferable from the tool name and purpose, making the compensation strong but not exhaustive.

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 opening sentence states a precise verb and resource: 'Replace a Google Doc's entire body with plain text.' The closing clause, 'this replaces, it does not merge,' explicitly differentiates it from docs_append_text and merge-style siblings, so an agent can distinguish this tool without inspecting sibling schemas.

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?

The description names docs_read_text as a mandatory prerequisite ('Read with docs_read_text first and send the complete new body'), laying out a clear workflow. It also scopes applicability — 'for Docs that work as living text documents, not designed artifacts' — providing both a when-to-use and an implicit when-not-to-use signal.

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