Skip to main content
Glama
pdf4me
by pdf4me

convert_html_to_pdf

Convert a local HTML file into a PDF by providing its file path. Configure layout, page format, scale, margins, print background, and header/footer as needed.

Instructions

Convert a local HTML file to PDF using the PDF4me ConvertHtmlToPdf API. Provide the file path to the HTML document. Configure layout, page format, scale, margins, print background, and header/footer. Optionally set output directory and output file name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scaleNoContent scale (e.g. 0.8 = 80%).
layoutNoPortrait or Landscape.Portrait
file_pathYesLocal path to the HTML file (.html or .htm).
output_dirNo
top_marginNo40px
left_marginNo40px
page_formatNoPage size (e.g. A4, Letter).A4
right_marginNo40px
bottom_marginNo40px
output_file_nameNo
print_backgroundNoInclude backgrounds in the PDF.
display_header_footerNoShow header/footer when supported.
Behavior3/5

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

Without annotations, the description must carry the full burden of behavioral disclosure. It does state that this uses an API (implying network access) and lists configurable options. However, it does not disclose default output behavior (where the PDF is written if output_dir/output_file_name are not set), whether existing files are overwritten, what the API returns (if anything), or error handling. The description is partially transparent 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?

The description is concise and well-structured. It consists of two sentences: the first states the core purpose, and the second lists configurable options and output settings. Every sentence carries relevant information, with no filler or unnecessary words.

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?

For a tool with 12 parameters, no output schema, and no annotations, the description covers the main functional aspects: input file, configuration options, and output naming. However, it lacks important contextual details such as return behavior (whether the PDF is returned or just saved), error conditions, network/auth requirements (beyond 'API'), and default output directory/file name behavior. The description is adequate for basic use but not fully complete for an API-driven 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 coverage is 50%, and the description partially compensates by listing major parameter groups (layout, page format, scale, margins, print background, header/footer, output directory/file name). However, it does not explain units, defaults, or allowed values beyond what the schema already provides. For example, margins are mentioned but the description doesn't specify that they are in pixels (as seen in schema defaults like '40px'). The description adds an overview but not deep semantic detail.

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 clearly states 'Convert a local HTML file to PDF' with a specific verb (Convert), resource (local HTML file), and output (PDF). It distinguishes from sibling tools like convert_url_to_pdf (which handles URLs) by explicitly stating 'local' and 'Provide the file path'. The mention of 'PDF4me ConvertHtmlToPdf API' adds specificity.

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 clearly indicates when to use this tool: when you have a local HTML file and need a PDF. It says 'Provide the file path to the HTML document', which implies local input. It doesn't explicitly exclude remote URLs or mention alternatives, but the context emphasizes local file handling, so a clear usage context is provided without explicit exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pdf4me/pdf4me-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server