Skip to main content
Glama

render_document_template

Destructive

Fill a template: replace variables and inline the named images, then store the result as a document and return its document_id. Required: template_id or key. Optional: variables (object), title, save (default true — pass false to get the result back without storing it). A MISSING value leaves its placeholder visible instead of blanking it: 'Sehr geehrter ,' is noticed after the letter went out, '{{anrede}}' before. The answer always lists what was missing (a field missing inside a list as 'list[].field'). Templates may use exactly three blocks, no expressions or code: {{#each list}}…{{/each}} repeats for each array element (everything printed inside a list is HTML-escaped; values outside lists are inserted as-is) (fields of the element, outer values, {{@nr}} from 1, {{@index}}, {{this}} for plain values, @erste/@letzte); {{#if field}}…{{else}}…{{/if}} and {{#if !field}} (empty = missing, null, '', false, 0, []); {{#if field == "text"}} / != compares with a fixed literal. Use it for list documents (attendance list with signature column, hotel list) and sections chosen by a field value. A broken block is an error with line number. NOTE: this produces the finished HTML, not a PDF — HTML-to-PDF needs an external renderer (see ticket af352879, Browserless); until then the HTML is what the local Chrome step consumes.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "render_document_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyNoTemplate key, alternative to template_id
saveNoStore the result as a document (default true); false only returns it
titleNoTitle of the stored result document
variablesNoValues for the template placeholders, as an object (arrays for each blocks)
template_idNoID of the template

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / key / description
      Added value: +"Template key, alternative to template_id"
    • addedInput schema / properties / save / description
      Added value: +"Store the result as a document (default true); false only returns it"
    • addedInput schema / properties / template_id / description
      Added value: +"ID of the template"
    • addedInput schema / properties / title / description
      Added value: +"Title of the stored result document"
    • addedInput schema / properties / variables / description
      Added value: +"Values for the template placeholders, as an object (arrays for each blocks)"
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=false and destructiveHint=true, yet the description still adds real value: missing values leave the placeholder visible rather than blanking it, the response always lists what was missing ('list[].field'), a broken block errors with a line number, and inside {{#each}} output is HTML-escaped while outside it is inserted as-is. It does not explain the destructiveHint=true side (e.g. what an existing document or stored result is overwritten or deleted), which is the remaining gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose, required/optional parameters, and the PDF caveat are front-loaded, which is right, but the middle is a dense run-on of nested parentheses covering block syntax, and the analogical example ('Sehr geehrter ,' is noticed after the letter went out) costs a sentence for little routing value. Trimming the syntax tutorial would sharpen it, though that detail is genuinely useful when building variables.

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 correctly compensates by naming the return (document_id plus a list of missing fields) and by documenting the three permitted block types, escaping behavior, and error mode with line numbers. Only the destructive/overwrite semantics implied by destructiveHint=true and any auth requirements are left unstated.

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 baseline would be 3, but the description adds meaning the schema omits: it states that template_id or key is required (the schema lists zero required parameters) and that they are alternatives, spells out save's default and false semantics, and explains that variables arrays feed {{#each}} blocks.

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 opening clause gives a specific verb and resource: 'Fill a template: replace variables and inline the named images, then store the result as a document and return its document_id.' It also distinguishes itself from the neighboring PDF path by stating 'this produces the finished HTML, not a PDF', so an agent can tell it apart from render_document_pdf without opening either schema.

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?

'Use it for list documents (attendance list with signature column, hotel list) and sections chosen by a field value' gives concrete when-to-use contexts, and 'pass false to get the result back without storing it' covers a key invocation variant. It never names the opposite condition against sibling renderers (render_invoice, render_offer, render_presentation) explicitly, so guidance is clear but not exhaustive.

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.