Skip to main content
Glama

Render Markdown to PDF

render_pdf

Turn a Markdown document into a PDF and return the PDF. Each successful render counts as one document. Re-sending the same document with the same idempotency key returns the same PDF and is not counted again.

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

Input Schema

NameRequiredDescriptionDefault
pageNoThe page settings, as the front matter page: key takes them. Each key wins over the older flat key of the same setting and over the front matter. Placeholders in header, footer and numbering texts: {page}, {pages} (the number of the last page), {title}, {author}.
signNoSeal the PDF with your own certificate: {certificate: "name"} for a certificate stored on the account, or {p12, password} or {key, cert} to send one with the request. Optional reason, location and contact, up to 200 characters each. true is refused: name a stored certificate or send one with the request. false leaves the PDF unsealed. Sealing needs a paid plan.
widthNoOlder spelling of page.size, with height. The page width as a length such as 210mm; a number alone is in points.
footerNoOlder spelling of page.footer, which wins over it.
formatNoOlder spelling of page.size, which wins over it. A paper name such as A4 or A5 landscape. It wins over width and height.
headerNoOlder spelling of page.header, which wins over it.
heightNoOlder spelling of page.size, with width. The page height, written as width is.
marginNoOlder spelling of page.margin, which wins over it. A number alone is in points.
outputNoHow the PDF comes back. resource: in the result. upload: sent to upload_url, and the result is a receipt with the page count, size and hash.resource
featuresNoOptional switches for Markdown features: Mermaid diagrams, diagram pages, syntax highlighting, images, smart typography, task lists, emoji, math, barcodes, SVG, HTML blocks, bare links, indented code, the source attachment, hyphenation, the theme and the PDF standards: archive, accessible, mathml and standards. Every switch is on unless you set it to false, except diagram pages, the source attachment and archive, which are off unless you set them to true, and mathml, which without a value is on for an accessible document with formulas; the theme is light unless you set it to dark; standards is best_effort unless you set it to strict.
filenameNoA file name for the PDF, such as report.pdf. The result returns it, cleaned of characters a file name cannot hold, to save the PDF under. A document without a front matter title takes it, without .pdf, as its PDF title.
languageNoThe document's language as a tag such as en-GB. It sets the hyphenation rules, and the PDF records it as its document language. Omit it to use the language set in the document's front matter, if there is one. Without either, an accessible PDF gets the main language of the text, which the converter detects without sending the text anywhere, or en when the text does not show it clearly. That language goes into the PDF's tags only and turns no hyphenation on. The result names the PDF's language and where it came from: document, detected or default.
markdownYesThe Markdown text of the document.
papersizeNoOlder spelling of page.size, as in Quarto. format wins when both are set.
resourcesNoWhat to do when an image or other linked file cannot be fetched. strict: the render fails. lenient: the PDF shows a placeholder box in its place.
upload_urlNoA pre-signed https URL on your own storage to upload the PDF to. Needed with output upload, and refused with any other output.
page_numberingNoOlder spelling of page.numbering, which wins over it: a text, a style 1, a, A, i or I, true for the default, or false.
idempotency_keyNoA per-document idempotency key. Reuse it only for the same document and options.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / features / description
      Previous value: -"Optional switches for Markdown features: Mermaid diagrams, diagram pages, syntax highlighting, images, smart typography, task lists, emoji, math, barcodes, SVG, HTML blocks, bare links, indented code, the source attachment, hyphenation, the theme and the PDF standards: archive, accessible, mathml and standards. Every switch is on unless you set it to false, except diagram pages, the source attachment, archive, accessible and mathml, which are off unless you set them to true; the theme is light unless you set it to dark; standards is best_effort unless you set it to strict."New value: +"Optional switches for Markdown features: Mermaid diagrams, diagram pages, syntax highlighting, images, smart typography, task lists, emoji, math, barcodes, SVG, HTML blocks, bare links, indented code, the source attachment, hyphenation, the theme and the PDF standards: archive, accessible, mathml and standards. Every switch is on unless you set it to false, except diagram pages, the source attachment and archive, which are off unless you set them to true, and mathml, which without a value is on for an accessible document with formulas; the theme is light unless you set it to dark; standards is best_effort unless you set it to strict."
    • changedInput schema / properties / features / properties / accessible / default
      Previous value: -falseNew value: +true
    • changedInput schema / properties / features / properties / accessible / description
      Previous value: -"Tag the PDF for screen readers and write its title and language into it. The PDF claims PDF/UA-2 when the document names its language. With formulas, it also adds a MathML file for each formula. Off unless set to true."New value: +"Tag the PDF for screen readers and write its title and language into it. On unless set to false here or, when this is not sent, as accessible: false in the front matter. Without a language, the PDF gets the main language of the text, or en when the text does not show it clearly. The PDF claims PDF/UA-2 when the document meets it. With formulas, it also adds a MathML file for each formula. The free, watermarked delivery is a picture of each page and has no tags."
    • changedInput schema / properties / features / properties / hyphenation / description
      Previous value: -"Hyphenate justified text. It needs a document language: without one the text is not hyphenated. Setting it to true is refused for a language with no hyphenation dictionary."New value: +"Hyphenate justified text. It needs a document language, sent or in the front matter: without one the text is not hyphenated. A detected language does not count. Setting it to true is refused for a language with no hyphenation dictionary."
    • changedInput schema / properties / features / properties / mathml / description
      Previous value: -"Attach a MathML file to each formula. This turns tagging on. Without a value, accessible adds the files when the document has formulas. false leaves them out, and then an accessible PDF with formulas does not claim PDF/UA-2."New value: +"Attach a MathML file to each formula. Without a value, an accessible PDF gets the files when the document has formulas. true turns tagging on even when accessible is false. false leaves them out, and then an accessible PDF with formulas does not claim PDF/UA-2."
    • changedInput schema / properties / features / properties / standards / description
      Previous value: -"best_effort: the render does not fail for a standard, and the warnings tell what was left out. strict: a render that leaves out a requested standard is refused with 422 and the warning code, and the document is not counted."New value: +"best_effort: the render does not fail for a standard, and the warnings tell what was left out. strict: a render that leaves out a requested standard is refused with 422 and the warning code, and the document is not counted. PDF/UA-2 counts as requested unless accessible is false."
    • changedInput schema / properties / language / description
      Previous value: -"The document's language as a tag such as en-GB. It sets the hyphenation rules, and the PDF records it as its document language. Omit it to use the language set in the document's front matter, if there is one."New value: +"The document's language as a tag such as en-GB. It sets the hyphenation rules, and the PDF records it as its document language. Omit it to use the language set in the document's front matter, if there is one. Without either, an accessible PDF gets the main language of the text, which the converter detects without sending the text anywhere, or en when the text does not show it clearly. That language goes into the PDF's tags only and turns no hyphenation on. The result names the PDF's language and where it came from: document, detected or default."
  2. Changed1 schema field changed
    • changedInput schema / properties / sign / description
      Previous value: -"Seal the PDF with your own certificate: {certificate: \"name\"} for a certificate stored on the account, or {p12, password} or {key, cert} to send one with the request. Optional reason, location and contact, up to 200 characters each. true uses the certificate chosen for the API key. false leaves the PDF unsealed. Sealing needs a paid plan."New value: +"Seal the PDF with your own certificate: {certificate: \"name\"} for a certificate stored on the account, or {p12, password} or {key, cert} to send one with the request. Optional reason, location and contact, up to 200 characters each. true is refused: name a stored certificate or send one with the request. false leaves the PDF unsealed. Sealing needs a paid plan."
  3. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only say readOnlyHint=false and destructiveHint=false; the description adds the genuinely important billing semantics that each successful render counts as one document and that an idempotent retry is not counted again. That is exactly the kind of consequence an agent cannot get from structured fields. It does not mention paid-plan requirements for sealing or the resource-vs-upload return paths, which limits it to a 4.

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?

Three short sentences, front-loaded with the core action and followed by the counting and idempotency rules. The clause 'and return the PDF' is mildly redundant with the output parameter, but nothing else is wasted.

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 an 18-parameter render tool with no output schema, the description covers the essential call contract: what it produces, how results are counted, and how retries behave. Remaining depth (page setup, features, signing, upload receipts) lives in an unusually rich schema, so the description is adequate, though it omits that output=upload yields a receipt rather than the PDF itself.

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% across all 18 parameters, so the schema already carries the heavy documentation load. The description only touches parameter behavior indirectly through the idempotency key note and adds no syntax or precedence details beyond what the schema states (for example the older flat keys losing to page.*).

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 description states a specific verb and resource: turn a Markdown document into a PDF and return it. That is unambiguous and clearly distinct from template-oriented siblings such as render_template or preview_template, but it never names or contrasts those siblings explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer this is the path for raw Markdown rather than a stored template. The one explicit guidance is about re-sending the same document with the same idempotency key, which covers repeat calls but not when to choose this over render_template or preview_template.

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