Skip to main content
Glama

update_document

DestructiveIdempotent

Actualiza nombre y/o contenido de un documento (el contenido REEMPLAZA todo lo anterior). Acepta markdown (títulos, negritas, listas, tablas, citas, código) y lo convierte a formato del editor; si el contenido ya viene en HTML se guarda tal cual. Cada renglón es un bloque: los renglones seguidos NO se juntan en un párrafo. Un bloque ```mermaid es un DIAGRAMA: se dibuja solo al abrir el documento. Si el contenido ya existe como ARCHIVO (lo bajaste, lo generó un script) o pesa más de ~20 KB, no lo mandes en content: start_document_upload lo sube por curl sin pasar por el modelo. Para cambiar una parte, patch_document; para agregar al final, append_document. base_version: el updated_at con que leíste el documento (get_document lo devuelve). Si alguien lo cambió en el medio, falla en vez de pisar. Si el documento está abierto en la app, el editor recarga solo con lo nuevo. Las versiones anteriores se guardan de a ratos (get_document_versions), no en cada cambio: lo escrito en el último minuto puede no tener copia. Devuelve un resumen (bytes, bloques, tablas, títulos en orden, sha256) para verificar sin releer.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "document_id": "<document_id>"
    },
    "name": "update_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
contentNoContenido nuevo en markdown (o HTML ya armado, que pasa intacto). Reemplaza todo el contenido anterior.
document_idYesID del documento
base_versionNoupdated_at con el que se leyó el documento; si cambió desde entonces, no se escribe
workspace_idNoUUID del workspace, o su nombre tal como lo dice el usuario ('Acme', 'el personal'). Omitir si el token ya tiene workspace fijo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, idempotentHint=true, and readOnlyHint=false, and the description is consistent with them, adding concrete consequences: total content replacement, markdown-to-editor conversion, one block per line, mermaid rendering, live editor reload, and that version backups are periodic rather than per change. It could still be clearer about permissions or whether 'name' alone also bumps the version.

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 replace-everything warning, then alternatives, then edge behaviors. Dense and largely justified, though the paragraph could be broken into shorter bullets for faster scanning.

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?

Covers everything an agent needs for a destructive mutation: what is overwritten, conversion behavior, size escape hatch, concurrency semantics, and even the returned 'resumen' fields (bytes, blocks, tables, headings order, sha256) despite there being no output schema.

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?

With 80% schema coverage the baseline is 3, and the description genuinely adds meaning: base_version is an optimistic-lock token sourced from get_document/updated_at, content accepts markdown or raw HTML and is size-capped, and workspace_id may be omitted on fixed-workspace tokens. The 'name' parameter remains unexplained beyond the schema.

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?

States a specific verb and resource ('Actualiza nombre y/o contenido de un documento') and immediately qualifies the destructive scope ('el contenido REEMPLAZA todo lo anterior'). It also names the siblings it is not (patch_document, append_document, start_document_upload), so the agent can differentiate it without opening other 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?

Explicit routing rules: partial edits go to patch_document, appends to append_document, and file-based or >20 KB content to start_document_upload. It also states the concurrency precondition for base_version and what happens on mismatch (fails instead of overwriting).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources