Skip to main content
Glama

Change a document by its link

update_document
Destructive

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). The new version replaces the one before. A change of a few places: edits — each replaces one exact piece of the source as get_document returned it (cheaper than sending the whole document, and nothing else moves); a rewrite: the whole new html. With base_revision: a document the person changed after you read it is refused, so read it again. The PDF carries the document's editable source (encrypted; keep_editable false leaves it out): import_pdf, or Import in the editor, restores it as this document, without AI.

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>",
      "base_revision": "<base_revision>"
    },
    "name": "update_document"
  }
}

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). Not with edits.
nameNoA new name.
editsNoChanges to the source instead of the whole html, applied in order, all or none: each old_str is text copied exactly from the source (get_document, at base_revision) and must occur in it exactly once — add surrounding text to make it unique; new_str takes its place (empty deletes it).
pdf_aNoDeclare PDF/A: "3a" — ISO 19005-3 level A, tagged, includes PDF/UA-1 (archive and accessibility at once); "1b" — ISO 19005-1 level B (PDF 1.4: transparency flattened into images). A document that cannot conform is refused with the reason. PDF/A depends on the account's plan; a print it does not include is refused with the reason. Kept for the document's later prints; "none" declares none. Omitted: the document's setting stays.
pdf_uaNoThe PDF/UA part the file declares: 1 (ISO 14289-1, PDF 1.7) — every print declares it; 2 (ISO 14289-2, PDF 2.0). Not with pdf_a. PDF/UA-2 depends on the account's plan; a print it does not include is refused with the reason. Kept for the document's later prints; 1 returns to the default. Omitted: the document's setting stays.
optionsNoThe engine's print options — the same as the ReflowPDF API's `options` (https://api.reflowpdf.com/docs/), each checked the same way: a wrong or conflicting one is refused with what to change. Shrinking like a browser's print: shrink_to_fit (fit to the page width) or print_scale (a factor, e.g. 0.8 for 80%). pdf_ua, pdf_a and shrink_to_fit may also be given outside options. Kept for the document's later prints; given, they replace the document's options (an empty object clears them). Omitted: the document's options stay.
previewNoPictures (PNG) of pages come 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.
keep_editableNoEmbed the document's source in the PDF so it reopens in the ReflowPDF editor as this document, without AI. Default: true. Kept for the document's later prints. Omitted: the document's setting stays.
preview_pagesNoWhich pages to see, 1-based; -1 is the last page. Default: page 1 and the last page (a page that spilled over shows there). Up to 4, e.g. [1, 2, -1]. Every answer has the outline: which heading starts on which page.
shrink_to_fitNoPrint a document wider than its page smaller, to fit, as a browser's print does: every length then prints scaled down. Default: false, lengths print at their size (20mm is 20mm). Prefer fitting the layout to the page; use this for a page made for a screen. Kept for the document's later prints. Omitted: the document's setting stays.

Output Schema

NameRequiredDescriptionDefault
urlYesThe link, valid 24 hours.
markYesWhether the PDF carries the ReflowPDF mark, and why.
bytesYes
guestYesPrinted without an account: the pages carry the ReflowPDF mark.
notesYesFacts about this PDF: how long its link works, its mark, what was not fetched or filled.
pagesYes
paperYesIts paper, e.g. "A4", "Letter", "210 × 99 mm"; empty when unknown.
titleYesThe document's title.
pdfUrlYesThe PDF (the same link as url).
sizeKbYesThe PDF's size in KB.
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).
outlineNoThe document's headings (h1–h6, the PDF's bookmarks) in order, each with the page it starts on: pick preview_pages by it.
previewNoWhich pages came with this answer as pictures (PNG), or why none did.
filenameYes
previewsYesPages as pictures (PNG), kept with the PDF for its day.
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).
standardsNoWhat the PDF declares, read from its file: pdfUa (its PDF/UA part) and pdfA (its PDF/A part and level, e.g. "3a"), null when it declares none.
documentIdNoThe document, for get_document and update_document.
missingFontsNoFont families the document named that no face answered: their text took the next family of its list.
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. Changed4 schema fields changed
    • addedInput schema / properties / keep_editable
      Added value: +{
      +  "description": "Embed the document's source in the PDF so it reopens in the ReflowPDF editor as this document, without AI. Default: true. Kept for the document's later prints. Omitted: the document's setting stays.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / options
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "The engine's print options — the same as the ReflowPDF API's `options` (https://api.reflowpdf.com/docs/), each checked the same way: a wrong or conflicting one is refused with what to change. Shrinking like a browser's print: shrink_to_fit (fit to the page width) or print_scale (a factor, e.g. 0.8 for 80%). pdf_ua, pdf_a and shrink_to_fit may also be given outside options. Kept for the document's later prints; given, they replace the document's options (an empty object clears them). Omitted: the document's options stay.",
      +  "properties": {
      +    "allow_remote": {
      +      "default": true,
      +      "description": "Fetch remote images, stylesheets and fonts over http(s) (public addresses only). `false` renders with embedded resources only.",
      +      "type": "boolean"
      +    },
      +    "attachments": {
      +      "description": "Files to embed in the PDF (10 MB in total). With `pdf_a: \"3a\"` they are PDF/A-3 associated files. Not allowed with `pdf_a: \"1b\"` or `pdf_x`, whose standards forbid embedded files.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "content": {
      +            "contentEncoding": "base64",
      +            "description": "The file content, base64-encoded.",
      +            "type": "string"
      +          },
      +          "description": {
      +            "description": "A description shown by PDF readers.",
      +            "type": "string"
      +          },
      +          "element": {
      +            "description": "The `id` of the element the file belongs to (e.g. a table's data); the whole document if omitted.",
      +            "type": "string"
      +          },
      +          "filename": {
      +            "description": "The attachment's file name.",
      +            "examples": [
      +              "data.csv"
      +            ],
      +            "type": "string"
      +          },
      +          "mime_type": {
      +            "description": "The media type.",
      +            "examples": [
      +              "text/csv"
      +            ],
      +            "type": "string"
      +          },
      +          "relationship": {
      +            "default": "unspecified",
      +            "description": "The file's relationship to the document (PDF/A-3 `AFRelationship`).",
      +            "enum": [
      +              "data",
      +              "source",
      +              "alternative",
      +              "supplement",
      +              "unspecified"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "filename",
      +          "content"
      +        ],
      +        "type": "object"
      +      },
      +      "maxItems": 20,
      +      "type": "array"
      +    },
      +    "base_css": {
      +      "description": "Your CSS, applied at the user-agent level: defaults that the document's own CSS can override.",
      +      "maxLength": 1048576,
      +      "type": "string"
      +    },
      +    "base_url": {
      +      "description": "The base URL (http or https) for the document's relative URLs; acts as `<base href>` unless the document sets its own.",
      +      "examples": [
      +        "https://example.com/invoices/"
      +      ],
      +      "format": "uri",
      +      "type": "string"
      +    },
      +    "color_scheme": {
      +      "default": "light",
      +      "description": "The value of the `prefers-color-scheme` media feature.",
      +      "enum": [
      +        "light",
      +        "dark"
      +      ],
      +      "type": "string"
      +    },
      +    "compression": {
      +      "default": "default",
      +      "description": "Lossless compression effort for streams. Images are never resampled.",
      +      "enum": [
      +        "fast",
      +        "default",
      +        "smallest"
      +      ],
      +      "type": "string"
      +    },
      +    "default_font_size": {
      +      "default": "12pt",
      +      "description": "The size of CSS `medium`: the document's base font size.",
      +      "type": "string"
      +    },
      +    "e_invoice": {
      +      "additionalProperties": false,
      +      "description": "Produce a hybrid e-invoice: Factur-X 1.0 / ZUGFeRD 2.5 (FNFE-MPE and FeRD, Factur-X 1.09.2), a PDF/A-3a with the invoice XML embedded. The XML is validated against its profile first (the KoSIT validator for XRechnung 3.0; the EN 16931 XSD and Schematron of Factur-X 1.09.2); an invoice that fails is refused with each violated rule. Its `attachments` use the formats Factur-X allows (§6.4: PDF, TXT, GIF, TIFF, JPG, CSV, XML, JSON, XLS, XLSX, ODS, each with its `mime_type`) and names other than the invoice's (`factur-x.xml`, `xrechnung.xml`, `zugferd-invoice.xml`). Not with `pdf_a: \"1b\"`, `pdf_ua: 2`, `pdf_x`, `wtpdf` or `encryption`. An e-invoice depends on the account's plan; a print it does not include is refused with the reason.",
      +      "properties": {
      +        "profile": {
      +          "description": "`en16931`: the EN 16931 (Comfort) profile, embedded as `factur-x.xml`; `xrechnung`: the XRECHNUNG reference profile (the German CIUS), embedded as `xrechnung.xml`. The XML's specification identifier (BT-24) must match the profile exactly: `urn:cen.eu:en16931:2017`, or `urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0` (XRechnung 3.0).",
      +          "enum": [
      +            "en16931",
      +            "xrechnung"
      +          ],
      +          "type": "string"
      +        },
      +        "xml": {
      +          "description": "The invoice as UN/CEFACT Cross Industry Invoice (CII) XML text, up to 5 MB in UTF-8. It is embedded as UTF-8, so its XML declaration must specify UTF-8 or no encoding.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "profile",
      +        "xml"
      +      ],
      +      "type": "object"
      +    },
      +    "encryption": {
      +      "additionalProperties": false,
      +      "description": "Encrypt the PDF (AES-256 by default, ISO 32000-2). Not compatible with PDF/A or PDF/X, whose standards forbid encryption.",
      +      "properties": {
      +        "algorithm": {
      +          "default": "aes-256",
      +          "description": "Use `rc4-128` only for readers older than Acrobat 9.",
      +          "enum": [
      +            "aes-256",
      +            "rc4-128"
      +          ],
      +          "type": "string"
      +        },
      +        "owner_password": {
      +          "description": "The password that lifts the permission restrictions.",
      +          "maxLength": 127,
      +          "type": "string"
      +        },
      +        "permissions": {
      +          "description": "Allowed actions; anything not listed is denied. Text extraction for accessibility (screen readers) is always allowed (ISO 32000-2, PDF/UA).",
      +          "items": {
      +            "enum": [
      +              "print",
      +              "print-high",
      +              "modify",
      +              "copy",
      +              "annotate",
      +              "fill-forms",
      +              "assemble"
      +            ],
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "user_password": {
      +          "description": "The password required to open the file. If empty or omitted, the file opens without a password, with the permissions below.",
      +          "maxLength": 127,
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "owner_password"
      +      ],
      +      "type": "object"
      +    },
      +    "header_footer": {
      +      "additionalProperties": false,
      +      "description": "A line of text in the top and bottom margins of every page. CSS `@page` margin boxes (`@top-center { content: … counter(page) }`) do the same in the document itself, with full styling.",
      +      "properties": {
      +        "color": {
      +          "description": "A CSS color.",
      +          "examples": [
      +            "#666666"
      +          ],
      +          "type": "string"
      +        },
      +        "font_size": {
      +          "default": "7.5pt",
      +          "description": "A CSS length.",
      +          "type": "string"
      +        },
      +        "footer": {
      +          "description": "Text in the bottom margin of every page; `{pageNum}` and `{totalPages}` are replaced.",
      +          "maxLength": 500,
      +          "type": "string"
      +        },
      +        "footer_align": {
      +          "default": "center",
      +          "description": "Alignment of the footer.",
      +          "enum": [
      +            "left",
      +            "center",
      +            "right"
      +          ],
      +          "type": "string"
      +        },
      +        "header": {
      +          "description": "`{pageNum}` and `{totalPages}` are replaced on each page.",
      +          "examples": [
      +            "Quarterly report, page {pageNum} of {totalPages}"
      +          ],
      +          "maxLength": 500,
      +          "type": "string"
      +        },
      +        "header_align": {
      +          "default": "center",
      +          "description": "Alignment of the header.",
      +          "enum": [
      +            "left",
      +            "center",
      +            "right"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "input_format": {
      +      "default": "html",
      +      "description": "`xhtml`: parse the document as XML.",
      +      "enum": [
      +        "html",
      +        "xhtml"
      +      ],
      +      "type": "string"
      +    },
      +    "javascript": {
      +      "default": false,
      +      "description": "Run the document's scripts before rendering, against the engine's own DOM, with layout queries answered by the engine. Off by default: without it scripts do not run.",
      +      "type": "boolean"
      +    },
      +    "lang": {
      +      "description": "The document language (BCP 47), used when `<html lang>` is not set.",
      +      "examples": [
      +        "en",
      +        "de-CH"
      +      ],
      +      "type": "string"
      +    },
      +    "max_pages": {
      +      "description": "Render at most this many pages; the rest is omitted.",
      +      "maximum": 5000,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "metadata": {
      +      "additionalProperties": false,
      +      "description": "Overrides the document's `<meta name=\"author|description|keywords\">`.",
      +      "properties": {
      +        "author": {
      +          "maxLength": 1000,
      +          "type": "string"
      +        },
      +        "keywords": {
      +          "maxLength": 1000,
      +          "type": "string"
      +        },
      +        "subject": {
      +          "maxLength": 1000,
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "object_streams": {
      +      "default": true,
      +      "description": "Pack objects into object streams (smaller files). `false` writes a classic cross-reference table for readers older than PDF 1.5.",
      +      "type": "boolean"
      +    },
      +    "paper": {
      +      "additionalProperties": false,
      +      "description": "The default paper, applied as a user-agent `@page` rule: any property the document's own `@page` sets takes precedence. Without either: A4 portrait, 20 mm margins.",
      +      "properties": {
      +        "margin": {
      +          "default": "20mm",
      +          "description": "A CSS margin value.",
      +          "examples": [
      +            "20mm",
      +            "15mm 20mm"
      +          ],
      +          "type": "string"
      +        },
      +        "orientation": {
      +          "default": "portrait",
      +          "description": "`portrait` or `landscape`.",
      +          "enum": [
      +            "portrait",
      +            "landscape"
      +          ],
      +          "type": "string"
      +        },
      +        "size": {
      +          "default": "A4",
      +          "description": "A0–A10, B0–B10, C0–C10, JIS-B4, JIS-B5, Letter, Legal, Ledger, Tabloid, or two lengths such as \"210mm 297mm\".",
      +          "examples": [
      +            "A4",
      +            "Letter",
      +            "100mm 150mm"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "pdf_a": {
      +      "description": "Declare PDF/A conformance: `3a` is ISO 19005-3, conformance level A (tagged, includes PDF/UA-1); `1b` is ISO 19005-1, conformance level B (PDF 1.4: transparency is flattened into opaque images, text stays selectable). A document that cannot conform is refused with the reason. PDF/A depends on the account's plan; a print it does not include is refused with the reason.",
      +      "enum": [
      +        "3a",
      +        "1b"
      +      ],
      +      "type": "string"
      +    },
      +    "pdf_ua": {
      +      "description": "Declare PDF/UA conformance: `1` (ISO 14289-1, PDF 1.7) or `2` (ISO 14289-2, PDF 2.0). Every PDF is tagged unless `tagged: false`. PDF/UA-2 depends on the account's plan; a print it does not include is refused with the reason.",
      +      "enum": [
      +        1,
      +        2
      +      ],
      +      "type": "integer"
      +    },
      +    "pdf_x": {
      +      "additionalProperties": false,
      +      "description": "Declare PDF/X conformance for an output intent: colors, page boxes and the output intent of a print-ready file. PDF/X depends on the account's plan; a print it does not include is refused with the reason.",
      +      "properties": {
      +        "output_intent": {
      +          "description": "A print condition of the engine's registry (e.g. `FOGRA39`, `CGATS21-2-CRPC5`, `CGATS TR 001`), or the name of your own `profile`.",
      +          "examples": [
      +            "FOGRA39",
      +            "CGATS21-2-CRPC5",
      +            "CGATS TR 001"
      +          ],
      +          "type": "string"
      +        },
      +        "profile": {
      +          "contentEncoding": "base64",
      +          "description": "Your printer's ICC output profile (device class `prtr`; Gray, RGB or CMYK; up to 8 MB), base64-encoded.",
      +          "type": "string"
      +        },
      +        "standard": {
      +          "default": "x-4",
      +          "description": "`x-4`: ISO 15930-7 (PDF 1.6, transparency and RGB preserved); `x-1a`: ISO 15930-4 (PDF 1.4, all colors converted to the output intent's inks, transparency flattened; requires a CMYK output intent).",
      +          "enum": [
      +            "x-4",
      +            "x-1a"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "output_intent"
      +      ],
      +      "type": "object"
      +    },
      +    "print_scale": {
      +      "description": "Scale the document down by this factor.",
      +      "maximum": 0.99,
      +      "minimum": 0.06,
      +      "type": "number"
      +    },
      +    "shrink_to_fit": {
      +      "default": false,
      +      "description": "Scale a document wider than the page down to fit, as browsers do. Off by default, so lengths stay physical.",
      +      "type": "boolean"
      +    },
      +    "tagged": {
      +      "default": true,
      +      "description": "Produce a tagged PDF (logical structure for screen readers and reflow). `false` produces a smaller untagged file; not compatible with `pdf_ua` or `pdf_a: \"3a\"`.",
      +      "type": "boolean"
      +    },
      +    "title": {
      +      "description": "The PDF title (defaults to the document's `<title>`, then to its first `<h1>`).",
      +      "maxLength": 500,
      +      "type": "string"
      +    },
      +    "watermark": {
      +      "additionalProperties": false,
      +      "description": "A text or image stamped on every page, behind the content unless `above` is set; marked as an artifact in a tagged PDF.",
      +      "properties": {
      +        "above": {
      +          "default": false,
      +          "description": "Draw over the content instead of behind it.",
      +          "type": "boolean"
      +        },
      +        "angle": {
      +          "default": -45,
      +          "description": "Rotation in degrees, counterclockwise.",
      +          "type": "number"
      +        },
      +        "color": {
      +          "description": "A CSS color.",
      +          "type": "string"
      +        },
      +        "font_size": {
      +          "default": 60,
      +          "description": "In points.",
      +          "type": "number"
      +        },
      +        "image": {
      +          "description": "An https or data: URL of an image (instead of `text`).",
      +          "type": "string"
      +        },
      +        "image_height": {
      +          "description": "Image height in points, with `image_width`.",
      +          "type": "number"
      +        },
      +        "image_width": {
      +          "description": "Image width in points, with `image_height` (defaults to its natural size at 96 dpi).",
      +          "type": "number"
      +        },
      +        "opacity": {
      +          "default": 0.08,
      +          "description": "From 0 (transparent) to 1 (opaque).",
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        "position": {
      +          "additionalProperties": false,
      +          "description": "Place a single stamp at this position (points from the page's top-left corner) instead of the center.",
      +          "properties": {
      +            "x": {
      +              "type": "number"
      +            },
      +            "y": {
      +              "type": "number"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "text": {
      +          "description": "The watermark text.",
      +          "examples": [
      +            "DRAFT",
      +            "CONFIDENTIAL"
      +          ],
      +          "maxLength": 200,
      +          "type": "string"
      +        },
      +        "tile": {
      +          "default": false,
      +          "description": "Repeat the stamp across the page.",
      +          "type": "boolean"
      +        },
      +        "tile_spacing": {
      +          "description": "[x, y] spacing of the tiles, in points.",
      +          "items": {
      +            "type": "number"
      +          },
      +          "maxItems": 2,
      +          "minItems": 2,
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "wtpdf": {
      +      "description": "Declare Well-Tagged PDF 1.0 conformance (PDF Association): a tagged PDF 2.0 that declares its conformance level. `accessibility` declares both levels (it includes the requirements of `reuse`); `reuse` declares the reuse level. The file also conforms to PDF/UA-2. Not with `pdf_a`, `pdf_x` or `pdf_ua: 1`, which use earlier PDF versions. Well-Tagged PDF depends on the account's plan; a print it does not include is refused with the reason.",
      +      "enum": [
      +        "accessibility",
      +        "reuse"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedInput schema / properties / pdf_a / description
      Previous value: -"Declare PDF/A (Pro and Max plans): \"3a\" — ISO 19005-3 level A, tagged, includes PDF/UA-1 (archive and accessibility at once); \"1b\" — ISO 19005-1 level B (PDF 1.4: transparency flattened into images). A document that cannot conform is refused with the reason. Kept for the document's later prints; \"none\" declares none. Omitted: the document's setting stays."New value: +"Declare PDF/A: \"3a\" — ISO 19005-3 level A, tagged, includes PDF/UA-1 (archive and accessibility at once); \"1b\" — ISO 19005-1 level B (PDF 1.4: transparency flattened into images). A document that cannot conform is refused with the reason. PDF/A depends on the account's plan; a print it does not include is refused with the reason. Kept for the document's later prints; \"none\" declares none. Omitted: the document's setting stays."
    • changedInput schema / properties / pdf_ua / description
      Previous value: -"The PDF/UA part the file declares: 1 (ISO 14289-1, PDF 1.7) — every print declares it; 2 (ISO 14289-2, PDF 2.0; Pro and Max plans). Not with pdf_a. Kept for the document's later prints; 1 returns to the default. Omitted: the document's setting stays."New value: +"The PDF/UA part the file declares: 1 (ISO 14289-1, PDF 1.7) — every print declares it; 2 (ISO 14289-2, PDF 2.0). Not with pdf_a. PDF/UA-2 depends on the account's plan; a print it does not include is refused with the reason. Kept for the document's later prints; 1 returns to the default. Omitted: the document's setting stays."
  2. Changed7 schema fields changed
    • addedInput schema / properties / edits
      Added value: +{
      +  "description": "Changes to the source instead of the whole html, applied in order, all or none: each old_str is text copied exactly from the source (get_document, at base_revision) and must occur in it exactly once — add surrounding text to make it unique; new_str takes its place (empty deletes it).",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "new_str": {
      +        "type": "string"
      +      },
      +      "old_str": {
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "old_str",
      +      "new_str"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 50,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / properties / html / description
      Previous value: -"The whole new source. Omitted: the source stays (e.g. new data only)."New value: +"The whole new source. Omitted: the source stays (e.g. new data only). Not with edits."
    • addedInput schema / properties / pdf_a
      Added value: +{
      +  "description": "Declare PDF/A (Pro and Max plans): \"3a\" — ISO 19005-3 level A, tagged, includes PDF/UA-1 (archive and accessibility at once); \"1b\" — ISO 19005-1 level B (PDF 1.4: transparency flattened into images). A document that cannot conform is refused with the reason. Kept for the document's later prints; \"none\" declares none. Omitted: the document's setting stays.",
      +  "enum": [
      +    "3a",
      +    "1b",
      +    "none"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / pdf_ua
      Added value: +{
      +  "description": "The PDF/UA part the file declares: 1 (ISO 14289-1, PDF 1.7) — every print declares it; 2 (ISO 14289-2, PDF 2.0; Pro and Max plans). Not with pdf_a. Kept for the document's later prints; 1 returns to the default. Omitted: the document's setting stays.",
      +  "enum": [
      +    1,
      +    2
      +  ],
      +  "type": "integer"
      +}
    • changedInput schema / properties / preview_pages / description
      Previous value: -"Which pages to see, 1-based; -1 is the last page. Default: page 1 and the last page (a page that spilled over shows there). Up to 4, e.g. [1, 2, -1]."New value: +"Which pages to see, 1-based; -1 is the last page. Default: page 1 and the last page (a page that spilled over shows there). Up to 4, e.g. [1, 2, -1]. Every answer has the outline: which heading starts on which page."
    • addedOutput schema / properties / outline
      Added value: +{
      +  "description": "The document's headings (h1–h6, the PDF's bookmarks) in order, each with the page it starts on: pick preview_pages by it.",
      +  "items": {
      +    "properties": {
      +      "level": {
      +        "type": "integer"
      +      },
      +      "page": {
      +        "type": "integer"
      +      },
      +      "title": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "level",
      +      "title"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / standards
      Added value: +{
      +  "description": "What the PDF declares, read from its file: pdfUa (its PDF/UA part) and pdfA (its PDF/A part and level, e.g. \"3a\"), null when it declares none.",
      +  "properties": {
      +    "pdfA": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "pdfUa": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / shrink_to_fit
      Added value: +{
      +  "description": "Print a document wider than its page smaller, to fit, as a browser's print does: every length then prints scaled down. Default: false, lengths print at their size (20mm is 20mm). Prefer fitting the layout to the page; use this for a page made for a screen. Kept for the document's later prints. Omitted: the document's setting stays.",
      +  "type": "boolean"
      +}
  4. Changed7 schema fields changed
    • addedOutput schema / properties / guest
      Added value: +{
      +  "description": "Printed without an account: the pages carry the ReflowPDF mark.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / paper
      Added value: +{
      +  "description": "Its paper, e.g. \"A4\", \"Letter\", \"210 × 99 mm\"; empty when unknown.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / pdfUrl
      Added value: +{
      +  "description": "The PDF (the same link as url).",
      +  "type": "string"
      +}
    • addedOutput schema / properties / previews
      Added value: +{
      +  "description": "Pages as pictures (PNG), kept with the PDF for its day.",
      +  "items": {
      +    "properties": {
      +      "height": {
      +        "type": "integer"
      +      },
      +      "page": {
      +        "type": "integer"
      +      },
      +      "url": {
      +        "type": "string"
      +      },
      +      "width": {
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "page",
      +      "url",
      +      "width",
      +      "height"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / sizeKb
      Added value: +{
      +  "description": "The PDF's size in KB.",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / title
      Added value: +{
      +  "description": "The document's title.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "url",
      -  "expiresAt",
      -  "filename",
      -  "pages",
      -  "bytes",
      -  "mark",
      -  "notes"
      -]New value: +[
      +  "url",
      +  "expiresAt",
      +  "filename",
      +  "pages",
      +  "bytes",
      +  "mark",
      +  "notes",
      +  "title",
      +  "pdfUrl",
      +  "sizeKb",
      +  "paper",
      +  "guest",
      +  "previews"
      +]
  5. Changed1 schema field changed
    • addedOutput schema / properties / missingFonts
      Added value: +{
      +  "description": "Font families the document named that no face answered: their text took the next family of its list.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  6. Changed1 schema field changed
    • changedOutput schema / properties / notes / description
      Previous value: -"What to tell the person about this PDF."New value: +"Facts about this PDF: how long its link works, its mark, what was not fetched or filled."
  7. Changed3 schema fields changed
    • changedInput schema / properties / preview / description
      Previous value: -"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."New value: +"Pictures (PNG) of pages come with the answer, so you can check the layout, fonts and images before giving the links. Default: true."
    • addedInput schema / properties / preview_pages
      Added value: +{
      +  "description": "Which pages to see, 1-based; -1 is the last page. Default: page 1 and the last page (a page that spilled over shows there). Up to 4, e.g. [1, 2, -1].",
      +  "items": {
      +    "type": "integer"
      +  },
      +  "maxItems": 4,
      +  "type": "array"
      +}
    • changedOutput schema / properties / preview / description
      Previous value: -"What picture of the PDF came with this answer (page 1, as PNG), or why none did."New value: +"Which pages came with this answer as pictures (PNG), or why none did."
  8. 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"
      +}
  9. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare destructive=true, readOnly=false, idempotent=false and openWorld=true, but the description adds important behavior: the new version replaces the prior one, a changed document is refused rather than overwritten, and the PDF can embed encrypted editable source for later restoration. This is substantial context beyond 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.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is relevant and front-loaded, but the first sentence is a dense run-on with nested dashes and parentheses, and later sentences use compressed semicolon constructions that are harder to scan. Every sentence carries information, yet the structure could be considerably clearer.

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?

For a complex 14-parameter update tool with an output schema, the description covers the core update flow, edits-versus-rewrite choice, revision conflict handling, and editable-source behavior. It does not summarize the large options surface or preview behavior, but those are documented in the schema, so it is complete enough for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the schema itself already explains edits, base_revision, document_id, keep_editable, and the options surface in detail. The description adds some rationale, such as edits being cheaper than sending the whole document and nothing else moving, but largely repeats schema content; baseline 3 is appropriate.

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: 'Writes a new version of a document by its link', and clarifies that it also prints the document and returns the PDF and edit links. It names get_document for reading and import_pdf for restoring embedded source, which helps distinguish related operations even though render_pdf is not explicitly compared.

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?

It gives a concrete usage scenario ('the person asks in the chat to remove something on page 2'), guidance for choosing edits for a few changes versus html for a rewrite, and explains the base_revision conflict workflow. It stops short of explicit when-not-to-use guidance or naming render_pdf as the alternative for print-only requests.

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.