Fill a Word template
doc_fill_templateReplace {{placeholders}} in a .docx template and save a new filled file. Get a report of replaced, unfilled, or ignored placeholders, or list placeholders by calling with no values.
Instructions
Call this tool to replace {{placeholders}} in an existing .docx and write a new file. Returns the new path and which placeholders were replaced, unfilled or ignored. Call with no values to list a template's placeholders.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | No | Placeholder name to value, e.g. {client: "Acme", fee: "EUR 4,500.00"} | |
| out_path | No | Where to write the filled .docx. Defaults to <template>-filled.docx | |
| overwrite | No | Replace out_path if a file is already there. Default false: an existing file is never overwritten | |
| template_path | Yes | Path to the .docx template containing {{placeholders}}. Every style, table, header, footer and image of the original is kept. Placeholders split across runs by Word's editor are handled, because the substitution runs on the joined text of each paragraph |