list_agents
Retrieve and display all active agents connected to the Strands Agent MCP server for integration and management in MCP-compatible systems.
Instructions
list all available agents
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/strands_agent_mcp/server.py:41-46 (handler)The handler function for the 'list_agents' tool. It returns a list of names of all registered agents by iterating over agent_registry.agent_entries. The @mcp.tool decorator registers it with FastMCP and provides the tool description/schema.@mcp.tool(description="list all available agents") def list_agents() -> List[str]: """ List all registered agents """ return [agent.name for agent in agent_registry.agent_entries]
- Helper property on the Registry class that provides the list of all AgentEntry instances, which list_agents uses to extract agent names.@property def agent_entries(self) -> List[AgentEntry]: return [entry for entry in self._registry.values()]
- Builds the agent registry by discovering agents from plugins, populating the agent_entries used by list_agents.def build_registry(discovered_plugins: Dict[str, ModuleType]) -> Registry: registry = Registry() for plugin_name, module in discovered_plugins.items(): for agent_entry in module.build_agents(): registry.register(agent_entry) return registry