Skip to main content
Glama

Generate a PDF from HTML or Markdown

generate_pdf

Render HTML or Markdown into a PDF, with options for page size, margins, headers, and page numbers. Get a download URL valid for one hour.

Instructions

Renders HTML or Markdown into a PDF and returns a download URL valid for one hour. Provide exactly one of html or markdown. Markdown is styled with a clean default stylesheet, so it is the quickest way to produce a presentable document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlNoFull HTML document or fragment to render
formatNoPaper size, default A4
marginNoMargin on all sides, e.g. "18mm"
markdownNoMarkdown content, rendered with the default stylesheet
landscapeNoLandscape orientation, default false
footerTextNoSmall footer text on every page
headerTextNoSmall header text on every page
pageNumbersNoShow page numbers in the footer
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses a key behavioral trait: the download URL is 'valid for one hour.' It also explains the input constraint (exactly one of html/markdown) and Markdown's clean styling. It does not mention error handling or what happens if both inputs are provided, but it covers the most important behaviors.

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 main action, and every sentence adds value. There is no redundant information or filler, making it highly concise and well-structured.

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 8 parameters and no output schema or annotations, the description covers the core behavior (rendering and URL expiry) and the key constraint (one input). It does not enumerate all parameters, but the schema already describes them. The only minor gap is that the schema lists no required parameters while the description implies a required choice, but this is not a description deficiency.

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 description coverage is 100%, so baseline is 3. The description adds value beyond the schema by clarifying the mutual exclusivity of html and markdown ('Provide exactly one of'), which is not enforced in the schema. It also gives context on Markdown's default styling. This raises the score above baseline.

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 clearly states the tool's function: 'Renders HTML or Markdown into a PDF and returns a download URL valid for one hour.' This is a specific verb+resource+output, and the input types (HTML/Markdown) distinguish it from the sibling tool pdf_from_url.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on how to use the tool: 'Provide exactly one of html or markdown.' It also gives a practical tip about Markdown being quickest due to the default stylesheet. However, it does not explicitly mention when to use this tool versus pdf_from_url, so it stops short of full exclusion guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TrendTweekers/mintpdf'

If you have feedback or need assistance with the MCP directory API, please join our Discord server