πŸ€–A2A (Agent-to-Agent)

Connecting external AI agents to the platform over the A2A protocol

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:

AgentSpecialisation
OrchestratorTask analysis, routing, result validation
FinanceInvoices, payments, expenses, refunds, financial reports
SupportSystem diagnostics, configuration, tasks and projects
CustomerContacts, 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:

EventDescription
statusAgent status: analysing, delegating, validating
chunkA fragment of the text answer
tool_callA tool invocation (name, arguments)
tool_resultThe tool's result
doneFinal result with the complete answer
errorExecution 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:

StatusDescription
submittedThe task has been accepted
workingThe agent is working on it
completedThe result is ready
failedExecution 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

TaskAgent
Build an income statement for the quarterFinance
Find every overdue invoiceFinance
Check the sales pipeline configurationSupport
Show all open tasks on a projectSupport
Find contacts we spoke to this weekCustomer
Look up a customer's call historyCustomer