list_agents
Retrieve and filter all AI agents managed by the terminal multiplexer server, enabling monitoring by state, repository, or model.
Instructions
List all agents with optional filters by state, repo, or model.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | Filter by state | |
| repo | No | Filter by repository | |
| model | No | Filter by model |
Implementation Reference
- src/server.ts:817-831 (handler)The handler function for the list_agents tool, which calls engine.listAgents.
async (args) => { try { const agents = engine.listAgents({ state: args.state, repo: args.repo, model: args.model, }); return ok({ agents: agents as unknown as Record<string, unknown>[], count: agents.length, }); } catch (e) { return err(e); } }, - src/server.ts:797-816 (registration)Registration of the list_agents tool including its schema definition.
// 15. list_agents server.tool( "list_agents", "List all agents with optional filters by state, repo, or model.", { state: z .enum([ "creating", "booting", "ready", "working", "idle", "done", "error", ]) .optional() .describe("Filter by state"), repo: z.string().optional().describe("Filter by repository"), model: z.string().optional().describe("Filter by model"), }, - src/agent-engine.ts:535-540 (helper)The implementation of listAgents in the engine, which delegates to the registry.
/** * List agents with optional filters. */ listAgents(filter?: AgentFilter): AgentRecord[] { return this.registry.list(filter); }