Merge .docx or .pptx Office Template
merge_office_templateCoalesces 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
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Template format ('auto' inspects internal OOXML ZIP entries). | auto |
| variables | No | Key-value map for {{placeholder}} variables across body, headers, footers, and slides. Multi-line '\n' values expand to <w:br/> / <a:br/>. | |
| fileBase64 | Yes | Base64-encoded .docx or .pptx OOXML template file (accepts raw Base64 or data:...;base64, URI). | |
| tableLoops | No | Repeating table row arrays keyed by loop name (matching {{#items}}...{{/items}} inside a Word or PowerPoint table row). |