list_agents
Discover and retrieve all registered A2A protocol agents to enable communication and management through the MCP server bridge.
Instructions
List all registered A2A agents.
Returns: List of registered agents
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- a2a_mcp_server.py:350-358 (handler)The handler function decorated with @mcp.tool(), which registers and implements the list_agents tool. It simply returns a list of model_dump() of all registered agents from the global registered_agents dictionary.@mcp.tool() async def list_agents() -> List[Dict[str, Any]]: """ List all registered A2A agents. Returns: List of registered agents """ return [agent.model_dump() for agent in registered_agents.values()]
- a2a_mcp_server.py:74-75 (helper)Global dictionary that stores the registered agents, which is used by the list_agents tool to return the list.registered_agents = {} task_agent_mapping = {}
- a2a_mcp_server.py:118-122 (schema)Pydantic model defining the structure of agent information stored in registered_agents and returned by list_agents.class AgentInfo(BaseModel): """Information about an A2A agent.""" url: str = Field(description="URL of the A2A agent") name: str = Field(description="Name of the A2A agent") description: str = Field(description="Description of the A2A agent")