The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Toolroute listing page.
Routing layer for AI agents. One call returns the best MCP server and LLM for any task — scored on 132 real benchmark executions.
Add to any MCP client (Claude Code, Cursor, Windsurf, Cline):
Or via HTTP:
recommended_modelis always an object, not a bare string — the innerslugis the canonical model identifier.
Every task falls into one of three approaches:
| Approach | When | Returns |
|---|---|---|
direct_llm | Task needs only an LLM (code, writing, analysis) | Best model + cost estimate |
mcp_server | Task needs an external tool (search, email, calendar) | Best tool + best model |
multi_tool | Compound task ("send Slack AND update Jira AND email") | Ordered orchestration chain |
Routing uses an LLM classifier (~$0.00001/call) for task understanding, then ranks candidates on a 5-dimension score:
Every reported outcome updates the scores. The routing gets more accurate as more agents use it.
132 blind A/B executions across code, writing, analysis, structured output, and translation.
| ToolRoute | Fixed GPT-4o | |
|---|---|---|
| Quality wins | 6 | 0 |
| Ties | 9 | 9 |
| Losses | 0 | — |
| Avg cost | $0.001–0.01 | $0.03–0.10 |
| Endpoint | Method | Description |
|---|---|---|
/api/route | POST | Route a task to best MCP server + LLM (unified) |
/api/route/model | POST | Route to best LLM model only (no MCP server) |
/api/mcp | POST (JSON-RPC) | MCP server — 16 tools |
/api/mcp | GET (SSE) | SSE transport for MCP clients |
/api/report | POST | Report MCP server outcome (lightweight) |
/api/contributions | POST | Advanced MCP skill telemetry (requires skill_id or skill_slug in payload) |
/api/report/model | POST | Report LLM model outcome — use this for model telemetry, not /api/contributions |
/api/verify/model | POST | Verify model output quality |
/api/skills | GET | Search MCP server catalog |
/api/agents/register | POST | Register agent identity |
/api/agents/preferences | POST | Set routing preferences (Strategy D Phase 2 — allow_china, regulated_industries) |
/api/health | GET | Service health check (DB + uptime) |
/api/metrics | GET | Public aggregate platform metrics (no auth) |
Full reference at toolroute.io/api-docs
Requires: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY
ToolRoute classifies each task using an LLM classifier (Gemini Flash Lite,
~$0.00001/call) with a keyword fallback. The resulting tier maps to a specific
model via src/lib/routing/tiers.ts. Live pricing and capability data come
from the models table. See docs/architecture.md
for the full picture.
Next.js 14 (App Router) · Supabase (Postgres) · Vercel
MIT