MADATA / DEV developer docs Français madata.africa

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.

URIContent
mia://conversationsThe user's last 20 conversations with Mia.
mia://memoriesDurable memorized facts (preferences, business rules).
mia://kpi/currentKey indicators of the workspace (sales, purchases, stock, cash).
mia://audit/recentThe last 50 Mia actions (read + write, MCP + UI).
jsonresources/read
{"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).

NameRoleArguments
analyse_mensuelleMonthly financial analysis: revenue, costs, result.mois (YYYY-MM)
audit_comptableConsistency audit: anomalies, abnormal balances, VAT.none
relance_impayesUnpaid invoices + dunning preparation.jours (default 30)
bilan_fabricationProduction: MOs in progress, to launch, done.periode: today|week|month
kpi_crmPipeline, win rate, opportunities to follow up.periode: month|quarter|year
projection_tresorerieCash over 4 weeks, inflows / outflows.semaines (1-12)
rapport_paiePayroll summary: total paid, contributions, anomalies.mois (YYYY-MM)
bilan_stockShortages, 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.

Real call path

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:

bashfetch an export
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.