Skip to main content
Glama

Book to PDF

book_to_pdf
Idempotent

Converts several Markdown files into a single PDF, starting each file on a new page and preserving links, outline, and optional table of contents.

Instructions

Makes one PDF of several Markdown files: each from a new page, links between them kept, one outline (and with toc one table of contents). The files a SUMMARY.md lists or a folder holds must lie in that folder.

Input Schema

NameRequiredDescriptionDefault
tocNoOne table of contents for the whole book
pdfaNoPDF/A-3b: every font embedded
pdfuaNoPDF/UA-1, tagged for screen readers (formulas as TeX source)
styleNoLook of the document (default elegant)
inputsYesOne SUMMARY.md (mdBook, GitBook), one folder (its SUMMARY.md, or its .md files by name, README.md first), or Markdown files in order
marginNocompact, normal (default), wide, or margin=N in inches or margin=Npt: margin=0.75in, margin=54pt
outputYesThe PDF to write, ending in .pdf; an existing file is replaced
dialectNogithub (default), or obsidian: callouts, ==highlights==, %%comments%%, [[wiki links]], ![[embeds]]
diagramsNoDraw ```mermaid flowcharts, sequence diagrams and pie charts (default true)
footnotesNoend (default): after the text; page: at the foot of the page of the first reference
page_sizeNoa4 (default), a3, a5, letter or legal, each also with -landscape; WIDTHxHEIGHT in mm, cm, in or pt (210x297mm); or WIDTHxauto (210mmxauto: one long page)
toc_depthNoHeading levels the table of contents lists (default 3)
black_textNoFor black-and-white printers: text, links and code black, fills light grey
page_numbersNo"N / M" at the foot of every page
highlight_codeNoColour fenced code by language (default true)
number_headingsNoNumber the headings of this many levels: 1, 1.1, 1.1.1
page_break_beforeNoA new page before each heading of level 1 to N (h1: chapters)

Output Schema

NameRequiredDescriptionDefault
msYes
codeYes
bytesYes
pagesYes
inputsYes
outputYes
statusYes
missing_charactersYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare non-readonly, non-destructive and idempotent, so the safety profile is covered. The description adds real behavior beyond them: each file starts a new page, inter-file links are preserved, a single outline is produced, and optionally a table of contents. It does not say what happens if a listed file is missing or whether the source files are modified.

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?

Two short sentences, front-loaded with the core action, then the input constraint. The parenthetical '(and with toc one table of contents)' is a bit cramped but each element still earns its place. No filler or restatement of the tool name.

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 a 17-parameter rendering tool with an output schema and full schema coverage, the description supplies the essential mental model: many Markdown files in, one structured PDF out, with inputs constrained to a single folder. Remaining gaps, such as missing-file handling and whether rendering requires external tooling, are minor given the rich schema.

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 schema already documents all 17 parameters thoroughly, including the SUMMARY.md/folder/file-list forms of inputs. The description's one added constraint, that listed or folder-held files must lie in that folder, adds genuine meaning for the inputs parameter but is terse and slightly ambiguous. Baseline 3 is appropriate when the schema carries nearly all semantics.

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?

Specific verb and resource: 'Makes one PDF of several Markdown files', with the multi-file scope, page-break, link-preservation and outline behavior spelled out. It implicitly separates itself from markdown_to_pdf (singular) by emphasizing 'several' files, but never names that sibling, so the differentiation is left for the agent to infer.

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: the tool is for compiling a book of Markdown files into one PDF. There is no explicit statement of when to prefer this over markdown_to_pdf, and no mention of prerequisites or failure modes. The final sentence reads as an input constraint rather than routing guidance.

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