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. A custom key only reads mia://memories and mia://kpi/current if recall or get_kpi is on its list, and cannot read the other two.

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, on the workspace address. It is used to configure a custom GPT Action. For ChatGPT, prefer the custom MCP server.

Each tool is described there by the REST route POST /mia/mcp/tools/<name>: the body is the arguments object, the response is the tool's JSON result. Same safeguards as tools/call: Bearer key, scope, real permissions, rate limit and log.

bashREST call of a tool
curl -s https://<workspace>.madata.app/mia/mcp/tools/get_kpi \
  -H "Authorization: Bearer mia_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"period":"month"}'

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 files prepared by Mia are served (attached to a conversation, or stored in Documents › My files › Mia), and only while the user can read them; others return 403. A custom key must also have a tool that produces files.

05Logging

Every tools/call is logged, even when refused before reaching the tool: workspace, user, tool, success or failure, error kind, duration, size and number of results, read or write, key and effective scope, protocol version. Arguments are only kept for a failed call, with secrets masked and capped at 2 KB. The workspace owner finds the activity in the portal, Mia page, MCP tab.