Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Create PDF from Plain Text

create_text_pdf
Idempotent

Turn plain text into a PDF file. Preserves line breaks, treats blank lines as paragraphs, wraps long lines, and supports custom fonts, margins, titles, and accessible tagged output.

Instructions

Create a PDF from plain text. Honours line breaks (\n) and treats blank lines as paragraph breaks. Long lines wrap automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNoNatural language of the document (BCP 47, e.g. "ja" / "en-US"). When omitted with tagged, it is inferred from the text and the guess is reported in warnings. A wrong language declaration makes screen readers misread — state it explicitly when you know it.
textYesBody text. \n breaks lines; blank lines separate paragraphs.
titleNoPDF title. Set in the metadata and also drawn as a heading at the top of the body.
authorNoPDF author (metadata).
marginNoMargin on all sides (pt). Default 56 (about 20 mm). Range 0-300.
taggedNoGenerate as a tagged PDF (PDF/UA-1, ISO 14289). Default false. When true, a structure tree, the PDF/UA declaration, /Lang and DisplayDocTitle are added, making the document readable by screen readers. PDF/UA requires a title, so title becomes required.
fontPathNoAbsolute path of the font file to embed (.ttf / .otf). Required for non-Latin text such as Japanese. .ttc (TrueType Collection) is not supported. Can also be set via the PDF_WRITER_FONT environment variable.
fontSizeNoBody font size (pt). Default 11. Range 4-96.
pageSizeNoPage size. Default A4.
outputPathNoDestination file path (absolute). When omitted, a base64 string is returned instead.
pdfVersionNoPDF version to output. Default "1.7". "2.0" (ISO 32000-2) satisfies not just the version claim but the duties bound to it: a trailer /ID is added (Required per Table 15), and the Info dictionary is trimmed to CreationDate / ModDate with title, author and Producer moved to XMP (§14.3.3). Cannot be combined with tagged: true (the only declaration the writer can produce is PDF/UA-1, built on PDF 1.7).
returnBase64NoWhen true, include a base64 string in the result in addition to saving.
onMissingGlyphNoWhat to do with characters the font lacks (e.g. ✔ U+2714, missing from Noto Sans JP). error (default) = fail, listing the missing characters / replace = substitute 〓 with a warning / ignore = render as blanks with a warning.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.21.2

TDQS

A4/5.0
Behavior4/5

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

The description discloses layout behavior—honoring \n, treating blank lines as paragraph breaks, and auto-wrapping long lines—which goes beyond the annotations' readOnly/idempotent/destructive hints. It does not mention output side effects like writing to outputPath or base64 return, but those are covered in the rich parameter schema, and there is no contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

Three short sentences, with the core purpose first and formatting details following. Every sentence adds useful behavioral context, and there is no filler or repetition of schema content.

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?

The tool has 13 parameters and no output schema, but the parameter descriptions are exhaustive, covering defaults, ranges, required conditions (e.g., title for tagged PDF, fontPath for non-Latin). The main description provides the essential plain-text formatting context. Minor context like base64 return or font requirements is fully specified in the schema, so the overall definition is complete enough for an agent to call correctly.

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 parameter descriptions carry the semantic load. The tool description's line-break and paragraph information largely duplicates what the text parameter already states, adding no new meaning beyond the schema. This matches the baseline of 3 for full schema coverage.

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 opens with a specific verb and resource: 'Create a PDF from plain text.' It further clarifies behavior with line breaks, paragraph breaks, and auto-wrapping, which sets it apart from siblings like create_markdown_pdf and create_table_pdf based on input format. This is a clear, non-tautological statement of the tool's function.

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?

The description implies usage: use this when input is plain text, as opposed to markdown or table data, but it never names alternatives or states when not to use it. The sibling list provides context, but the description itself does not give explicit routing or exclusion guidance, so this is implied rather than stated.

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