Skip to main content
Glama

All AI LLC API: documents and calculators

Fill your own template (PDF or Word)

fill_template
Read-onlyIdempotent

Fills {{placeholders}} in your own template with JSON data and returns a finished document. Templates: Markdown, plain text or HTML (up to 50 KB; headings, paragraphs, lists and | tables | are kept; HTML is reduced to text, scripts and remote images are dropped and nothing is fetched) rendered to PDF and/or Word, or a Word .docx file (base64, up to 1 MB) whose placeholders are replaced and returned as .docx. Nested keys use dots, e.g. {{client.name}}. Missing keys are listed; set strict to fail (free) instead. 20 credits ($0.02) per successful document. PAID: 20 credits ($0.02) per successful call from one-time prepaid credits; send Authorization: Bearer <api_key>. Failed or empty calls are free. Keyless callers get 3 free trial calls per day.

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": {
      "data": "<data>"
    },
    "name": "fill_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesValues for the placeholders (JSON, up to 20 KB).
titleNo
formatNoOutput files (default both).
strictNoFail (not charged) when any placeholder has no value.
api_keyNoOptional. Only for clients that cannot send an Authorization header.
templateNoMarkdown, text or HTML template with {{placeholders}}. For a Word template use template_format docx with docx_base64. PDF files are not accepted as templates (output can be PDF).
docx_base64NoA Word .docx template with {{placeholders}}, base64-encoded (up to about 1 MB). Not a PDF.
organizationNo
template_formatNoDefault markdown. Use docx with docx_base64.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well past the annotations (readOnly, idempotent, closed-world) with billing terms (20 credits/$0.02 only on success, failures and empty calls free), auth mechanics (Bearer header, api_key fallback, 3 keyless trial calls/day), error semantics (missing keys listed unless `strict` fails free), and sanitization behavior (HTML reduced to text, scripts and remote images dropped, nothing fetched). That sanitization note also positively reinforces openWorldHint=false rather than contradicting it.

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

Conciseness4/5

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

Purpose is front-loaded and every clause carries real information, but the middle section is a dense run-on of parentheticals (size limits, rendering rules, sanitization) that is harder to scan than it needs to be. No filler sentences, just cramped packaging.

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

Completeness5/5

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

For a 9-parameter, multi-input tool with no output schema, the description covers what comes back (PDF and/or Word, or a .docx), how each input path maps to output, cost, auth, size ceilings, and failure behavior. An agent has enough to choose the right input path and predict charges without further lookup.

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?

With 78% schema coverage the baseline is 3, and the description earns an extra point by documenting the dotted nested-key syntax ({{client.name}}) that the schema does not explain, plus the interaction between `strict` and the free-failure policy. Limits it repeats from the schema (50 KB, 1 MB, 20 KB data) add little, and `organization`, `title`, and the `both` format value get no extra meaning.

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?

Opens with a specific verb and resource: 'Fills {{placeholders}} in your own template with JSON data and returns a finished document.' The 'your own template' framing implicitly separates it from the sibling generate_* / invoice_quote_pdf tools that ship predefined templates, but it never names or contrasts an alternative explicitly.

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?

Gives concrete routing rules between input paths: Markdown/text/HTML templates go in `template` and render to PDF/Word, while a Word source requires `template_format: docx` with `docx_base64`. It also states a clear exclusion ('PDF files are not accepted as templates'), though it offers no guidance on when to pick this over a sibling document generator.

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.