OpenapiVisor
List agent
Returns the agent binding of one of the caller org's machines, or 404 when the machine runs no bot runtime.
GET /v1/visor/machines/{id}/agent
| Address | https://api.hanzo.ai/v1/visor/machines/{id}/agent |
| Method | GET |
| Operation | getMachineAgent |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns the agent binding of one of the caller org's machines, or 404 when the machine runs no bot runtime.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the machine's org-scoped NAME — the stable key Visor addresses a machine by (owner/name), not the ephemeral provider id. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | agentBinding | ok |
200 body — 12 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
agentName | body | string | — | AgentName is the cloud Agent (/v1/agents) this machine runs — the agent a message to the bot is actually run against. |
botVersion | body | string | — | BotVersion pins the @hanzo/bot runtime version the machine runs. |
createdTime | body | string | — | CreatedTime is when the binding was first made. |
machineId | body | string | — | MachineId is the bound machine as vm addresses it, owner-qualified ("<org>/<machine>"). |
message | body | string | — | Message is vm's human-readable detail on Status ("machine provisioning; @hanzo/bot runtime not yet confirmed") — the reason behind the state, not a second… |
name | body | string | — | Name is the binding's own key, which is the machine's id: a machine hosts at most one agent, so the binding is named for it. |
org | body | string | — | Org is the Hanzo tenant the binding belongs to. |
owner | body | string | — | Owner is the tenant vm filed the binding under, resolved from the ?owner it was called with — which is the caller's validated org and never a body field. |
provider | body | string | — | Provider is the cloud the bound machine runs on, carried here so a bindings list says where each bot lives without a second read per machine. |
publicIp | body | string | — | PublicIp is the bound machine's public address as vm recorded it on the binding. |
status | body | string | — | Status is the binding's lifecycle in VM's OWN words — "Pending" while the machine provisions and the runtime is unconfirmed, "running" once vm has confirmed… |
updatedTime | body | string | — | UpdatedTime is when vm last reconciled it — the age of Status. |
Failure carries the platform error shape — see Errors.
Examples
hanzo visor machines agent get <id>import { Configuration, VisorApi } from 'hanzoai';
const api = new VisorApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMachineAgent({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import VisorApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = VisorApi(client).get_machine_agent(id='id')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.VisorAPI.GetMachineAgent(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, visor_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = visor_api::get_machine_agent(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.VisorApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new VisorApi(client).getMachineAgent();curl https://api.hanzo.ai/v1/visor/machines/<id>/agent \
-H "Authorization: Bearer $HANZO_API_KEY"Tool visor, op getMachineAgent — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "visor",
"arguments": {
"op": "getMachineAgent",
"input": {
"id": "<id>"
}
}
}
}'How is this guide?