Skip to main content
Glama

Generate a PDF from HTML or Markdown

generate_pdf

Renders HTML or Markdown into a PDF and returns a download URL (valid for 1 hour). Provide exactly one of html or markdown. Markdown gets a clean default stylesheet, so it is the fastest way to produce a good-looking document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlNoFull HTML document or fragment to render
formatNoPaper size, default A4
marginNoPage margin on all sides, e.g. "18mm"
markdownNoMarkdown content to render 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

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A3.7/5.0
Behavior3/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 the 1-hour URL expiry and the default Markdown stylesheet, but does not cover error conditions (e.g., providing both inputs), size limits, or asynchronous behavior, leaving notable gaps.

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 primary action and output. It provides actionable guidance on input selection without any redundant or filler 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?

For a tool with 8 parameters and no output schema, the description covers the core behavior (input, output, expiry) and parameters are fully documented in the schema. It omits details about error handling, but overall the description is sufficiently complete for an agent.

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% for all 8 parameters, so baseline is 3. The description adds value by explicitly stating the mutual exclusivity of html and markdown, a constraint not captured in the schema, and clarifies the Markdown styling advantage.

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 clearly states the tool renders HTML or Markdown into a PDF and returns a download URL, specifying the exact input types and output. It does not explicitly distinguish from the sibling pdf_from_url, so it misses the 'distinguishes from siblings' criterion for a 5.

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 gives usage context by requiring exactly one of html or markdown and recommending Markdown for quick styling, but it does not mention when to use this tool instead of pdf_from_url or provide any exclusion criteria for alternatives.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation5/5

generate_pdf clearly takes HTML/Markdown input while pdf_from_url takes a URL. There is no overlap between sourcing content from raw text versus a web page, so an agent can unambiguously select the right tool.

Naming Consistency4/5

Names are descriptive and follow a predictable format for the most part. generate_pdf uses verb_noun, while pdf_from_url swaps the order to noun_preposition_noun, creating a minor inconsistency but no confusion.

Tool Count5/5

Two tools perfectly cover the two primary ways to generate a PDF: from provided content or from a public URL. The scope is tight and every tool earns its place.

Completeness4/5

The server covers the two core PDF generation workflows adequately. Minor gaps exist around customization options like page margins or metadata, but these are not essential for basic generation and can be worked around.