Skip to main content
Glama

render_html_to_pdf

Prepare a paid PDF render from arbitrary Handlebars-flavoured HTML. Use only when no starter fits (one-off layouts, custom branding). Prefer render_template_to_pdf when a starter matches. Validates your HTML and returns the exact, ready-to-execute HTTP request to run against pdfzen's render endpoint — POST /v402/render/pdf (x402, $0.006 USDC on Base, no API key) or POST /v1/render/pdf (pdfzen API key). pdfzen renders are executed over HTTP, not streamed in-band over MCP; this tool is the bridge.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cssNoOptional CSS injected into the document head. Alternative to inline <style> in `html`.
dataNoHandlebars context object resolved against the {{...}} expressions in `html`.
htmlYesThe HTML body. Supports Handlebars {{ }} expressions resolved against `data`, plus pdfzen helpers ({{barChart}}, {{lineChart}}, {{pageBreak}}, {{#each}}, {{#if eq}}). Don't include <html>/<head>; just the body content + any <style> tags.
pageOptionsNoPage format/margin/orientation. Defaults to A4 portrait. Example: { "format": "A4", "margin": { "top": "20mm" } }.

Schema Changelog

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

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

The description discloses significant behavioral context beyond annotations: the tool returns a ready-to-execute HTTP request rather than rendering in-band ('pdfzen renders are executed over HTTP, not streamed in-band over MCP'), includes pricing and endpoint details ('$0.006 USDC on Base, no API key' vs 'pdfzen API key'), and mentions HTML validation. This substantially enriches the annotation readOnlyHint=false and openWorldHint=true.

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 information-dense yet concise, front-loaded with purpose and immediately followed by usage guidance and key behavioral details. Every sentence earns its place, covering purpose, alternatives, cost, endpoints, auth, and the bridge nature without fluff.

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?

No output schema exists, so the description carries the burden of explaining return value, which it does clearly ('returns the exact, ready-to-execute HTTP request'). It also covers the two execution environments, pricing, auth differences, and validation, making it complete for a tool of this complexity.

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% with detailed descriptions for all four parameters, so the description need not compensate. The description does mention Handlebars-flavoured HTML and the returned HTTP request but adds little to parameter-specific meaning beyond what the schema already provides. Baseline 3 is appropriate.

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: 'Prepare a paid PDF render from arbitrary Handlebars-flavoured HTML.' It distinguishes itself from siblings by explicitly saying 'Use only when no starter fits' and 'Prefer render_template_to_pdf when a starter matches.' The verb 'prepare' and resource 'paid PDF render' are specific.

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

Usage Guidelines5/5

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

Explicit guidance on when to use: 'Use only when no starter fits (one-off layouts, custom branding).' It also names the alternative: 'Prefer render_template_to_pdf when a starter matches.' This is a clear when/when-not with an explicit alternative.

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.7/5.0
Disambiguation5/5

Each tool serves a distinct purpose: list_starters discovers templates, get_starter retrieves template details, render_template_to_pdf renders from a starter, and render_html_to_pdf renders custom HTML. The boundary between the two render tools is clearly defined by whether a starter is used or not.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern: list_, get_, render_ with clear object names (starters, starter, html, template). The naming is uniform and predictable across the set.

Tool Count5/5

With only 4 tools, the server is tightly scoped to its core workflow: discovering templates, inspecting them, and rendering PDFs. Each tool is necessary and none feel redundant or extraneous.

Completeness5/5

The tool surface covers the full lifecycle: discovery (list), investigation (get), and rendering (two variants for starter vs custom HTML). The workflow from list to get to render is fully supported, and the HTML path covers custom cases. No obvious gaps for the stated purpose.

Resources