List agent
Returns which agent answers the caller org's channel: the default and every room bound to another agent.
GET /v1/channel/agent
| Address | https://api.hanzo.ai/v1/channel/agent |
| Method | GET |
| Operation | get_channel_agent |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns which agent answers the caller org's channel: the default and every room bound to another agent.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
channel | query | string | — | Channel is the transport: discord, github, linear, slack, teams, telegram or whatsapp. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | channel.channelAgents | ok |
default | problem-details | refused |
200 body — 4 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
channel | body | string | — | Channel is the transport these bindings are for. |
default | body | string | — | Default is the agent that answers any room without a binding of its own; "hanzo" when the org has never set one. |
rooms | body | object | — | Rooms maps a platform room id to the agent that answers there. |
rooms.* | body | string | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo channel agent getimport { Configuration, ChannelApi } from 'hanzoai';
const api = new ChannelApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getChannelAgent();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ChannelApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ChannelApi(client).get_channel_agent()cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.ChannelAPI.GetChannelAgent(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, channel_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = channel_api::get_channel_agent(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ChannelApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new ChannelApi(client).getChannelAgent();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/channel/agent \
-H "Authorization: Bearer $HANZO_API_KEY"MCP reaches channel through the channels tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_channels"
}
}
}'How is this guide?