Skip to main content
Glama
regismesquita

A2A MCP Server

a2a_server_registry

Manage A2A server URLs by adding or removing entries to configure communication with external agents through the MCP protocol.

Instructions

Add or remove an A2A server URL.

Args:
    action: Either "add" or "remove"
    name: Name of the server
    url: URL of the server (required for "add" action)
    
Returns:
    Dict with status and message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
nameYes
urlNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for the 'a2a_server_registry' tool. Handles adding or removing A2A server URLs from the registry, updates cache asynchronously, and logs operations. Includes input validation and error handling.
    @mcp.tool()
    async def a2a_server_registry(action: Literal["add", "remove"], name: str, url: Optional[str] = None) -> Dict[str, Any]:
        """
        Add or remove an A2A server URL.
        
        Args:
            action: Either "add" or "remove"
            name: Name of the server
            url: URL of the server (required for "add" action)
            
        Returns:
            Dict with status and message
        """
        try:
            logger.debug(f"a2a_server_registry called with action={action}, name={name}, url={url}")
            logger.debug(f"Registry before: {state.registry}")
            
            if action == "add":
                if not url:
                    logger.warning("URL is required for add action")
                    return {"status": "error", "message": "URL is required for add action"}
                
                # Add to registry
                state.registry[name] = url
                logger.info(f"Added A2A server: {name} -> {url}")
                logger.debug(f"Registry after: {state.registry}")
                
                # Update the cache asynchronously
                asyncio.create_task(update_agent_cache())
                
                return {
                    "status": "success", 
                    "message": f"Added A2A server: {name}",
                    "registry": state.registry
                }
            
            elif action == "remove":
                if name in state.registry:
                    # Remove from registry
                    del state.registry[name]
                    
                    # Remove from cache if present
                    if name in state.cache:
                        del state.cache[name]
                    
                    logger.info(f"Removed A2A server: {name}")
                    logger.debug(f"Registry after: {state.registry}")
                    
                    return {
                        "status": "success", 
                        "message": f"Removed A2A server: {name}",
                        "registry": state.registry
                    }
                else:
                    logger.warning(f"Server {name} not found in registry")
                    return {
                        "status": "error", 
                        "message": f"Server {name} not found in registry"
                    }
            
            logger.error(f"Invalid action: {action}")
            return {"status": "error", "message": "Invalid action. Use 'add' or 'remove'"}
        except Exception as e:
            logger.exception(f"Error in a2a_server_registry: {str(e)}")
            return {"status": "error", "message": f"Error: {str(e)}"}
  • MCP tool registration decorator for a2a_server_registry.
    @mcp.tool()
  • Function signature and docstring defining the input schema (action, name, url) and output (dict with status/message/registry).
    async def a2a_server_registry(action: Literal["add", "remove"], name: str, url: Optional[str] = None) -> Dict[str, Any]:
        """
        Add or remove an A2A server URL.
        
        Args:
            action: Either "add" or "remove"
            name: Name of the server
            url: URL of the server (required for "add" action)
            
        Returns:
            Dict with status and message
        """
  • Persistent state class holding the registry (name to URL) and agent card cache, used by the a2a_server_registry tool.
    class ServerState:
        def __init__(self):
            self.registry = {}  # name -> url
            self.cache = {}  # name -> AgentCard
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions that the tool performs 'add or remove' actions, implying mutation, but doesn't disclose behavioral traits like permissions needed, side effects, error handling, or rate limits. The return value is vaguely described as 'Dict with status and message,' lacking detail on structure or possible outcomes.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, starting with the purpose in the first sentence. The parameter and return sections are structured clearly, but the return description could be more specific. Overall, it's efficient with minimal waste.

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 complexity (mutation tool with no annotations) and schema richness (0% coverage, but output schema exists), the description is partially complete. It covers parameters well but lacks behavioral context and detailed return values. The output schema existence means it doesn't need to fully explain returns, but more guidance on usage and effects would improve completeness.

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

Parameters5/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains each parameter: 'action' as either 'add' or 'remove,' 'name' as the server name, and 'url' as required for 'add' action. This compensates fully for the schema's lack of descriptions, making the parameters clear and actionable.

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 purpose as 'Add or remove an A2A server URL,' which specifies the verb (add/remove) and resource (A2A server URL). However, it doesn't differentiate this tool from its siblings (call_agent, list_agents), which appear unrelated, so it doesn't fully address sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives or in what context. It lists parameters but doesn't explain prerequisites, such as when adding or removing is appropriate, or how it relates to other tools like call_agent or list_agents.

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/regismesquita/MCP_A2A'

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