Skip to main content
Glama

Fill a Word template

doc_fill_template

Replace {{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

TableJSON Schema
NameRequiredDescriptionDefault
valuesNoPlaceholder name to value, e.g. {client: "Acme", fee: "EUR 4,500.00"}
out_pathNoWhere to write the filled .docx. Defaults to <template>-filled.docx
overwriteNoReplace out_path if a file is already there. Default false: an existing file is never overwritten
template_pathYesPath 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.20.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden, and it discloses the key behaviors: writing a new file, returning the new path, and reporting replaced, unfilled, and ignored placeholders. It also adds the non-obvious behavior that calling with no values lists placeholders instead of filling. It could state explicitly that the original template is never modified, but 'write a new file' plus the schema's out_path default make this reasonably clear.

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

Conciseness5/5

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

The description is two sentences with the primary action front-loaded. It includes only essential information: the operation, the return value, and the alternate listing mode. No filler or duplication of schema details.

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 annotations and no output schema, the description still covers the main call, the return payload, and the no-values listing mode. It relies on the schema for overwrite and out_path details, which is acceptable, and it could add a brief note that the original template itself is not modified, but overall it is complete enough for an agent to select and invoke the tool correctly.

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 is 3, but the description adds meaningful value by explaining that omitting values triggers placeholder listing. This clarifies that values is optional and that an empty/absent values object has a distinct, useful behavior. The ignored-status language also helps the agent interpret values that do not match any placeholder.

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 description explicitly states the action: replace {{placeholders}} in an existing .docx and write a new file. It also distinguishes the tool from document creation/reading siblings like doc_create, doc_read, and cover_letter_create by focusing on template filling.

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?

The phrase 'Call this tool to replace {{placeholders}}' clearly establishes the primary use case, and the no-values listing mode provides a secondary use. It does not explicitly name sibling alternatives or when-not-to-use conditions, but the intended context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools