Skip to main content
Glama

Api2Pdf MCP by usefulapi

HTML to PDF (Chrome)

api2pdf_html_to_pdf
Destructive

Render an HTML string to a PDF using the headless-Chrome engine. Returns a { FileUrl } link (valid ~24h) by default. Great for invoices, reports, and letters produced as HTML. BILLED per document. Api2Pdf API: POST /chrome/pdf/html.

Input Schema

NameRequiredDescriptionDefault
htmlYesThe HTML source to render into a PDF.
inlineNoIf true (Api2Pdf default), the generated file is served inline; if false, as an attachment.
optionsNoEngine-specific render options (page size, margins, orientation, headers/footers, etc.). Passed through verbatim to Api2Pdf.
storageNoCustom storage target, used when useCustomStorage is true.
fileNameNoA name for the generated file, e.g. 'invoice.pdf'.
output_binaryNoIf true, return the raw file bytes as base64 instead of a FileUrl. Default false (recommended for agents — returns a short-lived link).
extraHTTPHeadersNoExtra HTTP headers Api2Pdf forwards when it fetches a source URL (e.g. auth for a protected page/file).
useCustomStorageNoIf true, Api2Pdf uploads the result to your own storage (see `storage`) instead of hosting it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only declare destructiveHint=true, so the description carries most of the burden and does so well: it discloses the default return shape ({ FileUrl }, valid ~24h) and that calls are billed per document. It stops short of explaining when the link expires relative to retrieval or what happens on failures, so it is strong but not exhaustive.

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?

Front-loaded with the core action and engine, followed by return shape, use cases, billing, and endpoint. Every sentence except the trailing 'Api2Pdf API: POST /chrome/pdf/html' endpoint restatement carries useful information; that last line is mild redundancy.

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?

With no output schema, the description correctly fills the gap by describing the FileUrl return and its validity window, plus billing behavior. Nested options and custom-storage parameters are left entirely to the schema, which is adequate given 100% coverage but leaves the description slightly thin for an 8-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 eight parameters including the storage and options objects. The description only indirectly touches output_binary by noting the default FileUrl return, adding little beyond the schema. Baseline 3 is appropriate.

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 (render), resource (HTML string to PDF), and engine (headless-Chrome), which implicitly separates it from api2pdf_wkhtml_to_pdf (different engine) and api2pdf_url_to_pdf (different input). It does not explicitly name those siblings, but the engine and input-type qualifiers give an agent enough to disambiguate.

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

Usage Guidelines3/5

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

'Great for invoices, reports, and letters produced as HTML' implies the usage context, and 'BILLED per document' is a useful cost warning. However, there is no explicit when-not guidance and no named alternative (e.g. use wkhtml for legacy CSS, or url_to_pdf when you have a link), so routing is left to inference.

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.