Skip to main content
Glama

discover_acp_agents

Identify and register all available ACP agents as resources, enabling integration between ACP-based AI agents and MCP-compatible tools via the ACP-MCP-Server bridge.

Instructions

Discover all available ACP agents and register them as resources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler for the 'discover_acp_agents' tool. Decorated with @mcp.tool() for automatic registration. Discovers ACP agents via HTTP API, enriches with MCP resource URIs and capabilities, and returns formatted JSON string.
    @mcp.tool()
    async def discover_acp_agents() -> str:
        """Discover all available ACP agents and register them as resources"""
        agents = await discovery.discover_agents()
        
        result = {
            "discovered_count": len(agents),
            "agents": []
        }
        
        for agent in agents:
            agent_info = {
                "name": agent.name,
                "description": agent.description,
                "resource_uri": discovery.get_mcp_resource_uri(agent.name),
                "capabilities": await discovery.get_agent_capabilities(agent.name)
            }
            result["agents"].append(agent_info)
        
        return str(result)
  • Invocation of register_discovery_tools in the ACPMCPServer._register_all_tools method, which defines and registers the discover_acp_agents tool with the FastMCP server instance.
    register_discovery_tools(self.mcp, self.discovery)
  • Pydantic BaseModel schema used to parse and type discovered ACP agent data from the API response.
    class ACPAgent(BaseModel):
        name: str
        description: str
        metadata: Dict[str, Any] = {}
  • Key helper method in AgentDiscoveryTool that performs the actual HTTP discovery of ACP agents and caches them.
    async def discover_agents(self) -> List[ACPAgent]:
        """Discover all available ACP agents"""
        async with aiohttp.ClientSession() as session:
            try:
                async with session.get(f"{self.acp_base_url}/agents") as response:
                    if response.status == 200:
                        data = await response.json()
                        agents = [ACPAgent(**agent) for agent in data.get("agents", [])]
                        
                        # Update discovered agents cache
                        for agent in agents:
                            self.discovered_agents[agent.name] = agent
                        
                        return agents
                    else:
                        print(f"Failed to discover agents: {response.status}")
                        return []
            except Exception as e:
                print(f"Error discovering agents: {e}")
                return []
  • Helper method that generates MCP-compatible capabilities information for discovered agents.
    async def get_agent_capabilities(self, agent_name: str) -> Dict[str, Any]:
        """Get detailed capabilities of a specific agent"""
        # This could be extended to call a capabilities endpoint
        # For now, return basic info from discovery
        agent = self.discovered_agents.get(agent_name)
        if agent:
            return {
                "name": agent.name,
                "description": agent.description,
                "metadata": agent.metadata,
                "supports_streaming": True,  # ACP supports streaming
                "supports_multimodal": True,  # ACP supports multi-modal
                "interaction_modes": ["sync", "async", "stream"]
            }
        return {}
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 of behavioral disclosure. It states the tool discovers and registers agents, implying a read operation that may update internal state (registration). However, it lacks details on permissions required, whether registration is persistent, rate limits, error handling, or what 'available' means (e.g., online agents only). For a tool with no annotations, this leaves significant behavioral gaps.

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 a single, efficient sentence that directly states the tool's action and outcome. It is front-loaded with the core purpose ('discover all available ACP agents') and adds a secondary effect ('register them as resources') without unnecessary elaboration. Every word earns its place, making it highly concise and well-structured.

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 has 0 parameters, 100% schema coverage, and an output schema exists (so return values needn't be explained in the description), the description is minimally adequate. However, with no annotations and a purpose that involves discovery and registration (potentially mutating internal state), it lacks completeness regarding behavioral aspects like side effects or prerequisites. It meets basic needs but has clear gaps in context.

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?

The tool has 0 parameters, with 100% schema description coverage (since there are no parameters to describe). The description doesn't need to add parameter semantics beyond the schema. According to the rules, 0 parameters baseline is 4, as there's no gap to compensate for, and the description doesn't introduce any parameter-related confusion.

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 tool's purpose with a specific verb ('discover') and resource ('ACP agents'), and mentions an additional action ('register them as resources'). It distinguishes from siblings like 'get_agent_info' (which likely retrieves info on a specific agent) by focusing on discovery and registration of all agents. However, it doesn't explicitly differentiate from all siblings, such as 'list_active_runs' or 'list_pending_interactions', which also involve listing operations.

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. It doesn't mention prerequisites (e.g., when agents need to be discovered), exclusions (e.g., not for real-time agent status), or direct comparisons to siblings like 'get_agent_info' (for specific agent details) or 'list_active_runs' (for active agent runs). Usage is implied only by the tool's name and description, lacking explicit context.

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

Related 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/ACP-MCP-Server'

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