Agents and MCP
flexpool's Model Context Protocol endpoint: sixteen read-only tools, declared in the API description, that answer the desk's questions and never trade, offer or control a device.
An AI assistant can answer an operator's questions about flexpool, such as "which batteries are offline?", "why does pool Nord sell at 19:00?" or "what did the grid operator settle yesterday?", through the Model Context Protocol. flexpoold serves it at POST /mcp (Streamable HTTP, protocol 2025-06-18), behind the same authentication as the REST API.
The tools are declared, not written🔗
Every tool is an operation in the API description that declares an x-mcp extension with its name and autonomy level:
"/api/v1/flex/offers": {
"get": {
"summary": "Offers, drafted and sent, with their split across the batteries.",
"x-mcp": { "tool": "list_flex_offers", "level": "read" }
}
}An operation without x-mcp is not exposed at all. A call runs the REST operation through flexpoold's own router, so a tool answers exactly what the endpoint answers. There is no second implementation that could drift.
| Area | Tools |
|---|---|
| Portfolio | get_portfolio, list_assets, get_asset, get_live_totals |
| Alarms | list_alarms, get_handover |
| Plan | get_day_ahead_plan, explain_plan_step, get_price_forecast |
| Book | get_book, get_delivery |
| Flexibility market | list_flex_requests, list_flex_offers, list_flex_orders, list_flex_settlements |
| Data protection | list_erasures |
Read, never act🔗
Every tool is read and carries readOnlyHint: true. The levels follow the Open Utility Stack's autonomy rules:
- Decisions stay with people. Releasing day-ahead orders, sending a flexibility offer, halting and resuming trading move money or commit a price. They have no tool.
- No agent on the control path. Plans, orders, offers, limits and settlements are computed by deterministic code. An agent may read and explain them; it never produces one.
- The runtime enforces it. flexpoold exposes
readoperations only, and an operation that declares any other level is left out. A wrong annotation cannot widen what an agent may do.
Tool answers are data, not instructions; the descriptions tell the client so.
Try it🔗
curl -s localhost:8080/mcp -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
curl -s localhost:8080/mcp -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_asset","arguments":{"id":"bess-kiel-1"}}}'To connect a client, point it at http://127.0.0.1:8080/mcp. From another host, give it a bearer token (flexpool token new).