# agent_list

The AI agent programs (Claude Code, Codex) installed on the machine that may be prompted, each with its id, how far it may act, and whether it is busy.

**In short:** Risk class [`read`](https://docs.cmdop.ai/reference/tools.md#risk-classes). Over MCP call `agent_list`; over HTTP send `"tool": "agent_list"` to [`POST /api/v1/call`](https://docs.cmdop.ai/reference/http/post-call.md).

## Arguments

Over MCP every tool also takes `machine`: the machine's name or id, optional when only one machine is online.

No other arguments.

## Result

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `agents` | `object[]` | yes | The agents this machine's owner lets be prompted, in catalog order. |
| `default` | `string` | no | The agent a prompt without `agent` goes to; absent when none is installed. |

## Examples

**MCP**

```json
{
  "name": "agent_list",
  "arguments": {
    "machine": "<machine>"
  }
}
```

**HTTP**

```bash
curl -sS -X POST "https://<contour>.cmdop.dev/api/v1/call" \
  -H "Authorization: Bearer $CMDOP_TOKEN" \
  -H "x-cmdop: 1" \
  -H "Content-Type: application/json" \
  -d '{"machine":"<machine>","tool":"agent_list","args":{}}'
```

## Limits

The call times out after 30 s (`timed_out`). Available since version 0.1.13. A refused or failed call returns one of the [error codes](https://docs.cmdop.ai/reference/errors.md).
