Skip to main content
Glama

Generate a PDF from HTML or Markdown

anvil_generate_pdf
Destructive

Generate a brand-new PDF from HTML or Markdown and return it as base64. REST: POST /generate-pdf. For type=html, pass data = { html, css? }. For type=markdown, pass data = [ { label, content }, ... ]. Returns { filename, byteLength, pdfBase64 }.

Input Schema

NameRequiredDescriptionDefault
dataYesFor html: { html: "<h1>Hi</h1>", css?: "..." }. For markdown: [ { label: "Section", content: "# Title\n..." }, ... ].
typeNoSource format. Default html.html
titleNoOptional title embedded in the generated PDF metadata.

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.9/5.0
Behavior4/5

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

Annotations carry only destructiveHint=true, so the description usefully adds the transport (POST /generate-pdf), the exact input shape per type, and the return structure ({ filename, byteLength, pdfBase64 }). It does not explain why the operation is flagged destructive, nor auth or size limits, but with annotation coverage the bar is lower and this adds real context.

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 purpose, then the REST mapping, the two input shapes, and the return contract — four dense statements with no filler. Slightly fragment-heavy, but nothing is wasted.

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 compensates by naming the return fields, and it covers both enum branches of the polymorphic input. Missing only secondary details such as error behavior or payload constraints, which are minor for a generation 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% and the schema already documents the polymorphic data field, type enum, and title. The description restates the same two data shapes almost verbatim, so it adds little meaning beyond the schema — baseline 3 applies.

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?

States a specific verb and resource ('Generate a brand-new PDF from HTML or Markdown') and distinguishes itself from the sibling anvil_fill_pdf by emphasizing brand-new creation versus filling an existing document. An agent can select it without opening the schema.

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?

The word 'brand-new' implies this is for creation rather than filling a template, but no alternative tool is named and no when-not guidance is given. Usage context is inferable rather than explicit, which is the definition of minimum-viable.

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.