Skip to main content
Glama

Turn Markdown into a PDF

markdown_to_pdf

Turns a Markdown document into a PDF without a template, e.g. a report, notes or an answer you wrote, and returns the render with status and download_url. It reads GitHub Flavored Markdown (tables, task lists, strikethrough) and footnotes; a YAML front matter block gives the title, author, subject and keywords, else the first heading is the title; a line \newpage starts a new page. Raw HTML in the text is shown as text. A picture named without an address (Logo) is a file of the workspace library, uploaded in Formfeed; a picture can also be a data:image URI. The headings become the PDF bookmarks by default, and pdf_ua checks the file against PDF/UA-1 before it is delivered. To fill a template with data, use render; to convert an office file, use convert_to_pdf. Every call is a new render: one unit per started five pages on a live key or for a signed-in agent, free with a test key; every plan.

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": "markdown_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssNoA stylesheet after the theme, e.g. h1 { color: #0f766e }; the document is inside div.ff-markdown
waitNotrue waits for a render that continues in the background; false returns it as it is, to check later with get_render
paperNoPaper size; A4 when left out
themeNodocument (default) styles the text, in the brand kit fonts and colour where the workspace has one; none leaves the styling to css
titleNoThe PDF title; left out, the front matter title or the first heading
pdf_uaNoMakes the file a PDF/UA-1 document checked by veraPDF; a file that fails is not delivered and the result names the rules
outlineNoBookmarks from the headings (default true); they cost nothing
filenameNoName of the PDF behind download_url, e.g. report.pdf
markdownYesThe document as Markdown text, up to 1 MB
landscapeNoLandscape pages

Output Schema

NameRequiredDescriptionDefault
idYesrnd_ id of the render
formNoWhat fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran
pdfaNoThe PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it
errorYesWhy a failed render failed
unitsYesUnits the render counted
outputNoThe format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image
statusYes
einvoiceNoThe e-invoice report, when the render made one
templateYesThe template and version rendered; null for html and conversions
expires_atYesWhen download_url stops working; get_render issues a fresh one
page_countYes
environmentYes
download_urlYesSigned link to the file; null until the render succeeded
accessibilityNoThe PDF/UA-1 verdict, when the template declares it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / form
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "What fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran",
      +  "properties": {
      +    "filled": {
      +      "type": "number"
      +    },
      +    "skipped": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "field": {
      +            "type": "string"
      +          },
      +          "reason": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "field",
      +          "reason"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "warnings": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "field": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "field",
      +          "code"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "xfa_removed": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "filled",
      +    "skipped",
      +    "warnings",
      +    "xfa_removed"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / output
      Added value: +{
      +  "description": "The format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image",
      +  "type": "string"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnly=false, idempotent=false, destructive=false; the description goes much further by disclosing the dialect accepted, front-matter handling, \newpage behavior, raw-HTML-as-text, that relative images resolve against the workspace library, and that pdf_ua blocks delivery when veraPDF fails. It also makes non-idempotency concrete ('Every call is a new render') and states billing units. The closing cost sentence is garbled ('free with a test key; every plan'), leaving the pricing rule partly unclear, which keeps this from a 5.

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?

Dense and mostly front-loaded: purpose first, then content rules, then validation, then alternatives. Nearly every sentence carries a distinct fact, but the trailing pricing sentence is ungrammatical and truncated, adding noise at the point where precision matters most.

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 10-parameter render tool with an output schema, the description covers the non-obvious edges an agent needs: async handling via wait/get_render, image resolution, PDF/UA failure mode, and bookmark defaults. Return shape is left to the output schema, which is appropriate.

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 already 100%, so the schema baseline applies, but the description still adds meaning the schema does not: what the markdown body may contain (GFM tables, task lists, strikethrough, footnotes, front matter keys, \newpage, workspace-library and data: URI images) and the title fallback chain. The css/theme interaction is only lightly echoed from 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 — turns a Markdown document into a PDF without a template — and immediately names the cases it covers (report, notes, a written answer). It also distinguishes itself from both near-neighbors in the same breath: render for template filling and convert_to_pdf for office files.

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 is given: use render to fill a template with data, use convert_to_pdf for office files, and use get_render to check a render left running when wait is false. The when-not conditions are as clear as the when.

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