Skip to main content
Glama

HTML to PDF

HTMLtoPDF
Read-only

HTML to PDF: This HTML to PDF API renders raw HTML markup into downloadable PDF files. Send your escaped HTML string to receive a signed download link, an expiration timestamp, and the generated document filename. (Cost: 20 credits)

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": "HTMLtoPDF"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesThe HTML content to convert to PDF. Ensure that the HTML is escaped properly
scaleNoZoom applied to the page content, 0.1 to 2
formatNoPaper sizeA4
landscapeNoSet to true for landscape orientation
marginTopNoThe top margin of the PDF in inches (e.g., 0.5)0.4
marginLeftNoThe left margin of the PDF in inches (e.g., 0.5)0.4
pageRangesNoOnly these pages, e.g. 1-3, 5
marginRightNoThe right margin of the PDF in inches (e.g., 0.5)0.4
marginBottomNoThe bottom margin of the PDF in inches (e.g., 0.5)0.4
footerTemplateNoHTML printed at the bottom of every page, with the same placeholders as headerTemplate, e.g. <span class="pageNumber"></span> of <span class="totalPages"></span>
headerTemplateNoHTML printed at the top of every page. Spans with class pageNumber, totalPages, date, title or url are filled in. Use inline styles with a font-size (Chromium defaults to a tiny font) and leave room with marginTop
printBackgroundNoPrint background colours and images; set false for an ink-saving document

Output Schema

NameRequiredDescriptionDefault
dataNo
errorNoError message, null on success
statusNo"ok" on success

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is covered. The description adds genuinely useful behavior beyond that: it discloses the return payload (signed download link, expiration timestamp, filename) and a concrete cost of 20 credits, which an agent needs for budgeting decisions and for knowing the link is time-limited.

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?

Three short sentences with the core action stated first, followed by input requirement, output shape, and cost. Minor waste in restating the tool name twice ('HTML to PDF: This HTML to PDF API'), but nothing else is extraneous.

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

Completeness4/5

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

For a 12-parameter rendering tool with an output schema and full annotation coverage, the description supplies the essentials: input type, output artifacts, expiration behavior, and credit cost. It does not discuss failure modes or whether the link is bearer-authenticated, but those are secondary given the rich schema and output 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 all twelve parameters (scale, format, margins, pageRanges, header/footer templates, printBackground) are already documented in the schema. The description only echoes the escaping requirement for `html`, adding no syntax or format detail beyond structured data, so the 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?

The description states a specific verb and resource: it 'renders raw HTML markup into downloadable PDF files,' which is more precise than a bare name restatement. The phrase 'raw HTML markup' implicitly distinguishes it from URL-based siblings like WebsitetoPDF or MarkdowntoPDF, but no sibling is actually named, so the 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 Guidelines3/5

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

Usage is implied by the mechanics ('send your escaped HTML string'), which tells the agent what input the tool expects. However, there is no explicit statement of when to choose this over WebsitetoPDF, MarkdowntoPDF, HTMLtoImage, or OfficetoPDF, and no when-not guidance or prerequisites beyond the escaping note.

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.