Skip to main content
Glama

apex-dev

Html to pdf

html_to_pdf
Read-onlyIdempotent

Convert raw HTML markup into a print-ready base64 PDF via hermetic sandboxed headless Chrome (no external network requests). $0.003 per call over x402 (USDC on Arc, Base or Solana, or XNT on X1). Call once without payment for terms, then call again with payment.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "html": "<html>"
    },
    "name": "html_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesHTML markup to render into PDF (up to 512 KB; inline CSS and data: URIs supported).
formatNoOptional paper format: A4 (default), Letter, Legal, Tabloid, A3, or A5.
marginNoOptional margin preset: none, compact, normal (default), or wide.
paymentNosigned x402 payment payload (PAYMENT-SIGNATURE).
landscapeNoOptional: render landscape orientation when true (default false).
printBackgroundNoOptional: print CSS backgrounds (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations cover safety and idempotency, but the description adds material facts: rendering is hermetic in a sandboxed headless Chrome with no external network requests, output is base64 PDF, cost is $0.003 per call, and payment settles in USDC/XNT over x402 on named chains. Pricing and the no-network constraint are not in annotations and directly affect an agent's decision to call. Return-value shape is disclosed even though no output schema exists.

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?

Three sentences, each doing distinct work: what it produces, the sandbox/network constraint plus price, then the payment call sequence. Purpose is front-loaded and the dense payment sentence is necessary rather than padding.

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 must disclose the return value, and it does (base64 PDF). For a 6-parameter tool it covers purpose, constraints, cost, payment protocol, and call sequencing; remaining details (size cap, format defaults) are fully specified in the schema.

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 every parameter (html, format, margin, payment, landscape, printBackground) is already documented in structured form. The description contributes no parameter-level detail beyond the schema — it mentions `payment` only as part of the call sequence. Baseline 3 applies.

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?

"Convert raw HTML markup into a print-ready base64 PDF" is a precise verb+resource+output statement. The input type (raw markup, not a URL) implicitly separates it from URL-oriented siblings like page_markdown or browser_render, but no sibling is named, so differentiation is left to inference.

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?

The description gives explicit procedural guidance for the paid flow: call once without `payment` for terms, then call again with `payment`. That removes the main ambiguity an agent would hit. It does not say when to prefer this over alternatives such as html_to_markdown or browser_render, so it stops short of a 5.

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