Skip to main content
Glama

Mail merge letters from a spreadsheet

mail_merge

Merge recipient data from CSV, TSV, TXT, XLSX, or ODS files into personalized letters, certificates, or notices via templates or {{Field}} placeholders; output DOCX/PDF with one section per record.

Instructions

Personalized letters, certificates or notices from a data file (CSV, TSV, TXT, XLSX, ODS): either a template document that already has merge fields, or a body written here with {{Field}} placeholders (the column names). Writes one merged document with a section per record (docx, and pdf / other formats if asked).

Input Schema

NameRequiredDescriptionDefault
bodyNoParagraphs of the letter when there is no template, e.g. ["Dear {{Name}},", "Your order {{Order}} ships on {{Date}}."].
nameNomerged
scaleNopng only: pixels per point (default 2 ≈ 144 dpi).
markupNoPrint Markup: tracked changes marked up and comments beside each page (pdf / png), a comment list (html / md / txt).
formatsNoOutputs: docx (Word, editable), pdf, odt (OpenDocument), rtf, html, md (Markdown), tex (LaTeX), txt, json (WordCraft document model) and png (one image per page: <name>_p1.png...).
headingNoOptional heading above the body (may use {{Field}} too).
passwordNodocx only: encrypt the saved document with this password.
data_pathYesAbsolute path of the recipient list (first row = column names).
overwriteNoReplace existing outputs.
to_recordNo
output_dirNoAbsolute output folder (default: next to the input; required for new documents).
from_recordNo
output_pathNoAbsolute output file for the first format (its extension must match).
export_pagesNopng only: pages to render, 1-based: "1-3,5" (default all).
template_pathNoAbsolute .docx with merge fields (e.g. made in Word or by a previous run).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=false, so the safety profile is covered. The description usefully adds that it writes one merged document with a section per record and defaults to docx, but says nothing about overwrite/collision behavior, output file naming (the 'name' default of 'merged'), or what happens on re-run for a non-idempotent write tool.

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?

Two dense sentences with zero filler; the input modes come before the output behavior, so the agent learns what it needs first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 15-parameter, non-idempotent file-writing tool with no output schema, the description covers the main path but omits record-range paging, output naming/overwrite semantics, and the template_path-vs-body exclusivity — gaps an agent could get wrong on the first call.

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 80%, so the baseline is 3; the description earns an extra point by adding information the schema lacks, namely the accepted data-file formats (CSV, TSV, TXT, XLSX, ODS) and that {{Field}} placeholders map to column names. It still leaves from_record/to_record, output_path vs output_dir precedence, and template_path/body mutual exclusivity unexplained.

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?

States a specific verb+resource (merge personalized letters/certificates/notices from a data file) and names the two input modes: an existing template with merge fields, or a body with {{Field}} placeholders. The output shape — one merged document with a section per record — distinguishes it behaviorally from create_document/edit_document siblings without needing to name them.

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 'either a template document ... or a body written here' clause gives real mode-selection guidance, and the enumerated data-file formats tell the agent when this tool applies. It stops short of explicit exclusions (e.g., 'use create_document for a single non-personalized document') or prerequisites about record ranges.

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