Resources, prompts & OpenAPI
Beyond the tools, the server exposes read-only resources, ready-to-use prompts, and a discovery OpenAPI spec.
01Resources (resources/*)
Read directly, no tool call. resources/list then
resources/read with the uri.
| URI | Content |
|---|---|
mia://conversations | The user's last 20 conversations with Mia. |
mia://memories | Durable memorized facts (preferences, business rules). |
mia://kpi/current | Key indicators of the workspace (sales, purchases, stock, cash). |
mia://audit/recent | The last 50 Mia actions (read + write, MCP + UI). |
{"jsonrpc":"2.0","id":3,"method":"resources/read",
"params":{"uri":"mia://kpi/current"}}
{"jsonrpc":"2.0","id":3,"result":{
"contents":[{"uri":"mia://kpi/current","mimeType":"application/json","text":"{…}"}]
}}
02Prompts (prompts/*)
Conversation templates exposed to clients that render them (Claude
Desktop, etc.). prompts/get interpolates the arguments given.
Argument names are in French (the API contract).
| Name | Role | Arguments |
|---|---|---|
analyse_mensuelle | Monthly financial analysis: revenue, costs, result. | mois (YYYY-MM) |
audit_comptable | Consistency audit: anomalies, abnormal balances, VAT. | none |
relance_impayes | Unpaid invoices + dunning preparation. | jours (default 30) |
bilan_fabrication | Production: MOs in progress, to launch, done. | periode: today|week|month |
kpi_crm | Pipeline, win rate, opportunities to follow up. | periode: month|quarter|year |
projection_tresorerie | Cash over 4 weeks, inflows / outflows. | semaines (1-12) |
rapport_paie | Payroll summary: total paid, contributions, anomalies. | mois (YYYY-MM) |
bilan_stock | Shortages, valuation, recent movements. | none |
03OpenAPI spec (openapi.json)
GET /mia/mcp/openapi.json returns an OpenAPI 3.0 spec built
dynamically from the tool catalog. It is used to configure a
ChatGPT Action.
The spec describes
/mia/mcp/tools/<name> paths: they have no dedicated
handler. The real call always goes to the JSON-RPC endpoint
/mia/mcp via tools/call. Modern MCP clients
(ChatGPT included) connect there natively.
04Downloading files
Tools that generate a file (export_accounting,
generate_report, generate_accounting_report…)
return an attachment. Fetch it with the same Bearer key:
curl -s https://<workspace>.madata.app/mia/mcp/download/<attachment_id> \ -H "Authorization: Bearer mia_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -o export.xlsx
Only attachments tied to a Mia conversation are served; others return
403.
05Logging
Every tools/call is logged: workspace, user, tool name,
success or failure, error kind. If a tool behaves unexpectedly, this log
helps support diagnose.