Skip to main content
Glama

Create a PDF from Markdown, plain text or CSV

pdf_text_to_pdf
DestructiveIdempotent

Create a new PDF from Markdown, plain text, or CSV content, with no template or input PDF required. Use it to turn structured text or tables into a printable PDF.

Instructions

Create a new PDF from Markdown, plain text or a CSV table, with no template and no input PDF. This is NOT HTML-to-PDF: it does not render HTML or CSS, and it has no custom fonts or images (images in Markdown stay literal text). Text is set in the standard Helvetica family, code and monospace text in Courier, on Letter or A4 pages. Markdown supports headings 1-6, bold, italic, inline code, links (printed as text plus the URL; http(s) and mailto links are also clickable), fenced code blocks, bullet and numbered lists, one-level blockquotes, horizontal rules, pipe tables (header shaded and repeated per page; column alignment ignored) and \pagebreak; anything else prints as typed. format text keeps spaces and line breaks exactly. format csv draws a table whose first row is the header (up to 20 columns, 10,000 rows, 100,000 cells). content is capped at 512 KiB and the output at 200 pages. WinAnsi characters only (English and Western European letters and common punctuation): emoji, Cyrillic, Greek and CJK fail with unsupported_characters, naming the character and its line and column. Very large tables or heavy inline formatting fail with content_too_complex. Deterministic: the same input gives byte-identical output, and the PDF carries no PDFops footer. To add text to an existing PDF use pdf_edit; to build an invoice from data use pdf_invoice. Returns the result written to output_path, or inline as an application/pdf resource when output_path is omitted (results over 7 MB are never returned inline: pass output_path); an existing file at output_path is overwritten. The source is never modified.

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": {
      "content": "<content>"
    },
    "name": "pdf_text_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNoPDF Title metadata (not printed on the page), up to 200 characters.
formatNoHow to read content. Default markdown.
marginNoPage margin in points, 18-144. Default 54.
contentYesThe document: Markdown (default), plain text or CSV, up to 512 KiB of UTF-8.
font_sizeNoBody text size in points, 6-36. Default 11.
monospaceNoSet the text in Courier. Only used with format text. Default false.
page_sizeNoDefault letter.
output_pathNoPath of a .pdf file to write the result to, inside the allowed directories (PDFOPS_ROOT, default the working directory); an existing file there is overwritten. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save.
page_numbersNoPrint "Page n of N" at the bottom of every page. Default false.

Output Schema

NameRequiredDescriptionDefault
bytesYesSize of the produced PDF in bytes
output_pathNoAbsolute path written, when output_path was supplied
resource_uriNopdfops:// uri of the inline application/pdf resource, when output_path was omitted

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare this is a mutating, destructive but idempotent, non-open-world write. The description adds real context on top: output_path files are overwritten, the source is never modified, output is byte-identical and footer-free, and limits are quantified (512 KiB, 200 pages, 20 columns / 10,000 rows / 100,000 cells). It also names the concrete failure modes (unsupported_characters with line/column, content_too_complex), which goes beyond what annotations convey.

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 purpose, constraints and routing before the capability detail, and the sibling routing sits near the end where it belongs. The middle Markdown feature enumeration is dense and long, but nearly every clause carries a decision-relevant constraint rather than filler.

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?

Covers the full call contract for a moderately complex 9-parameter tool: input formats, formatting limits, encoding restrictions, error names, determinism, overwrite behavior, and the inline-vs-output_path return rule including the 7 MB threshold. Even with an output schema present, the description supplies enough that an agent can pick parameters and predict outcomes correctly.

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 the schema already carries baseline parameter meaning. The description still adds value by explaining what each format actually renders (Markdown feature set, text preserving whitespace, csv treating row 1 as header) and how limits apply to content, which the schema only states as a size cap.

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?

Names a specific verb and resource ("Create a new PDF") and immediately bounds the input space: Markdown, plain text or CSV, with no template and no input PDF. It also explicitly distinguishes itself from the HTML-to-PDF path and from pdf_edit/pdf_invoice, so an agent can route without opening a schema.

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 routing rules: use pdf_edit to add text to an existing PDF, pdf_invoice to build an invoice from data, and this tool only when starting from raw text with no template. The negative case ("This is NOT HTML-to-PDF: it does not render HTML or CSS") removes the most likely mis-selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.