Skip to main content
Glama

generate_document

Generate PDF documents from templates and data. Create invoices, contracts, reports, and certificates by injecting data into HTML/Handlebars templates with custom paper sizes and filenames.

Instructions

Generate a PDF document from a template and data. Returns a download URL for the generated PDF. Provide either template_id (to use a saved template) or markup (inline HTML/Handlebars template). The data object is injected into the template to produce the final document. Supports custom paper sizes, orientation, and filenames.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idNoID of a saved template to use. Mutually exclusive with markup.
markupNoInline HTML/Handlebars markup template. Use when you don't have a saved template.
dataYesKey-value data to populate the template placeholders.
paper_sizeNoPaper size for the PDF. Defaults to A4.
orientationNoPage orientation. Defaults to portrait.
filenameNoCustom filename for the generated PDF (e.g. 'invoice-2024.pdf').
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the core functionality (PDF generation, download URL return) and mentions supported features (custom paper sizes, orientation, filenames). However, it lacks details on error conditions, rate limits, authentication requirements, or whether the generated document is stored permanently.

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 front-loaded with the core purpose and output, followed by essential usage details. Every sentence adds value without redundancy, and it efficiently covers key aspects (template options, data injection, supported features) in a compact form.

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?

Given the tool's complexity (6 parameters, nested objects) and lack of annotations or output schema, the description does a good job of covering the main functionality and parameters. However, it could be more complete by addressing error handling, storage implications, or linking to sibling tools like preview_template for validation.

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 parameters thoroughly. The description adds minimal value beyond the schema by mentioning the mutual exclusivity of template_id and markup and the injection of data into templates, but does not provide additional syntax or format details. This meets the baseline for high schema coverage.

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 specific action ('Generate a PDF document'), resource ('from a template and data'), and output ('Returns a download URL for the generated PDF'). It distinguishes this tool from siblings like create_template (which creates templates) and get_document (which retrieves documents) by focusing on document generation.

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 provides clear context on when to use this tool ('Generate a PDF document from a template and data') and offers guidance on parameter usage ('Provide either template_id or markup'). However, it does not explicitly state when NOT to use it or mention alternatives like preview_template for testing templates before generation.

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/yoryocoruxo-ai/rendoc-mcp-server'

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