routing
Configure provider routing strategies for API calls, selecting between cost optimization, speed, quality, or balanced approaches with customizable quality thresholds.
Instructions
Get or set your provider routing strategy. Strategies: cheapest (lowest cost above quality floor), fastest (healthiest circuits), highest_quality (highest AN score), balanced (weighted mix). Quality floor filters out low-quality providers.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Action: 'get' to check strategy, 'set' to update | |
| strategy | No | Strategy: cheapest, fastest, highest_quality, balanced | |
| quality_floor | No | Minimum AN score (0-10, default 6.0) | |
| max_cost_per_call_usd | No | Maximum cost per call in USD |
Implementation Reference
- packages/mcp/src/tools/routing.ts:12-29 (handler)The handler function for the "routing" tool, which either sets or gets the routing strategy via the API client.
export async function handleRouting( input: RoutingInput, client: RhumbApiClient ): Promise<RoutingOutput> { const action = input.action || "get"; if (action === "set" && input.strategy) { const result = await client.setRoutingStrategy( input.strategy, input.quality_floor, input.max_cost_per_call_usd ); return result as unknown as RoutingOutput; } const result = await client.getRoutingStrategy(); return result as unknown as RoutingOutput; } - packages/mcp/src/server.ts:259-275 (registration)Registration of the "routing" tool in the Rhumb MCP server.
// -- routing ---------------------------------------------------------- server.tool( "routing", "Get or set how Rhumb auto-selects providers when you don't specify one in execute_capability. Controls the tradeoff between cost, speed, and quality. Also sets a quality floor (minimum AN Score) and optional per-call cost ceiling.", { action: z.string().optional().describe(RoutingInputSchema.properties.action.description), strategy: z.string().optional().describe(RoutingInputSchema.properties.strategy.description), quality_floor: z.number().optional().describe(RoutingInputSchema.properties.quality_floor.description), max_cost_per_call_usd: z.number().optional().describe(RoutingInputSchema.properties.max_cost_per_call_usd.description) }, async ({ action, strategy, quality_floor, max_cost_per_call_usd }) => { const result = await handleRouting({ action, strategy, quality_floor, max_cost_per_call_usd }, client); return { content: [{ type: "text" as const, text: JSON.stringify(result) }] }; } );