Skip to main content
Glama

docs_write

Write markdown or plain text into a Google Doc using its existing styles. Insert, append, or replace content based on anchors, headings, or specific text matches.

Instructions

Write markdown (or plain text) into a Google Doc, typed in the document's own styles. Modes: append, prepend, replace_document (overwrites the body), insert_after / insert_before / replace_text (relative to an exact anchor snippet; replace_text with empty text deletes it), replace_section (anchor = heading text; replaces everything under that heading up to the next heading of the same or higher level). Markdown: headings, bold/italic/code/links, bullet/numbered/task lists with nesting, quotes, code blocks, tables, rules, images (alt), and \pagebreak on its own line. The result says whether Drive has the change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docYesGoogle Docs URL or document id.
modeYes
textNoContent as literal plain text (no markdown interpretation). Use this or markdown.
anchorNoinsert_after / insert_before / replace_text: exact text already in the document (case-insensitive unless matchCase). replace_section: the heading text.
accountNoWhich signed-in Google account to use: an index as in /u/N/ URLs (0 = first account) or an email address. Omit for the browser default. Use this for documents owned by a second (e.g. school) account.
asBlockNoinsert_after / insert_before: put even a one-paragraph payload in its own new paragraph instead of splicing it inline.
markdownNoContent as markdown. Use this or text.
matchCaseNoAnchor matching is case-sensitive. Default false.
occurrenceNoWhich match of the anchor: 1 = first (default), 2 = second, -1 = last.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose destructive behavior: replace_document overwrites the body, replace_text with empty content deletes text, replace_section wipes the section. It also notes the return value ('says whether Drive has the change'). It omits auth/permission requirements and any reversibility or conflict guidance for a mutation 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?

Front-loaded with the core verb and resource before the dense mode catalogue. Every clause adds information, though the parenthetical-heavy mode enumeration reads as a wall of text and could be tightened with parallel phrasing.

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?

No output schema exists, and the description does state the return shape minimally ('says whether Drive has the change'). For a 9-parameter mutation tool, mode semantics, markdown support, and overwrite/deletion behavior are covered; only permissions and failure modes are absent.

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 89%, so the baseline is 3, and the description adds genuine value the schema lacks: the mode enum values are undocumented in the schema but are defined here, including mode-relative meaning for `anchor` and the deletion behavior of replace_text. Markdown features (images, pagebreak, task lists) are also spelled out, which the schema only gestures at via the `markdown` field.

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?

Specific verb + resource ('Write markdown (or plain text) into a Google Doc, typed in the document's own styles') with an exhaustive mode list, so an agent immediately knows this is a content-writing tool. It does not, however, distinguish itself from the many overlapping siblings (docs_edit, docs_replace, docs_type, docs_fill), leaving the agent to infer boundaries.

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?

Gives per-mode conditions: replace_document 'overwrites the body', replace_text 'with empty text deletes it', replace_section anchors on 'heading text' and replaces everything up to the next same-or-higher heading. That is real conditional guidance for choosing a mode, but there is no statement about when to prefer this tool over the sibling edit/replace/type tools.

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