render_document_template
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
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Template key, alternative to template_id | |
| save | No | Store the result as a document (default true); false only returns it | |
| title | No | Title of the stored result document | |
| variables | No | Values for the template placeholders, as an object (arrays for each blocks) | |
| template_id | No | ID of the template |