Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Create PDF from Markdown

create_markdown_pdf
Idempotent

Converts Markdown documents into PDF files, rendering headings, lists, code blocks, tables, and quotes. Supports custom fonts, margins, and tagged PDF for screen-reader accessibility.

Instructions

Create a PDF from Markdown. Supports headings, paragraphs, bullet/numbered lists, code blocks, quotes, horizontal rules and tables. Inline decoration markers are stripped and the text rendered plain (single font).

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.
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.
markdownYesMarkdown string.
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

A3.8/5.0
Behavior4/5

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

Annotations already indicate this is not read-only and is idempotent; the description adds a valuable behavioral disclosure: inline decoration markers are stripped and text is rendered plain in a single font. This is non-obvious and helps set expectations, though it does not detail file output behavior or failure modes.

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?

The description is two sentences, front-loaded with the core purpose, and then adds a compact list of supported features plus an important behavioral caveat. Every sentence earns its place with no redundancy or filler.

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?

Given the detailed schema descriptions for all 13 parameters, the description does not need to repeat them. It covers the supported Markdown feature set and a key rendering behavior, which is sufficient for invocation. A small gap is the absence of any guidance about output modes or when to use sibling PDF creation tools, but the schema fills most operational details.

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 parameters are already well documented individually. The description adds no parameter-specific meaning beyond the schema; it only gives a general overview of Markdown support. Baseline 3 is appropriate because the schema carries the burden.

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: 'Create a PDF from Markdown,' and enumerates the supported Markdown constructs (headings, lists, code blocks, tables, etc.). It is clear about what the tool does, though it does not explicitly differentiate itself from the sibling tools create_text_pdf or create_table_pdf beyond implying Markdown input.

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 tool when you have Markdown content and want a PDF. It lists supported elements, which gives some scope, but it gives no explicit guidance about when to choose this over create_text_pdf or create_table_pdf, and no mention of limitations or exclusions.

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