Skip to main content
Glama

html_to_pdf

Convert HTML content to a PDF document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlYesHTML content to convert to PDF
scaleNoScale factor 0.1-2
formatNoPaper format (default: A4)
marginNoPage margins in CSS units
outlineNoAuto-generate PDF outline/bookmarks from HTML headings (h1-h6 hierarchy)
metadataNoPDF document metadata (title, author, subject, keywords)
passwordNoPassword-protect the PDF with AES-256 or RC4 encryption
landscapeNoLandscape orientation
watermarkNoAdd diagonal text watermark on every page
printBackgroundNoPrint background graphics
emulateMediaTypeNoCSS media type emulation: "print" for clean PDFs, "screen" for screen styles

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • addedInput schema / properties / outline
      Added value: +{
      +  "description": "Auto-generate PDF outline/bookmarks from HTML headings (h1-h6 hierarchy)",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / password
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Password-protect the PDF with AES-256 or RC4 encryption",
      +  "properties": {
      +    "algorithm": {
      +      "description": "Encryption algorithm (default: AES-256)",
      +      "enum": [
      +        "AES-256",
      +        "RC4"
      +      ],
      +      "type": "string"
      +    },
      +    "ownerPassword": {
      +      "description": "Password for managing permissions (defaults to userPassword)",
      +      "maxLength": 128,
      +      "type": "string"
      +    },
      +    "permissions": {
      +      "additionalProperties": false,
      +      "description": "Granular PDF permissions",
      +      "properties": {
      +        "copying": {
      +          "description": "Allow copying text (default: true)",
      +          "type": "boolean"
      +        },
      +        "modifying": {
      +          "description": "Allow modifying (default: true)",
      +          "type": "boolean"
      +        },
      +        "printing": {
      +          "description": "Allow printing (default: true)",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "userPassword": {
      +      "description": "Password required to open the PDF",
      +      "maxLength": 128,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "userPassword"
      +  ],
      +  "type": "object"
      +}
  3. Changed3 schema fields changed
    • addedInput schema / properties / emulateMediaType
      Added value: +{
      +  "description": "CSS media type emulation: \"print\" for clean PDFs, \"screen\" for screen styles",
      +  "enum": [
      +    "screen",
      +    "print"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / metadata
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "PDF document metadata (title, author, subject, keywords)",
      +  "properties": {
      +    "author": {
      +      "description": "PDF document author",
      +      "type": "string"
      +    },
      +    "creator": {
      +      "description": "Application that created the content",
      +      "type": "string"
      +    },
      +    "keywords": {
      +      "description": "PDF keywords array",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "producer": {
      +      "description": "Application that produced the PDF",
      +      "type": "string"
      +    },
      +    "subject": {
      +      "description": "PDF document subject",
      +      "type": "string"
      +    },
      +    "title": {
      +      "description": "PDF document title",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / watermark
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Add diagonal text watermark on every page",
      +  "properties": {
      +    "color": {
      +      "additionalProperties": false,
      +      "description": "RGB color (default: gray)",
      +      "properties": {
      +        "b": {
      +          "description": "Blue 0-1",
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        "g": {
      +          "description": "Green 0-1",
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        "r": {
      +          "description": "Red 0-1",
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "r",
      +        "g",
      +        "b"
      +      ],
      +      "type": "object"
      +    },
      +    "fontSize": {
      +      "description": "Font size in points (default: 48)",
      +      "maximum": 200,
      +      "minimum": 8,
      +      "type": "number"
      +    },
      +    "opacity": {
      +      "description": "Opacity 0.01-1 (default: 0.3)",
      +      "maximum": 1,
      +      "minimum": 0.01,
      +      "type": "number"
      +    },
      +    "rotation": {
      +      "description": "Rotation angle in degrees (default: -45)",
      +      "maximum": 360,
      +      "minimum": -360,
      +      "type": "number"
      +    },
      +    "text": {
      +      "description": "Watermark text (e.g. \"DRAFT\", \"CONFIDENTIAL\")",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "text"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for disclosing behavioral traits. It only restates the conversion action and provides no information about return format, external resource handling, permission requirements, or potential side effects.

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?

The description is a single, clear sentence with no filler or redundant information. It is appropriately sized for its purpose and front-loads the core action.

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

Completeness2/5

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

Despite a rich input schema, the description omits return value behavior and usage context. Since no output schema exists, the description should have explained what the tool returns or what side effects occur. A one-line description is insufficient for an 11-parameter 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 schema already documents all 11 parameters. The description adds no parameter-level meaning, but per the rubric baseline this is acceptable when the schema is comprehensive.

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?

The description uses a specific verb ('Convert') and resource ('HTML content') to clearly state the tool's function. It also distinguishes itself from sibling tools like url_to_pdf (which handles URLs) and merge_pdfs/split_pdf (which manipulate existing PDFs).

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?

No guidance is given on when to use this tool versus alternatives. The sibling tool url_to_pdf exists for URL-based conversion, but the description does not mention it or any conditions that would make html_to_pdf the preferred choice.

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.

TDQS

A3.5/5.0
Disambiguation5/5

Each tool targets a distinct operation: create from HTML, create from URL, merge existing PDFs, inspect PDF metadata, and split/extract pages. The two creation tools are clearly differentiated by input source, so there is minimal risk of misselection.

Naming Consistency3/5

Names follow a mix of patterns: verb_object (merge_pdfs, split_pdf), noun_info (pdf_info), and source_to_output (html_to_pdf, url_to_pdf). While all use lowercase underscores, there is no consistent verb_noun style throughout, making it slightly less predictable.

Tool Count5/5

Five tools provide a focused set of PDF utilities without bloat. Each tool covers a distinct, essential capability for a PDF toolkit, and the count is well within the ideal range.

Completeness4/5

Core operations (creation from HTML/URL, merging, splitting, and information extraction) are covered. Missing advanced features like text extraction or compression, but the toolkit appears reasonably complete for its apparent purpose.

Resources