A2A Protocol
Google Agent-to-Agent Protocol support. Task-based execution with SSE streaming, state history, and automatic skill routing.
Agent Card
The Agent Card is served at the standard A2A discovery endpoint. Any A2A-compatible orchestrator can discover MERX capabilities automatically.
curl https://merx.exchange/.well-known/agent.jsonSkills
| Skill | Description | Auth |
|---|---|---|
| buy_energy | Purchase delegated energy from aggregated market | API key |
| get_prices | Current energy prices from all providers | None |
| analyze_prices | Market analysis with trends and recommendations | None |
| check_balance | Account balance and on-chain resources | Optional |
| ensure_resources | Declarative resource provisioning | API key |
| create_standing_order | Server-side automation rules | API key |
Create a Task
Send a task with a DataPart containing an action field, or a TextPart with natural language. The task processor routes to the appropriate skill.
curl -X POST https://merx.exchange/a2a/tasks/send \
-H "Content-Type: application/json" \
-H "X-API-Key: sk_live_..." \
-d '{
"id": "task-001",
"message": {
"role": "user",
"parts": [{
"type": "data",
"data": { "action": "get_prices" }
}]
}
}'Poll Result
curl https://merx.exchange/a2a/tasks/task-001SSE Streaming
Subscribe to real-time task state transitions via Server-Sent Events.
curl -N https://merx.exchange/a2a/tasks/task-001/eventsAuthentication
Pass your API key via the X-API-Key header. Read-only skills (get_prices, analyze_prices, check_balance) work without authentication. Write skills (buy_energy, ensure_resources, create_standing_order) require a key.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /.well-known/agent.json | Agent Card discovery |
| POST | /a2a/tasks/send | Create and start task |
| GET | /a2a/tasks/:id | Get task status and result |
| GET | /a2a/tasks/:id/events | SSE stream of task events |
| POST | /a2a/tasks/:id/cancel | Cancel a running task |