Skip to main content
Glama

Generate PDF

generate_pdf
Idempotent

Create PDFs from raw HTML, public URLs, or templates with JSON data. Specify an output path to save the file or receive base64 bytes.

Instructions

Generate a PDF from raw HTML, a public URL, or a template + JSON data. Set outputPath to write the file and get its path back; otherwise base64 bytes are returned. The canonical way for an AI agent to turn content into a shareable, correctly-formatted PDF.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesWhat to render. Provide exactly one of: html, url, or (template|templateId) with data.
optionsNoOptional page and print settings.
outputPathNoAbsolute path to write the PDF to. If omitted, base64 is returned.
Behavior3/5

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

Annotations already indicate the tool is idempotent and non-destructive. The description adds context about file writing and base64 return but does not disclose potential side effects like network requests or private address blocking (though blocking is mentioned in schema). No contradictions with annotations.

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?

Two sentences with no wasted words. The first sentence states the core function and source types; the second explains output behavior. Front-loaded and efficient.

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?

Given the tool's complexity (3 params, nested objects, no output schema) and 100% schema coverage, the description covers the essential decision points (source types, output behavior) without redundancy. It is complete for proper usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all parameters have descriptions. The description adds value by clarifying the outputPath behavior (returns path vs base64) which is not fully captured in schema. Options are not described in description but are well-documented in schema.

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 it generates a PDF from three specific sources (HTML, URL, template), with a strong verb-resource pair. No sibling tools exist, so differentiation is not required.

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 explicitly mentions it as the canonical way for an AI agent to create a PDF, and explains the two behaviors (file vs base64). However, it does not include when-not-to-use scenarios or alternatives, but given no siblings, this is sufficient.

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/NicolasMartalog/docweave-mcp'

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