Skip to main content
Glama

API Keg — Office OOXML Template Merge & Markdown Extractor

Merge .docx or .pptx Office Template

merge_office_template
Read-onlyIdempotent

Coalesces split {{variable}} runs across Word (<w:r>) and PowerPoint (<a:r>) paragraphs while preserving opening-run typography, expands {{#loop}}...{{/loop}} table rows, replaces variables across body/headers/footers/slides, and returns a valid PKZIP Base64 document plus any unmatchedPlaceholders. Pricing: $0.004 USD per Office template merge (.docx or .pptx) (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.

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": {
      "fileBase64": "<fileBase64>"
    },
    "name": "merge_office_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNoTemplate format ('auto' inspects internal OOXML ZIP entries).auto
variablesNoKey-value map for {{placeholder}} variables across body, headers, footers, and slides. Multi-line '\n' values expand to <w:br/> / <a:br/>.
fileBase64YesBase64-encoded .docx or .pptx OOXML template file (accepts raw Base64 or data:...;base64, URI).
tableLoopsNoRepeating table row arrays keyed by loop name (matching {{#items}}...{{/items}} inside a Word or PowerPoint table row).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so safety is covered. The description adds useful behavioral detail beyond annotations: preserving opening-run typography, returning a valid PKZIP Base64 document, reporting unmatchedPlaceholders, and disclosing per-merge pricing via x402 micropayment.

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?

The description is dense but front-loaded with the core merge behavior, then adds pricing and dry-run validation in a compact second sentence. Every clause carries useful information, though the first sentence is long and could be split for readability.

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 template-merging tool with a fully documented schema and no output schema, the description covers the key transformations, output form, unmatched placeholders, and pricing. It stops short of detailing error behavior or response structure beyond Base64 plus unmatchedPlaceholders, but is otherwise complete enough to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents all four parameters in detail. The description reinforces placeholder, loop, and cross-section replacement semantics, but adds little syntactic or format guidance beyond what the schema provides.

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 uses specific verbs and resources: coalescing split variable runs across Word and PowerPoint paragraphs, expanding loop table rows, and replacing variables across body, headers, footers, and slides. It clearly distinguishes this merge/template-fill operation from a simple extraction-style sibling.

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 gives clear context for merging Office templates and adds practical guidance to pass ?dry_run=true on REST to validate schema for free. It does not explicitly compare against extract_office_markdown, but the use case is evident from the described transformations.

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