Skip to main content
Glama

html_to_pdf_wk

Convert HTML to PDF using the wkhtmltopdf rendering engine. Supports JavaScript execution and screen-capture style rendering. Good for simple documents, web page snapshots, layouts that rely on JavaScript, and fillable PDF forms (set pdfForms to true). Available on all PdfBroker.io plans including the free tier. Does NOT support PDF/A or PDF/UA compliance — use html_to_pdf for compliant documents. Does NOT honour CSS '@page { size: ... }' — page geometry comes from paperSize and orientation; use html_to_pdf when the document's own stylesheet must decide. EU-first defaults: A4 paper, Portrait orientation.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "html_to_pdf_wk"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoOptional https URL of an already published HTML document or web page, fetched by PdfBroker instead of sending the markup inline. Use this to keep a large template out of the conversation, or to snapshot a live page. Only https is accepted, and addresses on private networks or cloud metadata endpoints are refused. If both 'url' and 'html' are supplied, 'url' wins. Relative images, fonts and stylesheets resolve against the document's own URL, so the 'resources' parameter has no effect on a url render. This engine renders whatever the address returns, including a 404 or a login page — it does not check the HTTP status — so a wrong or protected URL comes back as a PDF of that page rather than as an error. Check the URL before relying on the output.
htmlNoHTML content to convert. Can be a full document or a fragment. Optional if 'url' is supplied instead — pass exactly one of the two.
pdfFormsNoSet to true to produce a fillable PDF: the document's <input>, <select> and <textarea> elements become interactive form fields a recipient can type into and save. Default false, which flattens them into static text.
paperSizeNoPaper size: 'Auto' (default) leaves it to the engine, which uses A4 (EU-first default). Name a size to set it explicitly: 'A4', 'Letter', 'A3', 'Legal'. Note that wkhtmltopdf does NOT honour CSS '@page { size: ... }' — if the page geometry must come from the document's own stylesheet, use the html_to_pdf tool.Auto
resourcesNoOptional embedded resources referenced by relative path in the HTML. Keys are relative paths (e.g., 'images/logo.png'), values are base64-encoded file contents. Unused entries are silently ignored. Invalid base64 returns a clear, key-named error before the API call is made.
orientationNoPage orientation: 'Auto' (default, engine default is Portrait), 'Portrait' or 'Landscape'.Auto
extraArgumentsNoOptional extra wkhtmltopdf engine arguments forwarded verbatim to the engine. Keys are CLI long-form options without '--'. For switch-style flags use an empty-string value — example: {"enable-forms": ""} to make form fields in the rendered PDF interactive. On key collision with structured parameters (paperSize, orientation), the user-supplied extra wins. See the docs://pdfbroker/api-reference resource for the supported argument list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • addedInput schema / properties / html / default
      Added value: +null
    • changedInput schema / properties / html / description
      Previous value: -"HTML content to convert. Can be a full document or a fragment."New value: +"HTML content to convert. Can be a full document or a fragment. Optional if 'url' is supplied instead — pass exactly one of the two."
    • changedInput schema / properties / html / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / orientation / default
      Previous value: -"Portrait"New value: +"Auto"
    • changedInput schema / properties / orientation / description
      Previous value: -"Page orientation: 'Portrait' (default) or 'Landscape'"New value: +"Page orientation: 'Auto' (default, engine default is Portrait), 'Portrait' or 'Landscape'."
    • changedInput schema / properties / paperSize / default
      Previous value: -"A4"New value: +"Auto"
    • changedInput schema / properties / paperSize / description
      Previous value: -"Paper size: 'A4' (default, EU-first), 'Letter', 'A3', 'Legal'"New value: +"Paper size: 'Auto' (default) leaves it to the engine, which uses A4 (EU-first default). Name a size to set it explicitly: 'A4', 'Letter', 'A3', 'Legal'. Note that wkhtmltopdf does NOT honour CSS '@page { size: ... }' — if the page geometry must come from the document's own stylesheet, use the html_to_pdf tool."
    • addedInput schema / properties / pdfForms
      Added value: +{
      +  "default": false,
      +  "description": "Set to true to produce a fillable PDF: the document's <input>, <select> and <textarea> elements become interactive form fields a recipient can type into and save. Default false, which flattens them into static text.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / url
      Added value: +{
      +  "default": null,
      +  "description": "Optional https URL of an already published HTML document or web page, fetched by PdfBroker instead of sending the markup inline. Use this to keep a large template out of the conversation, or to snapshot a live page. Only https is accepted, and addresses on private networks or cloud metadata endpoints are refused. If both 'url' and 'html' are supplied, 'url' wins. Relative images, fonts and stylesheets resolve against the document's own URL, so the 'resources' parameter has no effect on a url render. This engine renders whatever the address returns, including a 404 or a login page — it does not check the HTTP status — so a wrong or protected URL comes back as a PDF of that page rather than as an error. Check the URL before relying on the output.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • removedInput schema / required
      Removed value: -[
      -  "html"
      -]
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and discloses important behavioral traits: JavaScript execution support, screen-capture style rendering, lack of PDF/A/PDF/UA compliance, ignoring of CSS @page, and EU-first defaults. It could add more on errors or return behavior, but the provided limitations and defaults give solid transparency.

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 dense but every sentence earns its place: renderer, capabilities, use cases, exclusions, plan availability, and defaults. Bold formatting highlights fillable forms, and the explicit 'Does NOT' clauses make limitations scannable. No filler or redundancy.

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

Completeness5/5

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

Seven parameters, no annotations, and no output schema, yet the description covers the decision-relevant context: what the tool does, when to use it, when not to, key limitations, and defaults. The parameter descriptions in the schema fill in the remaining details, making the tool fully contextualized for selection and invocation.

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 parameters are already fully documented with rich details (e.g., url fetching behavior, pdfForms interaction, paperSize defaults). The description adds minor context like 'EU-first defaults' and 'page geometry comes from paperSize and orientation,' but does not need to duplicate the schema. Baseline 3 is appropriate.

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 the action: 'Convert HTML to PDF using the wkhtmltopdf rendering engine.' It immediately distinguishes from the sibling html_to_pdf by explicitly listing unsupported features (PDF/A, PDF/UA, CSS @page) and when the alternative should be used. The verb+resource is specific and unambiguous.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use guidance: 'Good for simple documents, web page snapshots, layouts that rely on JavaScript, and fillable PDF forms.' It also provides concrete when-not-to-use scenarios by naming html_to_pdf for compliant documents or when the document's stylesheet must control page geometry, which is clear exclusionary guidance.

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.

Resources