Skip to main content
Glama

html_to_pdf

Convert HTML files into styled PDFs with CSS presets, custom CSS, page size, and orientation options.

Instructions

Convert HTML to styled PDF

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": {
      "input": "<input>",
      "output": "<output>"
    },
    "name": "html_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesPath to input file
outputYesPath to output PDF file
presetNoCSS preset (github, elegant, minimal, branded, compact)
page_sizeNoPage size format (e.g. A4, Letter)
custom_cssNoCustom CSS rules to apply
orientationNoPage orientation (portrait or landscape)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and falls well short. It does not say whether existing output files are overwritten, whether external assets/CSS are fetched, whether conversion runs headless, or what errors occur on invalid HTML or paths.

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?

A single five-word phrase with zero waste and the resource pair front-loaded. It is terse to the point of under-specification, but nothing in it is redundant.

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

Completeness3/5

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

The tool is conceptually simple and the schema is fully documented, and no output schema means return-value explanation is not required. However, for a six-parameter file-writing tool with no annotations, the absence of any note on file path handling, overwrite behavior, or styling sources leaves a real gap.

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%, so every parameter including preset values, page_size, and orientation is already documented in the schema. The word "styled" loosely signals the CSS-related parameters but adds no new syntax or constraint detail, 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?

States a specific verb and both resource endpoints (HTML in, PDF out), plus the qualifier "styled" that distinguishes it from a plain conversion. It does not explicitly contrast with the similarly named sibling pdf_convert_html, so an agent must infer the difference from the name alone.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no mention of alternatives such as pdf_convert_html or md_to_pdf, and no stated prerequisites (e.g., that input paths must exist locally). The agent is left to guess context entirely.

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