Skip to main content
Glama

mail_merge

Generate a filled .docx for each data row from a template, using CSV, JSON, or a list. Saves personalized documents to an output directory, preventing overwrites and reporting missing values.

Instructions

Mail merge: one filled .docx per data row, saved into output_dir. data_rows: a list of dicts, or a path to a .csv (header = placeholder names) or .json (array of objects). filename_pattern supports {row_index} (1-based) and any {column}. Refuses BEFORE writing anything on existing-file collisions, duplicate output names, or (missing='error') rows lacking values the template needs. The template is never modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
missingNoerror
data_rowsYes
output_dirYes
template_pathYes
filename_patternNo{row_index}.docx

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It goes beyond the basics by revealing that the tool refuses before writing anything on collisions, duplicate names, or missing required values, and that the template is never modified. These are meaningful safety guarantees.

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 compact, well-organized, and front-loaded with the core behavior. Every sentence adds value, covering input formats, filename syntax, failure handling, and template safety without redundancy.

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?

For a moderately complex tool with no annotations and 0% schema coverage, the description provides enough to select and invoke it correctly: inputs, outputs, filename syntax, and failure modes are covered. Small gaps remain around path semantics, missing parameter options beyond 'error', and output return details, though the presence of an output schema reduces the need for the last.

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 description coverage is 0%, so the description must explain parameters. It does well for data_rows and filename_pattern, including supported input formats and placeholder syntax. However, template_path and output_dir are only implied by context, and the missing parameter's full value set is not explained beyond the default error case.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific operation: generate one filled .docx per data row into output_dir. It clearly communicates the core resource and output, but it does not explicitly compare itself to siblings like fill_template or batch_apply, so differentiation is implicit rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives useful parameter-level guidance for data_rows and filename_pattern, but it provides no explicit guidance about when to choose mail_merge over alternatives such as fill_template or batch_apply. There are no when-to-use or when-not-to-use conditions.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nometalalchemist/KitchenSink4Word'

If you have feedback or need assistance with the MCP directory API, please join our Discord server