Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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()]
  • Global dictionary that stores the registered agents, which is used by the list_agents tool to return the list.
    registered_agents = {}
    task_agent_mapping = {}
  • 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")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the return type ('List of registered agents'), which is helpful, but lacks details on permissions, rate limits, pagination, or error handling. For a read operation with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by a brief return statement. Both sentences earn their place, and there's no wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, has output schema), the description is adequate but incomplete. It covers the basic purpose and return value, but lacks behavioral context like permissions or usage scenarios, which would be needed for a higher score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description doesn't need to add parameter details, and it doesn't introduce unnecessary complexity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all registered A2A agents'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_task_result' or 'register_agent', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context for listing agents, or relationships to sibling tools like 'register_agent' or 'unregister_agent'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GongRzhe/A2A-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server