Skip to main content
Glama

Change a document by its link

update_document

Writes a new version of a document by its link — e.g. the person asks in the chat to remove something on page 2 — and prints it again: the PDF link, the same edit link (the editor open on it shows the change). Send the whole new html (and data, if it is a template), changed from what get_document returned, with base_revision: a document the person changed after you read it is refused, so read it again.

Input Schema

NameRequiredDescriptionDefault
dataNoThe template's new data. Alone, only for a template (kind "template"); with html, non-empty data makes the document a template. Omitted: the data stays.
htmlNoThe whole new source. Omitted: the source stays (e.g. new data only).
nameNoA new name.
previewNoA picture (PNG) of page 1 comes with the answer, so you can check the layout, fonts and images before giving the links. Default: true.
filenameNoA new PDF file name, kept for its later prints. Default: the name it was printed with (render_pdf filename), else its <title>.
document_idYesThe document_id (or the edit link).
base_revisionYesThe revision you read (get_document, or the last result). Required: a document the person changed after it is refused, never overwritten.

Output Schema

NameRequiredDescriptionDefault
urlYesThe link, valid 24 hours.
markYesWhether the PDF carries the ReflowPDF mark, and why.
bytesYes
notesYesWhat to tell the person about this PDF.
pagesYes
timingNoThe engine's own parts of it, when it states them: layoutMs (styles, layout and pagination) and writeMs (writing the PDF).
editUrlNoThe document in the ReflowPDF editor: the person edits it there (the link is the document; it lasts while it is used).
previewNoWhat picture of the PDF came with this answer (page 1, as PNG), or why none did.
filenameYes
renderMsNoHow long the print took on the server, in milliseconds (the engine and its adapter).
revisionNoIts revision: name it to update_document as base_revision.
expiresAtYesWhen the link stops working (ISO 8601).
documentIdNoThe document, for get_document and update_document.
missingVariablesNoTemplate values the data did not have (printed empty).
skippedResourcesNoImages, fonts or style sheets the server could not fetch.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / filename / description
      Previous value: -"The PDF file name. Default: the document's name."New value: +"A new PDF file name, kept for its later prints. Default: the name it was printed with (render_pdf filename), else its <title>."
    • addedInput schema / properties / preview
      Added value: +{
      +  "description": "A picture (PNG) of page 1 comes with the answer, so you can check the layout, fonts and images before giving the links. Default: true.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / preview
      Added value: +{
      +  "description": "What picture of the PDF came with this answer (page 1, as PNG), or why none did.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / renderMs
      Added value: +{
      +  "description": "How long the print took on the server, in milliseconds (the engine and its adapter).",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / timing
      Added value: +{
      +  "description": "The engine's own parts of it, when it states them: layoutMs (styles, layout and pagination) and writeMs (writing the PDF).",
      +  "properties": {
      +    "layoutMs": {
      +      "type": "number"
      +    },
      +    "writeMs": {
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Adds substantial behavior beyond annotations: new-version semantics, automatic reprint, returned PDF/edit links, and optimistic concurrency refusal when the person changed the document. This directly complements readOnly=false/idempotent=false and does not contradict destructive=false.

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?

Single dense paragraph, front-loaded with the action and output; the example and concurrency warning earn their space. A few clauses are packed, but it is appropriately sized for a complex mutation.

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 complex mutation with rich schema and output schema, the description covers the essential edit flow, required source revision, template data handling, and returned links. Remaining details like preview and filename behavior are fully documented in the 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?

Schema coverage is 100%, so baseline is 3, but the description clarifies that html must be the whole new source and base_revision is the read revision, and explains stale refusal. It adds workflow meaning beyond the schema, though it leaves name/filename/preview to the schema.

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?

The title and first clause state a specific mutation ('Writes a new version') on a specific resource ('document by its link'), and the example scopes it to edit requests. It references get_document for the source revision, but does not explicitly contrast with render_pdf or open_in_editor.

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 a concrete chat-request trigger and a required read-then-write workflow: change what get_document returned and pass base_revision. It also states the stale-revision refusal and instructs to read again, though it does not enumerate alternative tools.

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