Skip to main content
Glama

Document Update

document_update
Destructive

Replace an entire txt/md document's content with upstream-enforced edit rights. Use document_read first to avoid losing text; use document_create for a new asset or document_upload for PDF.

Instructions

Replace an entire txt/md document's content with upstream-enforced edit rights. Use document_read first to avoid losing text; use document_create for a new asset or document_upload for PDF. This is replacement, not merge-patching, and cannot edit PDF content. Consult campaign_document_list's canEdit when supplied; rights depend on asset scope and current membership, not uploader identity alone. Empty content clears the text. Repeated writes can update metadata or notifications; no full-operation idempotency is promised. Returns upstream REST data. Returns {ok:true,data} on success; tool-body failures return {ok:false,error} with optional diagnostic data. Argument-schema errors are MCP errors.

Input Schema

NameRequiredDescriptionDefault
contentYesComplete text, including empty text, at most 900 KiB UTF-8; rejects C0/DEL controls except TAB/LF/FF/CR.
document_idYesExisting editable text document asset ID, not a share-link ID.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

The annotations already mark this as destructive, non-idempotent, and open-world, and the description adds substantial context beyond them: upstream-enforced edit rights, rights depending on asset scope and membership rather than uploader identity, empty content clearing text, metadata/notification side effects, and no promised full-operation idempotency. It also describes success, tool-body failure, and MCP argument-error response shapes. Nothing contradicts the annotations.

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 definition is front-loaded with the core action and alternatives, and most sentences carry useful constraints or failure behavior. It is slightly dense and has minor redundancy around returning upstream REST data versus the explicit {ok:true,data} response shape, but it is not padded.

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?

Given the destructive non-idempotent mutation, two required parameters, output schema, and permission complexity, the description covers the critical context an agent needs: replacement semantics, edit-rights dependency, alternatives, side effects, and error behavior. The output schema carries return-value detail, so the description's return notes are supplementary rather than missing.

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 the baseline is 3, but the description adds meaningful semantics beyond the schema: content replacement is wholesale rather than merge-patching, empty content clears the text, and PDF content cannot be edited. The document_id meaning is already well covered by the schema, so this is not a full 5.

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 states a specific verb and resource: replace an entire txt/md document's content. It explicitly distinguishes this from merge-patching, PDF editing, reading, creating, and uploading, so the agent can identify the correct operation without opening 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?

It gives explicit when-to-use guidance: call document_read first to avoid losing text, use document_create for a new asset, use document_upload for PDF, and consult campaign_document_list's canEdit when available. The exclusions and alternatives are unusually clear.

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