Skip to main content
Glama

Create a PDF from a template

apitemplate_create_pdf

WRITE: renders one PDF from a saved PDF template and your JSON data (the keys the template uses, e.g. invoice_number, items), and returns the hosted download_url (never the file bytes). Synchronous. COST: uses 1 generation of your APITemplate.io plan quota per call (see apitemplate_get_account). Do not retry or repeat it unless needed; every call is counted. POST /v2/create-pdf (export_type=json).

Input Schema

NameRequiredDescriptionDefault
dataYesJSON data merged into the template, e.g. {"invoice_number":"INV-1","total":42}. Keys depend on the template.
metaNoYour own reference id for this file; it shows up in apitemplate_list_objects.
filenameNoCustom file name ending in .pdf (default: a random UUID).
expirationNoMinutes until the hosted file expires: 0 = keep permanently (default), or 1-10080.
output_htmlNoAlso return html_url, the rendered HTML.
template_idYesThe template id (apitemplate_list_templates, or the web console, Manage Templates).
generation_delayNoMilliseconds to wait before rendering (0-30000), for pages that load content late.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only cover the safety profile (not read-only, non-idempotent, open-world). The description adds material facts they don't: it is synchronous, it returns a hosted URL rather than bytes, each call burns one plan generation, and calls should not be retried casually. That is exactly the extra context an agent needs for a metered, non-idempotent write.

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-loads 'WRITE:' and then 'COST:' so the two most decision-relevant facts come first, and the closing endpoint line is useful deployment context. The sentences are heavily parenthetical and dense, which slightly hurts scanability, but there is no filler content.

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?

For a 7-parameter, non-idempotent, metered write with full schema coverage, the description covers purpose, return shape (download_url), billing impact, and sync behavior. With no output schema, the explicit note that bytes are never returned fills the remaining gap.

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 every parameter (data, meta, filename, expiration, template_id, output_html, generation_delay) is already documented in the schema. The description only restates the data-key idea with an example (invoice_number, items), adding no syntax or constraints beyond the schema, so 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 ('renders one PDF from a saved PDF template and your JSON data') and pins down the output ('returns the hosted download_url, never the file bytes'). The phrase 'saved PDF template' implicitly separates it from the create_pdf_from_html/markdown/url siblings that build a PDF from other sources.

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?

Gives clear context for use: it consumes a saved template plus matching JSON keys, is synchronous, and points to apitemplate_get_account for quota. It also warns against unnecessary retries. It stops short of explicitly naming the alternative tools (create_pdf_from_html, create_pdf_from_url) and the conditions that would select them, so it falls short of a 5.

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.