test_routing
Simulate agent selection for routing based on input text and strategy without actual execution, enabling efficient planning and testing for ACP-MCP Server integrations.
Instructions
Test routing without executing - shows which agent would be selected
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_text | Yes | ||
| strategy | No | default |
Input Schema (JSON Schema)
{
"properties": {
"input_text": {
"title": "Input Text",
"type": "string"
},
"strategy": {
"default": "default",
"title": "Strategy",
"type": "string"
}
},
"required": [
"input_text"
],
"type": "object"
}
Implementation Reference
- acp_mcp_server/agent_router.py:290-311 (handler)The test_routing MCP tool handler function. It tests which agent a given input_text would be routed to using the specified strategy, without executing the agent. Returns JSON with input, strategy, target_agent, routing_reason, and would_execute flag.@mcp.tool() async def test_routing( input_text: str, strategy: str = "default" ) -> str: """Test routing without executing - shows which agent would be selected""" try: target_agent, routing_reason = await router.route_request(input_text, strategy) result = { "input": input_text, "strategy": strategy, "target_agent": target_agent, "routing_reason": routing_reason, "would_execute": True } return json.dumps(result, indent=2) except Exception as e: return f"Error: {e}"
- acp_mcp_server/server.py:88-88 (registration)Registration of the router tools (including test_routing) by calling register_router_tools on the MCP instance with the AgentRouter instance.register_router_tools(self.mcp, self.router)