a2a_agent_info
Retrieve details about connected A2A agents, including their status and capabilities, to monitor and manage agent interactions within the protocol.
Instructions
Get information about the connected A2A agents
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agentId | No | Optional agent ID. If not provided, information for all agents will be returned |
Implementation Reference
- index.ts:117-129 (registration)Registration of the 'a2a_agent_info' tool in the ListTools response, including name, description, and input schema.{ name: "a2a_agent_info", description: "Get information about the connected A2A agents", inputSchema: { type: "object", properties: { agentId: { type: "string", description: "Optional agent ID. If not provided, information for all agents will be returned", }, }, }, },
- index.ts:246-282 (handler)The handler logic for the 'a2a_agent_info' tool within the CallToolRequestSchema switch statement. It fetches and returns agent card information for a specific agent or all connected agents via agentManager clients.case "a2a_agent_info": { const { agentId } = args as { agentId?: string }; if (agentId) { const client = agentManager.getClientById(agentId); if (!client) { throw new Error(`No agent found with ID ${agentId}`); } const card = await client.agentCard(); return { content: [ { type: "text", text: JSON.stringify(card, null, 2), }, ], }; } else { const results = []; for (const [id, client] of agentManager.getAllClients()) { try { const card = await client.agentCard(); results.push({ agentId: id, card }); } catch (error) { results.push({ agentId: id, error: error instanceof Error ? error.message : String(error) }); } } return { content: [ { type: "text", text: JSON.stringify(results, null, 2), }, ], }; } }