Skip to main content
Glama

500Toolbox

HTML to Image

html-to-image
Read-onlyIdempotent

Renders markup you pass in - not a URL - using the same browser engine, so grid, flexbox, gradients and web fonts all behave normally. The markup is rendered with no base URL, so images must use absolute https addresses or data URIs. Useful for turning email templates, invoices and social cards into pictures without deploying them. Costs 25 credits per call.

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-image"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesA full document or a bare fragment. Fragments are wrapped for you.
widthNoCanvas width in CSS pixels; this is the viewport your CSS lays out against. Defaults to 1440.
formatNopng or jpeg. Defaults to png.png
heightNoCanvas height in CSS pixels. Ignored when fullPage is true. Defaults to 900.
qualityNoJPEG quality, 40-100. Ignored for png. Defaults to 85.
fullPageNoCapture the whole document rather than one canvas-sized frame. Defaults to False.
deviceScaleFactorNo1 for standard density, 2 for a Retina render. Defaults to 1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real behavioral context beyond them: no base URL is injected, so assets need absolute https or data URIs, and each call costs 25 credits. It omits what the call actually returns (image payload vs. hosted URL), which matters given there is no output schema.

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?

Four sentences, each carrying distinct information: what it renders, the asset-path constraint, use cases, and cost. The most important distinction (markup, not URL) is front-loaded in the first clause.

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 seven-parameter render tool with full schema documentation and annotations, the description covers the non-obvious failure modes well. The one remaining gap is the return value, which no output schema documents and which the description never characterizes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns an extra point by explaining the rendering constraint that governs the required `html` parameter — that relative asset paths will fail because no base URL is set. It adds no further guidance on the sizing or quality parameters beyond the schema.

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?

Opens with a specific verb and resource ("Renders markup you pass in") and immediately disambiguates the most likely confusion by stating "- not a URL -", which separates it from website-screenshot. The mention of the shared browser engine makes the fidelity promise concrete.

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 when-to-use examples (email templates, invoices, social cards rendered without deploying) and an implicit when-not-to-use signal via "not a URL" for URL-based screenshotting. It stops short of naming the sibling tool, so the routing clue is inferential rather than explicit.

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