Skip to main content
Glama

WeasyPrint by pagespool

Render an HTML document to a PDF

render_pdf
Read-only

Render up to 256 KB of HTML to a PDF with WeasyPrint. Returns a download link.

Give the user the download_url so they can open the PDF. The link works for 15 minutes; after that, render again. The result is {"download_url": "<link>", "pages": <page count>, "size_bytes": <PDF size>, "expires_in_minutes": 15}. Only HTML and CSS are rendered; JavaScript is not run. For documents larger than 256 KB, use the REST API (POST /v1/weasyprint/render).

Credits: 1 per call.

Input Schema

NameRequiredDescriptionDefault
htmlYesA complete HTML document, up to 256 KB. Inline images, fonts and CSS as data: URIs; external resources are not loaded.
pdf_variantNoWrite the PDF as PDF/A-2b or PDF/A-3b, for archiving. Paid plans only. Leave it out for a regular PDF.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnlyHint/openWorldHint; the description adds the substantive behavior an agent can't infer: links expire in 15 minutes, results are ephemeral and must be re-rendered, JavaScript is never executed, external resources are not fetched, and each call costs 1 credit. That is exactly the extra context annotations don't carry.

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?

Front-loaded with the core action and limit, then behavior, then cost — nothing is buried. The one redundancy is reproducing the full JSON result shape verbatim while a dedicated output schema already exists, which costs a couple of lines that could have been trimmed.

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

Completeness5/5

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

For a two-parameter render tool with an output schema and annotations already supplied, everything an agent needs is present: size limit, execution constraints, expiry handling, cost, and the escalation path for larger inputs. No material gap remains for correct invocation.

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 100%, so both parameters are already documented — including the data: URI requirement and the paid-plan caveat on `pdf_variant`. The description's only genuine addition is 'JavaScript is not run', which constrains what the `html` value may rely on; otherwise it restates the schema.

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?

Opens with a specific verb+resource ('Render ... HTML to a PDF') plus the rendering engine (WeasyPrint) and a hard input ceiling (256 KB). An agent knows exactly what the tool produces and under what constraint, without needing siblings to differentiate against.

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?

Gives explicit downstream usage ('Give the user the `download_url`'), an expiry condition with the remedy ('after that, render again'), and routes oversized documents to the REST API endpoint. What's missing is any when-to-use framing beyond size — e.g. that external assets or JS-driven pages should be inlined or pre-rendered elsewhere.

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