Skip to main content
Glama

list_routing_strategies

Retrieve available routing strategies and their rules to optimize communication between ACP agents and MCP clients.

Instructions

List all available routing strategies and their rules

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • The main handler function for the 'list_routing_strategies' MCP tool. It collects information about the default and custom routing strategies from the AgentRouter instance and returns them as a JSON string.
    @mcp.tool() async def list_routing_strategies() -> str: """List all available routing strategies and their rules""" try: strategies_info = {} # Include default strategy strategies_info["default"] = { "description": router.default_strategy.description, "rules": [ { "keywords": rule.keywords, "agent": rule.agent_name, "priority": rule.priority, "description": rule.description } for rule in router.default_strategy.rules ] } # Include custom strategies for name, strategy in router.strategies.items(): strategies_info[name] = { "description": strategy.description, "rules": [ { "keywords": rule.keywords, "agent": rule.agent_name, "priority": rule.priority, "description": rule.description } for rule in strategy.rules ] } return json.dumps(strategies_info, indent=2) except Exception as e: return f"Error: {e}"
  • Registration of all component tools, including the router tools (via register_router_tools) which registers the list_routing_strategies tool to the FastMCP instance.
    # Register component tools register_discovery_tools(self.mcp, self.discovery) register_bridge_tools(self.mcp, self.message_bridge) register_orchestrator_tools(self.mcp, self.orchestrator) register_router_tools(self.mcp, self.router) register_interactive_tools(self.mcp, self.interactive_manager)
  • Import of the register_router_tools function used to register the routing tools including list_routing_strategies.
    from .agent_router import AgentRouter, register_router_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