fill_template
Fill template placeholders with data to generate documents. Handles loops and conditions, writes a new output file, and leaves the original template unchanged.
Instructions
Fill {{key}} placeholders in a template document with data, expanding {{#each list}} loops and {{#if}}/{{#unless}} conditions. Writes a NEW file to output_path (default: _filled.); the input template is left unchanged. Run validate_template first to catch missing keys early.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Key-value data to fill placeholders. Supports nested objects. | |
| options | No | Tool options. | |
| output_path | No | Output file path. | |
| template_path | Yes | Path to the template document containing placeholders. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||