Skip to main content
Glama

Fill a template and print it

render_template

Fills a template with JSON data and prints it to PDF (a download link, valid 24 hours, and the edit link in the editor, where its template and data stay editable — until the person edits it on the page, which makes it a plain HTML document: then change its html). Either a gallery template (template_id from list_templates; without data it prints its sample) or your own template source. Send data in the shape of the template's sample (get_template). The language: read_guide topic "templates".

Input Schema

NameRequiredDescriptionDefault
dataNoThe values the template reads, in the shape of its sample data.
previewNoA picture (PNG) of page 1 comes with the answer, so you can check the layout, fonts and images before giving the links. Default: true.
filenameNoThe PDF file name. Default: the template's name or the document's <title>.
templateNoYour own template source (HTML with {{ value }}, {% for %}, {% if %}), instead of template_id.
template_idNoA gallery template's id, from list_templates.

Output Schema

NameRequiredDescriptionDefault
urlYesThe link, valid 24 hours.
markYesWhether the PDF carries the ReflowPDF mark, and why.
bytesYes
notesYesWhat to tell the person about this PDF.
pagesYes
timingNoThe engine's own parts of it, when it states them: layoutMs (styles, layout and pagination) and writeMs (writing the PDF).
editUrlNoThe document in the ReflowPDF editor: the person edits it there (the link is the document; it lasts while it is used).
previewNoWhat picture of the PDF came with this answer (page 1, as PNG), or why none did.
filenameYes
renderMsNoHow long the print took on the server, in milliseconds (the engine and its adapter).
revisionNoIts revision: name it to update_document as base_revision.
expiresAtYesWhen the link stops working (ISO 8601).
documentIdNoThe document, for get_document and update_document.
missingVariablesNoTemplate values the data did not have (printed empty).
skippedResourcesNoImages, fonts or style sheets the server could not fetch.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / preview
      Added value: +{
      +  "description": "A picture (PNG) of page 1 comes with the answer, so you can check the layout, fonts and images before giving the links. Default: true.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / preview
      Added value: +{
      +  "description": "What picture of the PDF came with this answer (page 1, as PNG), or why none did.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / renderMs
      Added value: +{
      +  "description": "How long the print took on the server, in milliseconds (the engine and its adapter).",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / timing
      Added value: +{
      +  "description": "The engine's own parts of it, when it states them: layoutMs (styles, layout and pagination) and writeMs (writing the PDF).",
      +  "properties": {
      +    "layoutMs": {
      +      "type": "number"
      +    },
      +    "writeMs": {
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing outputs and lifecycle: a PDF download link valid 24 hours, an editable editor link, and the state transition where editing on the page converts it to plain HTML. The closing clause 'then change its html' is ambiguous — no such parameter exists in the schema — which slightly muddies an otherwise strong disclosure. With readOnlyHint=false and non-idempotent already declared, the mutation framing is consistent, not contradictory.

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 and dense with useful facts, but the middle sentence is a long run-on with nested parentheticals that takes effort to parse. Nearly every clause earns its place; the phrasing could be tightened without losing content.

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?

An output schema exists and the description still summarizes the returns (links, editorship expiry), and it covers the input-source decision, so an agent has what it needs to call correctly. The dangling 'change its html' reference points at a tool or field not identified, leaving one loose end in an otherwise complete definition.

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 the schema already documents data, preview, filename, template and template_id; baseline would be 3. The description adds genuine value on top by stating the mutual exclusivity of template vs. template_id and the 'no data prints the sample' default, which the schema does not say.

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 ('Fills a template with JSON data and prints it to PDF') and immediately scopes it against the sibling render_pdf by naming the template/gallery inputs it accepts. An agent can tell this apart from list_templates or get_template without opening any schema.

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?

Gives explicit routing: use template_id from list_templates, get sample data shape via get_template, and read the 'templates' guide topic via read_guide. It also spells out the two mutually exclusive modes (gallery template vs. own source) and the fallback behavior when data is omitted, so when-to-use is fully determined.

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