Skip to main content
Glama

HTML to PDF

html_to_pdf
Read-only

Render a URL or raw HTML string to PDF. Returns pdf_base64 (base64 PDF; decode to get raw bytes) and page_count. Provide url OR html, never both. Supports format (A4/Letter/Legal), landscape boolean, and margin settings (top/bottom/left/right in CSS units). Use for invoices, reports, or printable document generation. Price: $0.0045 USDC per call, paid inside this MCP call via x402 (USDC on Base, Solana, Polygon or Arbitrum). x402 MCP clients such as @x402/mcp pay automatically. Free sample: call with the example input {"html":"Invoice #123Total: $42.00"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations give the safety profile (readOnlyHint=true, openWorldHint=true), and the description adds real context beyond them: the return shape, a per-call price, the x402 payment rails, and a free sample invocation. It stops short of rate limits or the public-accessibility constraint on the URL input.

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 purpose and return values, then constraints, then pricing. Every sentence is functional, though the pricing and free-sample sentences make it longer than strictly necessary for tool selection.

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?

With no output schema, the description correctly compensates by naming the return fields (pdf_base64, page_count) and explains the payment requirement. An agent has everything needed to invoke it correctly, including a runnable sample.

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 url/html, format, landscape, and margin. The description largely restates these (A4/Letter/Legal, CSS units) and only reinforces the oneOf constraint, adding no new parameter meaning.

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?

States a specific verb and resource: render a URL or raw HTML to PDF. It is immediately distinguishable from siblings like doc_convert, pdf_extract, and screenshot, and the returned artifacts (pdf_base64, page_count) are named up front.

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 clear use cases (invoices, reports, printable documents) and the critical input-exclusivity rule ('Provide url OR html, never both'). It does not name a sibling alternative such as doc_convert for other conversion paths, so no explicit when-not guidance.

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