list_agents
Discover available AI agents and check their current status for collaboration and task execution within the system.
Instructions
List all known agents and their availability on this system.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/list-agents.ts:10-25 (handler)The handler function for the list_agents tool, which calls listAgents() and formats the response.
async () => { const agents = listAgents(); return { content: [ { type: 'text' as const, text: JSON.stringify({ agents, total: agents.length, available: agents.filter((a) => a.available).length, }), }, ], }; } - src/tools/list-agents.ts:4-27 (registration)Registration of the list_agents tool with the McpServer.
export function registerListAgents(server: McpServer): void { server.tool( 'list_agents', 'List all known agents and their availability on this system.', {}, { readOnlyHint: true, destructiveHint: false }, async () => { const agents = listAgents(); return { content: [ { type: 'text' as const, text: JSON.stringify({ agents, total: agents.length, available: agents.filter((a) => a.available).length, }), }, ], }; } ); } - src/agent-registry.ts:137-150 (helper)The helper function that performs the logic to list and check availability of agents.
export function listAgents(): AgentInfo[] { const profiles = loadConfig(); const builtInNames = new Set(Object.keys(BUILT_IN_PROFILES)); return Object.entries(profiles).map(([name, profile]) => { const source: 'auto' | 'config' = builtInNames.has(name) ? 'auto' : 'config'; return { name, command: profile.command, source, available: isCommandAvailable(profile.command), }; }); }