Skip to main content
Glama

Print HTML to PDF

render_pdf

Lays out a whole HTML document (with its CSS) as paged print and returns a download link to the PDF, valid 24 hours, and the document's edit link in the ReflowPDF editor. Use @page for paper and margins, margin boxes for headers, footers and page numbers; JavaScript does not run. Read read_guide topic "html" before the first document. To change the document later, use update_document with its document_id.

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": {
      "html": "<html>"
    },
    "name": "render_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesThe whole HTML document: <!doctype html>, <html lang>, a <title>, a <style> in <head> with @page. Self-contained; images and fonts by https URL, data: URI or an upload_image link.
previewNoPictures (PNG) of pages come with the answer, so you can check the layout, fonts and images before giving the links. Default: true.
filenameNoThe PDF file name, e.g. "invoice-1042.pdf". Default: the document's <title>.
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].

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).
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).
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. 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"
      +]
  2. 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"
      +}
  3. 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."
  4. 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."
  5. Changed4 schema fields changed
    • 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"
      +}
  6. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare the permission profile (readOnly=false, openWorld=true, idempotent=false, destructive=false). The description adds genuinely new behavior: link lifetime of 24 hours, no JavaScript execution, preview PNGs returned with the answer, and the edit link in ReflowPDF. It never explicitly says each render creates a new document — which is what non-idempotent implies — so it falls slightly short of full disclosure.

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 purpose and output, then constraints, then the sibling pointer — the ordering is right and no sentence is padding. Density is high and some clauses chain several ideas (output links, CSS features, JS, guide prerequisite) in one sentence, which costs a little scannability.

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?

An output schema exists, yet the description still tells the agent what it gets back (download link, edit link, optional page previews), and it covers the runtime constraint, the authoring convention, and the follow-up path. Nothing an agent needs before calling this four-parameter tool is missing.

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%, so the schema already explains html, preview, filename, and preview_pages in detail. The description adds only an implicit hint toward the html parameter (@page for paper/margins, margin boxes for headers and page numbers) and says nothing extra about the preview, preview_pages, or filename parameters. 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?

States a specific verb+resource (lays out an HTML document as paged print) and the concrete outcome: a 24-hour download link plus the ReflowPDF edit link. It also names the sibling it is not — update_document — for later edits, so the agent can separate rendering from mutation.

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?

Gives explicit preconditions (read read_guide topic "html" before the first document) and the exclusion that rules out the obvious wrong approach: JavaScript does not run. It also points to update_document with document_id for later changes, which is exactly the alternative an agent would otherwise guess at.

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.