Skip to main content
Glama

Render a URL or HTML to PDF with Puppeteer's page

pdf

Render a URL or HTML to PDF with Puppeteer's page.pdf() options (format letter by default, scale, margins, header/footer templates, printBackground, pageRanges). Price: $0.005 a call (3 free calls a day without an API key).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoThe page to render (https). Set url or html, not both.
htmlNoHTML to render instead of a URL.
cookiesNoCookies to set before loading
deliverNo{store: "1d"|"7d"|"30d"|"365d", name?}: keep the PDF in file storage and answer with metadata instead of bytes
viewportNo{width,height,deviceScaleFactor,isMobile,hasTouch,isLandscape}; default 1920x1080
userAgentNo
pdfOptionsNoPuppeteer page.pdf() options as documented at pptr.dev/api/puppeteer.pdfoptions.
addStyleTagNo[{content|url}]
bestAttemptNoProceed when awaited events fail or time out
gotoOptionsNo{waitUntil: load|domcontentloaded|networkidle0|networkidle2, timeout}
addScriptTagNo[{content|url}]
authenticateNo{username,password}
waitForTimeoutNoExtra wait in ms (0-120000)
waitForSelectorNo{selector, visible?, hidden?, timeout}
emulateMediaTypeNoscreen|print
allowResourceTypesNo
allowRequestPatternNo
rejectResourceTypesNoe.g. ["image"]
setExtraHTTPHeadersNoExtra HTTP headers
rejectRequestPatternNo
setJavaScriptEnabledNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/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 usefully discloses the cost model ($0.005/call, 3 free calls/day without an API key) and defaults, but says nothing about permissions, failure/timeout behavior, or that output can be bytes or stored metadata (covered only by the schema's deliver param).

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 sentences, front-loaded with the core action and options, then the pricing detail. Efficient with no filler, though the parenthetical option list borders on redundant with the schema.

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 21-parameter tool with nested objects, no annotations and no output schema, the description is thin. The pricing note is a genuine addition, but it omits any mention of the bytes-vs-metadata delivery choice, error handling, or prerequisite auth, leaving notable gaps.

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 coverage is 76%, so the schema already documents most parameters well (defaults, ranges, formats). The description merely re-lists a subset of pdfOptions (format, scale, margins, templates, printBackground, pageRanges) that the schema already covers, adding no meaning beyond it.

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?

States a specific verb (render) and both resource types (URL or HTML) producing a PDF, with the mechanism named (Puppeteer page.pdf). It is clear what the tool does, though it does not explicitly differentiate itself from siblings like screenshot or markdown.

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?

No guidance on when to choose this tool over the sibling rendering tools (screenshot, markdown, snapshot, links). The url-vs-html exclusivity lives in the schema, not the description, so there is essentially no usage routing here.

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.

Resources