Skip to main content
Glama

Overwrite a doc (guarded)

overwrite_doc

Replace the entire body of a Google Doc with markdown content. Prevents data loss by verifying the title and refusing when comments/suggestions are present unless force is enabled.

Instructions

Replace the entire body of a doc (or one tab) with markdown-rendered content. Refuses if comments/suggestions are present (would orphan them) unless force=true. Pass expectTitle (the doc’s title) — shown for confirmation and verified against the live doc before replacing. For long documents, pass contentFile instead of content so the server reads the body directly (retyping a long doc inline can silently drop text). A direct edit, not a tracked suggestion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabNoTarget a specific tab by tabId or title (from list_tabs). Defaults to the first tab.
forceNoproceed even if comments/suggestions would be lost
accountNoGoogle account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account.
baseDirNoabsolute dir to resolve relative local image paths against (e.g. the markdown file’s folder)
contentNomarkdown content (or use contentFile)
documentIdYes
contentFileNopath to a local markdown/text file to use as the new body, read directly by the server — preferred for long documents so the body is passed through mechanically rather than retyped inline (which can silently drop text). Absolute, or relative to baseDir. Mutually exclusive with content.
expectTitleNothe doc’s title; verified before overwriting so a wrong id is refused
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 does it well. It discloses destructive behavior (overwrites the body), the refusal condition for comments/suggestions, the force escape hatch, the expectTitle verification mechanism, the contentFile mechanical-reading advantage, and the direct-edit (not tracked-suggestion) nature. This goes well beyond a simple mutation hint.

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?

The description is three sentences, with the core action and safety guard front-loaded. Every sentence adds critical information: what it does, when it refuses, how to avoid data loss, and the nature of the edit. No filler or redundancy.

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?

Given the tool's 8 parameters and no output schema, the description provides a solid operational picture: full replacement semantics, safety hooks, and important usage guidance for the most complex parameters. It could mention side effects beyond comment/suggestion loss (e.g., formatting replacement) or account permissions, but the current description is adequate for an agent to invoke it correctly in most scenarios.

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 high (88%), so the baseline is 3. The description adds meaningful semantics beyond the schema: it explains why contentFile is preferred for long documents (avoids silent text dropping), what expectTitle is used for (confirmation and live verification), and how force bypasses the comment/suggestion guard. This enhances the schema's bare parameter definitions.

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 uses a specific verb ('Replace') and resource ('entire body of a doc or one tab') and clarifies the markdown-rendering behavior. It distinguishes itself from sibling tools like edit_doc by explicitly stating this is a full-body replacement and 'a direct edit, not a tracked suggestion.'

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?

The description clearly communicates when to use this tool (full overwrite, including per-tab) and when to prefer alternatives: contentFile for long documents instead of inline content. It also flags a safety condition (refuses if comments/suggestions unless force=true). However, it does not explicitly name edit_doc as the alternative for targeted edits, though this is strongly implied.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dasasian/gdocs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server