search_agents
Find ERC-8004 agents by name substring. Returns up to a specified number of matching agents for quick discovery.
Instructions
Search indexed ERC-8004 agents.
Args: query: Optional substring to match against agent name. limit: Maximum number of agents to return (default 25).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/minuet_mcp/server.py:31-42 (handler)The actual handler/implementation of the 'search_agents' MCP tool. It is decorated with @mcp.tool(), takes optional query and limit parameters, calls the MinuetClient.list_agents() API, and returns the agents data.
@mcp.tool() async def search_agents(query: str | None = None, limit: int = 25) -> dict[str, Any]: """Search indexed ERC-8004 agents. Args: query: Optional substring to match against agent name. limit: Maximum number of agents to return (default 25). """ async with MinuetClient() as client: data = await client.list_agents(name=query, limit=limit) agents = data.get("agents", [])[:limit] return {"count": len(agents), "agents": agents} - src/minuet_mcp/server.py:31-32 (registration)The @mcp.tool() decorator registers the search_agents function as an MCP tool on the FastMCP server instance.
@mcp.tool() async def search_agents(query: str | None = None, limit: int = 25) -> dict[str, Any]: - src/minuet_mcp/client.py:68-84 (helper)The MinuetClient.list_agents() method that the search_agents handler calls. It makes a GET request to /api/agents with optional name, mcpTools, active, and limit query parameters.
async def list_agents( self, name: str | None = None, mcp_tools: str | None = None, active: bool | None = None, limit: int | None = None, ) -> dict[str, Any]: params: dict[str, Any] = {} if name: params["name"] = name if mcp_tools: params["mcpTools"] = mcp_tools if active is not None: params["active"] = "true" if active else "false" if limit is not None: params["limit"] = limit return await self._get("/api/agents", params=params or None) - src/minuet_mcp/server.py:33-42 (schema)The input schema for the search_agents tool: optional 'query' (str) and 'limit' (int) parameters. The return type is dict[str, Any] containing 'count' and 'agents' keys.
"""Search indexed ERC-8004 agents. Args: query: Optional substring to match against agent name. limit: Maximum number of agents to return (default 25). """ async with MinuetClient() as client: data = await client.list_agents(name=query, limit=limit) agents = data.get("agents", [])[:limit] return {"count": len(agents), "agents": agents} - tests/test_smoke.py:14-29 (registration)Smoke test verifying that 'search_agents' is among the registered tools on the MCP server.
async def test_expected_tools_registered() -> None: from minuet_mcp.server import mcp tools = await mcp.list_tools() names = {t.name for t in tools} expected = { "search_agents", "get_agent", "get_agent_relationships", "get_hub_agents", "get_owner_ecosystems", "get_relationship_graph", "get_network_stats", "get_recent_relationships", } assert expected <= names, f"missing tools: {expected - names}"