Skip to main content
Glama

Document Update

document_update
Destructive

Replace an existing text document's entire content in CozyVTT. Read the document first to avoid data loss; empty input clears the text.

Instructions

Replace an entire txt/md document's content (uploader/admin only). 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. 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

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true, idempotentHint=false), the description adds critical behavior: empty content clears the text, repeated writes are not fully idempotent and may update metadata/notifications, and it returns upstream REST data with a documented success/error envelope. This fully discloses the operation's safety and side-effect profile.

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 dense but every sentence earns its place: core action, prerequisite read, alternative tools, merge-vs-replace distinction, edge case (empty content), idempotency caveat, and return envelope. It is front-loaded with the main purpose and then proceeds logically through usage and behavior.

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 update tool, the description covers prerequisites, alternatives, limitations (PDF), edge cases, idempotency, return format, and error semantics. Combined with an output schema and rich annotations, nothing essential is missing for an agent to invoke this tool correctly.

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?

The schema already covers 100% of parameters with descriptions, so the baseline is 3. The description adds meaningful semantic context beyond the schema by explaining that empty content clears the text and restating that document_id must be an existing editable text document. This elevates it to a 4.

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 opens with a specific verb and resource: 'Replace an entire txt/md document's content'. It immediately differentiates itself from sibling tools by naming document_create, document_upload, and document_read, making clear what this tool is and is not for.

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?

Explicit guidance is provided: 'Use document_read first to avoid losing text; use document_create for a new asset or document_upload for PDF.' It also clarifies this is replacement, not merge-patching, and cannot edit PDF content, so an agent knows precisely when to select this tool.

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