The platform supports the A2A (Agent-to-Agent) protocol built on JSON-RPC 2.0. External agents can submit tasks, receive results in real time and interact with the system's specialised agents.
Architecture
Every request is handled by the Orchestrator β the top-level agent that analyses the task and delegates it to a specialised one:
| Agent | Specialisation |
|---|---|
| Orchestrator | Task analysis, routing, result validation |
| Finance | Invoices, payments, expenses, refunds, financial reports |
| Support | System diagnostics, configuration, tasks and projects |
| Customer | Contacts, calls, SMS, email, communication history |
Each agent works on the platform's real data through MCP tools.
Authentication
Every request needs an API token in the Authorization header. Create one in Settings β Connected Apps β API Tokens.
Authorization: Bearer sk_ws_<wsid>_<token>
Quick start
1. Fetch the Agent Card
curl https://stage.kompot.ai/.well-known/agent.json
Returns the agent description, its supported capabilities and skills.
2. Submit a task
curl -X POST https://stage.kompot.ai/api/ws/pasv/a2a \
-H "Authorization: Bearer sk_ws_pasv_..." \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "1",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "Build an income statement for 2025"
}
]
}
}
}'
Response:
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"id": "task-uuid",
"status": "working",
"messages": [...]
}
}
3. Retrieve the result
curl -X POST https://stage.kompot.ai/api/ws/pasv/a2a \
-H "Authorization: Bearer sk_ws_pasv_..." \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "2",
"method": "tasks/get",
"params": {
"id": "task-uuid"
}
}'
Response once the task is finished:
{
"jsonrpc": "2.0",
"id": "2",
"result": {
"id": "task-uuid",
"status": "completed",
"messages": [
{ "role": "user", "parts": [{ "kind": "text", "text": "..." }] },
{ "role": "agent", "parts": [{ "kind": "text", "text": "## Income Statement..." }] }
],
"agentsUsed": ["orchestrator", "finance"]
}
}
Methods
message/send
Submits a task to the agent. Execution is asynchronous β the method returns the task with status working, and the result is fetched with tasks/get.
message/stream
Submits a task and streams progress in real time over SSE. The response is text/event-stream carrying these events:
| Event | Description |
|---|---|
status | Agent status: analysing, delegating, validating |
chunk | A fragment of the text answer |
tool_call | A tool invocation (name, arguments) |
tool_result | The tool's result |
done | Final result with the complete answer |
error | Execution error |
Example:
curl -N -X POST https://stage.kompot.ai/api/ws/pasv/a2a \
-H "Authorization: Bearer sk_ws_pasv_..." \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "1",
"method": "message/stream",
"params": {
"message": {
"role": "user",
"parts": [{ "kind": "text", "text": "Show me every unpaid invoice" }]
}
}
}'
tasks/get
Fetches the status and result of a task by its ID.
Task statuses:
| Status | Description |
|---|---|
submitted | The task has been accepted |
working | The agent is working on it |
completed | The result is ready |
failed | Execution failed |
Connecting through Claude Code
The platform is also available as an MCP server. Claude Code can use the ask_agent tool to talk to the agents directly over an existing MCP connection.
MCP configuration in .mcp.json:
{
"mcpServers": {
"kompot": {
"type": "http",
"url": "https://stage.kompot.ai/api/ws/pasv/mcp/stream",
"headers": {
"Authorization": "Bearer sk_ws_pasv_..."
}
}
}
}
Example tasks
| Task | Agent |
|---|---|
| Build an income statement for the quarter | Finance |
| Find every overdue invoice | Finance |
| Check the sales pipeline configuration | Support |
| Show all open tasks on a project | Support |
| Find contacts we spoke to this week | Customer |
| Look up a customer's call history | Customer |