AI agents are great at gathering data, summarizing it, and deciding what matters — but they have always been terrible at the last mile: handing you a file you can actually open. Raw text dumps don't cut it when a stakeholder wants a spreadsheet they can filter or a report they can email to a client. That's the gap the Agent Media Tools document generators close.
Two POST endpoints turn plain JSON into real, openable Office files:
POST /api/generate-xlsx — build a real Excel workbook (single or multi-sheet) from rows or arrays of objects.POST /api/generate-docx — build a Word document from a title, markdown-ish body, structured paragraphs, and an optional table.Both are free on the daily free tier, both return a download URL you can fetch immediately, and both are exposed as MCP tools (generate_xlsx and generate_docx) so Claude, Cline, or any MCP host can call them without writing a single HTTP request by hand. No SDK to install, no client library, no OAuth dance — just JSON in, file out.
The simplest form passes rows, optional headers, and a sheet_name:
curl -s https://agentmediatools.com/api/generate-xlsx \
-H "Content-Type: application/json" \
-d '{
"sheet_name": "Sales",
"headers": ["Region", "Revenue", "Units"],
"rows": [
["North", 42000, 310],
["South", 38500, 289],
["East", 51000, 402],
["West", 46750, 355]
]
}' | jq .
The response looks like this:
{
"success": true,
"filename": "3f2c9a1e-....xlsx",
"downloadUrl": "/downloads/3f2c9a1e-....xlsx",
"size": 5218,
"sheets": 1
}
The header row is written bold, and column widths are auto-sized based on content. To download the workbook, GET the downloadUrl from the same host:
curl -sO https://agentmediatools.com/downloads/3f2c9a1e-....xlsx
If you omit headers and pass an array of objects instead, the API derives the header row from the object keys — which is the fastest way to turn a JSON API response into a spreadsheet:
curl -s https://agentmediatools.com/api/generate-xlsx \
-H "Content-Type: application/json" \
-d '{
"sheet_name": "Users",
"rows": [
{"id": 1, "name": "Ada", "plan": "pro"},
{"id": 2, "name": "Grace", "plan": "free"},
{"id": 3, "name": "Alan", "plan": "builder"}
]
}' | jq .downloadUrl
Real reports rarely fit in one tab. Pass a sheets array and the API builds a workbook with up to 20 sheets in a single request:
curl -s https://agentmediatools.com/api/generate-xlsx \
-H "Content-Type: application/json" \
-d '{
"sheets": [
{"name": "Summary", "rows": [["Total Revenue", 178250], ["Total Units", 1356]]},
{"name": "By Region", "headers": ["Region", "Revenue"], "rows": [["North", 42000], ["South", 38500], ["East", 51000], ["West", 46750]]},
{"name": "By Product", "headers": ["Product", "Units"], "rows": [["Widget", 812], ["Gadget", 544]]}
]
}' | jq .
The response reports the total sheet count ("sheets": 3) alongside the download URL. One HTTP call, one workbook, zero spreadsheet libraries in your stack.
For scheduled reports and data pipelines, Python's requests library is all you need:
import requests
resp = requests.post("https://agentmediatools.com/api/generate-xlsx", json={
"sheet_name": "Uptime",
"rows": [
{"date": "2026-07-01", "uptime": 99.98},
{"date": "2026-07-02", "uptime": 99.95},
{"date": "2026-07-03", "uptime": 100.0},
],
})
data = resp.json()
assert data["success"], data
# Download the workbook
wb = requests.get(f"https://agentmediatools.com{data['downloadUrl']}")
with open(data["filename"], "wb") as f:
f.write(wb.content)
print(f"Saved {data['filename']} ({data['size']} bytes)")
That's the whole integration. If your script already produces a list of dicts — from a database query, a CSV parse, or another API — you can POST it directly with no transformation step.
The DOCX endpoint accepts a title plus your content in one of two forms: a markdown string (or its alias content) with #, ##, ### headings and - bullets, or a structured paragraphs array. Markdown keeps the curl call compact:
curl -s https://agentmediatools.com/api/generate-docx \
-H "Content-Type: application/json" \
-d '{
"title": "Weekly Ops Summary",
"markdown": "# Highlights\n\n- Deploys: 14, all green\n- Incidents: 1 (resolved in 22 min)\n- New signups: 1,204\n\n## Next Week\n\nFreeze window Tuesday, on-call rotation shifts to North team."
}' | jq .
The API renders # lines as Heading 1, ## as Heading 2, and bullet lines as list paragraphs. The response mirrors the XLSX shape:
{
"success": true,
"filename": "b7e04d92-....docx",
"downloadUrl": "/downloads/b7e04d92-....docx",
"size": 8410,
"title": "Weekly Ops Summary"
}
For programmatic control, use the paragraphs array, where each entry is either a plain string or an object with text, bold, italics, and optional heading/level:
curl -s https://agentmediatools.com/api/generate-docx \
-H "Content-Type: application/json" \
-d '{
"title": "Invoice",
"paragraphs": [
{"text": "Invoice #1042", "heading": true},
{"text": "Client: Acme Corp", "bold": true},
{"text": "Due within 30 days."}
],
"table": [
["Item", "Qty", "Price"],
["API calls", 5000, "0.00"],
["Priority support", 1, "199.00"],
["Total", "", "199.00"]
]
}' | jq .
Tables render with a header row built from the first array, and the API caps them at 100 rows × 12 columns. Combine a markdown body with a table and you have a professional-looking report in one request.
When your agent or script has generated a text summary, wrapping it in a Word document is two lines of Python:
import requests
summary = """# Q3 Review
- Revenue up 12% quarter over quarter
- Retention stable at 94%
- Two new enterprise accounts
## Risks
Supply chain lead time increased from 2 to 3 weeks."""
resp = requests.post("https://agentmediatools.com/api/generate-docx", json={
"title": "Q3 Business Review",
"markdown": summary,
})
data = resp.json()
doc = requests.get(f"https://agentmediatools.com{data['downloadUrl']}")
with open(data["filename"], "wb") as f:
f.write(doc.content)
print(f"Report ready: {data['filename']} ({data['size']} bytes)")
You can also pass content as an alias for markdown — handy when your pipeline uses that field name internally.
Both generators are registered in the MCP server, so any MCP-capable host — Claude Desktop, Cline, GoMCP, or your own agent — can produce Office files as part of a tool call. An agent that just finished summarizing a dataset can immediately hand you a workbook:
{
"name": "generate_xlsx",
"arguments": {
"sheet_name": "Tickets",
"rows": [
{"priority": "high", "count": 12},
{"priority": "medium", "count": 41},
{"priority": "low", "count": 87}
]
}
}
The MCP tool returns the exact same JSON the REST endpoint returns, including downloadUrl — so the agent can fetch the file and present it to you directly. In a longer workflow, one agent can generate a .docx report and pass the URL to a second agent that emails it, with no file handling code anywhere in the chain.
/api/generate-xlsx, and emails the downloaded workbook to stakeholders every Monday.paragraphs array and returns a ready-to-send .docx.SELECT ... ORDER BY into an array of objects, POST it, and let users download a filterable spreadsheet instead of a CSV./downloads/ area and served from the same host. Fetch the downloadUrl promptly if you need to archive the file yourself.mt_ agent key (Authorization: Bearer mt_..., X-API-Key, or ?api_key=) when you want your own daily allowance and usage tracking instead of sharing the anonymous pool.429 with the limit details if you exceed them.Between the chart API for visualizations, the PDF tools for documents that need to be locked down, and these Office generators for editable deliverables, an agent can now produce every file format a human actually opens — using nothing but JSON and HTTP.
Generate XLSX and DOCX right in the browser, or grab an API key and call the same tools from your own scripts and agents.
Open toolbox