Skip to main content
Glama

generate_pdf

Convert web pages or HTML content into PDF files with customizable margins, headers, footers, page ranges, and scaling options.

Instructions

Generate a PDF from a URL or HTML content. Supports custom margins, headers/footers, page ranges, and scaling. Saves the PDF to disk and returns the file path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to render as PDF (required if no html)
htmlNoRaw HTML to render as PDF (required if no url)
formatNoPaper format: A4, Letter, Legal, Tabloid, A3, A5 (default: A4)
landscapeNoLandscape orientation (default: false)
printBackgroundNoInclude CSS backgrounds (default: true)
marginNoCSS margin — string for all sides (e.g. "1cm") or object { top, right, bottom, left }
scaleNoRendering scale 0.1-2 (default: 1)
widthNoPage width (overrides format) — CSS value like "8.5in"
pageRangesNoPage ranges to include, e.g. "1-5, 8"
headerTemplateNoHTML template for page header (uses Chromium templating)
footerTemplateNoHTML template for page footer
displayHeaderFooterNoShow header and footer (default: false)
delayNoMilliseconds to wait before rendering (default: 0)
saveToNoOutput file path (default: ./output.pdf)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the PDF is saved to disk and returns a file path, which is useful. However, it doesn't address critical behaviors like error handling, performance characteristics, file system permissions needed, whether the operation is idempotent, or what happens if the URL is inaccessible.

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?

The description is appropriately concise with two sentences that efficiently convey the core functionality and outcome. It's front-loaded with the primary purpose. However, it could be slightly more structured by separating input options from output behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 14 parameters and no annotations or output schema, the description is minimally adequate. It covers what the tool does and the basic output (file path), but doesn't address the complexity of the many configuration options or provide guidance on their interactions. The absence of output schema means the description should ideally explain return values more thoroughly.

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 14 parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'custom margins, headers/footers, page ranges, and scaling' - which are already covered in the schema. This meets the baseline for high 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 clearly states the tool's purpose with specific verbs ('Generate', 'Saves', 'returns') and resources ('PDF', 'URL or HTML content', 'file path'). It distinguishes itself from sibling tools like 'take_screenshot' or 'record_video' by focusing on PDF generation from web content rather than visual capture.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, compare to sibling tools, or specify scenarios where this tool is preferred over others. The agent must infer usage from the purpose alone.

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/Custodia-Admin/pagebolt-mcp'

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