Skip to main content
Glama
FileToPDF

FileToPDF MCP server

Official
by FileToPDF

Convert HTML to PDF

convert_html

Convert HTML markup to PDF documents using Chromium rendering. Supports custom CSS, page sizes, margins, and orientation for tailored PDF output.

Instructions

Render a raw HTML string to a PDF using Chromium, with optional CSS and layout options. Costs 1 credit on success. Returns the PDF as an embedded resource.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlYesThe HTML markup to render.
cssNoOptional CSS, injected into the document <head>.
landscapeNoRender in landscape orientation. (Pro/Scale/trial only.)
paperWidthNoPaper width in inches, or with a unit e.g. "210mm".
paperHeightNoPaper height in inches.
marginTopNoTop margin in inches.
marginBottomNoBottom margin in inches.
marginLeftNoLeft margin in inches.
marginRightNoRight margin in inches.
scaleNoRender scale, 0.1–2.0.
printBackgroundNoPrint background graphics/colors.
preferCssPageSizeNoUse the page size declared in CSS @page rules.
nativePageRangesNoPage ranges to include, e.g. "1-3,5".
pdfaNoPDF/A conformance level, e.g. "PDF/A-2b". (Pro/Scale/trial only.)
pdfuaNoProduce an accessible PDF/UA document.
userPasswordNoPassword required to open the resulting PDF.
ownerPasswordNoOwner password controlling permissions on the resulting PDF.
save_pathNoOptional absolute path to also write the PDF to on disk.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations only have openWorldHint=true, so description carries burden. It adds credit cost and return format, but does not disclose side effects like file writing via save_path parameter or rendering environment details. Additional behavioral info is valuable but incomplete.

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?

Three sentences with zero waste: action, optional options, cost, output. Front-loaded with purpose. Every sentence adds distinct value.

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?

Given 18 parameters and no output schema, description covers main action, input, output, and cost. Missing side effects (save_path file writing), rendering environment details (JavaScript execution), and timeouts. Adequate but not comprehensive.

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 baseline is 3. Description groups parameters as 'optional CSS and layout options', adding minimal meaning beyond schema. No new constraints or format details provided.

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 strong verb 'Render' and specific resource 'raw HTML string', output 'PDF'. It clearly distinguishes from siblings: convert_file (likely file-based), convert_markdown (markdown input), and get_account (unrelated).

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?

The description states 'raw HTML string' implying file-based HTML should use convert_file, but no explicit when-not or alternative mention. Context is clear enough due to sibling tool names, but lacks direct exclusionary guidance.

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