Skip to main content
Glama

Fill a Word template

documents_fill_template

A new Word file from a .docx template in the store, its {{ placeholders }} filled from data. Templates use Jinja: {{ name }}, {% if paid %}...{% endif %}, and {%tr for row in rows %} to repeat a table row. Turn the result into a PDF with documents_convert_to_pdf. Costs $0.02 per call; nothing if it fails.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_id": "<file_id>",
      "data": "<data>"
    },
    "name": "documents_fill_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesThe values, e.g. {"customer": "Acme", "items": [{"name": "Combi steamer", "price": "€9,800"}]}.
nameNoName for the new file, e.g. "Quote 1042.pdf".
file_idYesA file in the store (files_upload or files_list give its file_id).
link_hoursNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only mark this as a non-read-only mutation. The description adds the Jinja placeholder syntax ({{ name }}, {% if paid %}, {%tr for ... %}), which is critical to construct valid input, plus a concrete cost model ($0.02 per call, nothing on failure) and a link to the conversion path. That is meaningful context beyond the annotations.

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?

Three tight sentences: output/what it does, template syntax, next step and cost. Every part earns its place, and the core action is front-loaded.

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 4-param tool with no output schema and nested data, the description covers the essential behaviors: template source, variable syntax, output conversion, and pricing. The only gaps are the 'link_hours' behavior and the exact return (file_id/link), which a user must infer.

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 75%; the description supplies the most important semantic detail the schema lacks: how the nested 'data' object should be shaped, with concrete placeholder examples. It doesn't explain 'link_hours', but the data-shape guidance covers the highest-value parameter.

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 opens with a specific verb+resource: a new Word file is produced from a .docx template in the store, with placeholders filled from data. That is far more precise than the title ('Fill a Word template') and distinguishes it from siblings like documents_convert_to_pdf or documents_create_pdf, which are named directly as the next step.

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 description tells the agent what input documents this tool needs (a .docx template in the store) and explicitly routes to documents_convert_to_pdf for PDF output. It doesn't explicitly state when not to use it (e.g. non-templated documents, non-Jinja templates), but the usage context is clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources