# Tools Overview (/aiway/mcp/tools)



KubeMQ exposes its messaging operations to AI models as **MCP tools**. A client
discovers them with `tools/list` and invokes them with `tools/call` — there is no
KubeMQ-specific client library involved, just the Model Context Protocol.

## Overview [#overview]

The MCP connector publishes **15 tools** in two families:

* **11 core messaging tools** — always available. They cover queues, events, the
  events store, commands/queries, and channel discovery.
* **4 agent-bridge tools** — available only when the [A2A agent registry](/aiway/a2a)
  is present. They let an MCP client discover and message registered agents,
  bridging MCP to the A2A gateway.

Every tool maps onto a single KubeMQ messaging operation. The model calls the tool
by name with a JSON arguments object; the connector translates it into a native
KubeMQ call over the [Array](/connectors) and returns the result.

## How it works [#how-it-works]

The connector advertises each tool through `tools/list`, then routes each
`tools/call` to the matching KubeMQ operation. Core tools reach the broker
directly; bridge tools forward through the agent registry to an external agent.

<Mermaid
  chart="`
graph TB
AI[&#x22;AI model / MCP client&#x22;]
MCP[&#x22;MCP connector<br/>POST /mcp&#x22;]
CORE[&#x22;Core tools<br/>queues · events · CQRS · channels&#x22;]
BRIDGE[&#x22;Agent-bridge tools<br/>agent_*&#x22;]
BROKER[&#x22;KubeMQ broker&#x22;]
AGENT[&#x22;Registered A2A agent&#x22;]

AI --> MCP
MCP --> CORE
MCP --> BRIDGE
CORE --> BROKER
BRIDGE -.-> AGENT

class AI external
class MCP aiway
class CORE,BRIDGE aiway
class BROKER broker
class AGENT external
`"
/>

*One MCP connector fans out to core messaging tools and, when the registry is present, agent-bridge tools.*

## Core messaging tools [#core-messaging-tools]

These 11 tools are registered unconditionally — start kubemq-server and they are
live at `/mcp`.

| Category           | Tools                                                                                     | Page                                                       |
| ------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| Queues             | `queue_send`, `queue_receive`, `queue_peek`                                               | [Queue tools](/aiway/mcp/tools/queues)                     |
| Events             | `events_publish`, `events_store_publish`, `events_store_read`, `events_store_read_latest` | [Events tools](/aiway/mcp/tools/events)                    |
| Commands & Queries | `command_send`, `query_send`                                                              | [Command & query tools](/aiway/mcp/tools/commands-queries) |
| Channels           | `channel_list`, `channel_info`                                                            | [Channel tools](/aiway/mcp/tools/channel-management)       |

## Agent-bridge tools [#agent-bridge-tools]

These 4 tools appear in `tools/list` **only when the A2A agent registry is
injected** into the MCP connector. They turn an MCP client into an A2A caller:
`agent_send` builds a `message/send` envelope and forwards it over Query to
`_AGENTS_.agents/<agent_id>`, while `agent_query` forwards an arbitrary JSON-RPC
method to the agent.

| Category     | Tools                                                   | Page                                                |
| ------------ | ------------------------------------------------------- | --------------------------------------------------- |
| Agent bridge | `agent_list`, `agent_info`, `agent_send`, `agent_query` | [Agent-bridge tools](/aiway/mcp/tools/agent-bridge) |

<Callout type="info">
  The bridge connects MCP to the [A2A connector](/aiway/a2a). If A2A is not
  running, only the 11 core tools are listed.
</Callout>

## Calling a tool [#calling-a-tool]

Every tool is invoked the same way — a `tools/call` JSON-RPC request naming the
tool and passing its `arguments` object. The skeleton below works for any of the 15
tools; only `name` and `arguments` change.

<Tabs groupId="language" items="['curl']">
  <Tab value="curl">
    ```bash
    curl -X POST http://localhost:9090/mcp \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -d '{
        "jsonrpc": "2.0",
        "id": 2,
        "method": "tools/call",
        "params": {
          "name": "queue_send",
          "arguments": {
            "channel": "example-queue",
            "body": "Hello from MCP"
          }
        }
      }'
    ```
  </Tab>
</Tabs>

<Callout type="info">
  List the available tools and their input schemas first with `tools/list` — see
  [Endpoints](/aiway/mcp/reference/endpoints). The per-tool pages document
  each tool's arguments and provide ready-to-run examples in all nine languages.
</Callout>

## Response shape [#response-shape]

`tools/call` always returns a result with a `content` array. Each entry is a typed
block — KubeMQ uses `text` blocks carrying the operation result as a JSON string.

A successful call:

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{ "type": "text", "text": "Message sent successfully to queue 'example-queue'" }],
    "isError": false
  }
}
```

A failed call sets `isError: true` and carries the error message in the same
`content` block — the JSON-RPC envelope itself still succeeds:

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{ "type": "text", "text": "error: channel name uses reserved prefix '_AGENTS_.'" }],
    "isError": true
  }
}
```

<Callout type="warn">
  `isError` is **not** a protocol failure. A malformed JSON-RPC request (missing
  `name`, bad params) returns a JSON-RPC error instead — see
  [Error handling](/aiway/mcp/guides/error-handling) for the three failure
  layers and [Error codes](/aiway/mcp/reference/error-codes) for the catalog.
</Callout>

## Related [#related]

<Cards>
  <Card title="Queue tools" href="/aiway/mcp/tools/queues" description="queue_send, queue_receive, queue_peek." />

  <Card title="Events tools" href="/aiway/mcp/tools/events" description="events_publish and the events-store read/publish tools." />

  <Card title="Command & query tools" href="/aiway/mcp/tools/commands-queries" description="command_send and query_send request/reply tools." />

  <Card title="Channel tools" href="/aiway/mcp/tools/channel-management" description="channel_list and channel_info discovery tools." />

  <Card title="Agent-bridge tools" href="/aiway/mcp/tools/agent-bridge" description="Discover and message A2A agents from an MCP client." />

  <Card title="Tools reference" href="/aiway/mcp/reference/tools-reference" description="Full catalog: arguments, defaults, and response shapes for all 15 tools." />
</Cards>
