Skip to main content
Glama

Render HTML to an image or PDF

render_html

Convert HTML into JPEG, PNG, WebP, or PDF documents like invoices, reports, and certificates; returns a file link and inline image when small.

Instructions

Renders an HTML document you provide as a JPEG, PNG or WebP image, or as a PDF: an invoice, a report, a certificate. Returns a link to the file, and the image itself when it is small enough. Images, fonts and stylesheets referenced by the HTML must use absolute URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlYesThe HTML document to render, up to 2 MB.
widthNoViewport width in pixels, 200 to 3840. Values outside the range are clamped. Default 1280.
formatNoOutput type. `jpeg` (default), `png`, `webp`, or `pdf` for a paged document.jpeg
heightNoViewport height in pixels, 150 to 4320. Values outside the range are clamped. Default 1024.
qualityNoJPEG quality from 1 to 100. Sent as 80 when omitted, which keeps most captures small enough to be returned inline. Ignored for other formats.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare the non-read-only, open-world, non-idempotent safety profile, so the bar is lower; the description still adds real value by disclosing the return shape (a link to the file, plus the image inline when small enough) and the external-resource constraint. It does not cover link lifetime, failure modes, or rendering latency.

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?

Two sentences, zero filler. Output formats and use cases come first, then the return behavior and the absolute-URL constraint, so the most decision-relevant information is front-loaded.

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 carries the return-value burden and does so ('returns a link to the file, and the image itself when it is small enough'). Combined with the 100%-covered schema and existing annotations, an agent has everything needed to select and call the tool.

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 baseline is 3. The description restates the format list and the 2 MB limit that the schema already documents, and adds no new meaning for width, height, or quality parameters.

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?

States a specific verb and resource ('Renders an HTML document you provide') plus the concrete output surface (JPEG, PNG, WebP, PDF), so an agent can tell it apart from markdown converters in the sibling set. It never names an alternative such as capture_screenshot, though the 'HTML you provide' phrasing implicitly separates it from URL-based capture tools.

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 concrete use cases (invoice, report, certificate) and a hard prerequisite for correct use: referenced images, fonts and stylesheets must use absolute URLs. There is no explicit when-not guidance or named alternative, but the context and constraint are clear enough to invoke correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.