{
  "markdown": "# ToolRoute\n\nRouting layer for AI agents. One call returns the best MCP server and LLM for any task — scored on 132 real benchmark executions.\n\n[![MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)\n\n---\n\n## Quick start\n\nAdd to any MCP client (Claude Code, Cursor, Windsurf, Cline):\n\n```json\n{\n  \"mcpServers\": {\n    \"toolroute\": {\n      \"url\": \"https://toolroute.io/api/mcp\"\n    }\n  }\n}\n```\n\nOr via HTTP:\n\n```bash\ncurl -X POST https://toolroute.io/api/route \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"task\": \"search the web for recent AI papers\"}'\n```\n\n```json\n{\n  \"approach\": \"mcp_server\",\n  \"recommended_skill\": \"exa-mcp-server\",\n  \"recommended_skill_name\": \"Exa MCP Server\",\n  \"recommended_model\": {\n    \"slug\": \"claude-haiku-4-5-20251001\",\n    \"display_name\": \"Claude Haiku 4.5\",\n    \"provider\": \"anthropic\",\n    \"tier\": \"cheap_chat\",\n    \"provider_model_id\": \"anthropic/claude-haiku-4-5-20251001\",\n    \"input_cost_per_mtok\": 1.00,\n    \"output_cost_per_mtok\": 5.00\n  },\n  \"confidence\": 0.91,\n  \"alternatives\": [\"brave-search-mcp\", \"tavily-mcp\"],\n  \"fallback\": \"brave-search-mcp\"\n}\n```\n\n> `recommended_model` is always an **object**, not a bare string — the inner `slug` is the canonical model identifier.\n\n---\n\n## How it works\n\nEvery task falls into one of three approaches:\n\n| Approach | When | Returns |\n|---|---|---|\n| `direct_llm` | Task needs only an LLM (code, writing, analysis) | Best model + cost estimate |\n| `mcp_server` | Task needs an external tool (search, email, calendar) | Best tool + best model |\n| `multi_tool` | Compound task (\"send Slack AND update Jira AND email\") | Ordered orchestration chain |\n\nRouting uses an LLM classifier (~$0.00001/call) for task understanding, then ranks candidates on a 5-dimension score:\n\n```\nValue Score = 0.35 × Output Quality\n            + 0.25 × Reliability\n            + 0.15 × Efficiency\n            + 0.15 × Cost\n            + 0.10 × Trust\n```\n\nEvery reported outcome updates the scores. The routing gets more accurate as more agents use it.\n\n---\n\n## Benchmark results\n\n132 blind A/B executions across code, writing, analysis, structured output, and translation.\n\n| | ToolRoute | Fixed GPT-4o |\n|---|---|---|\n| Quality wins | 6 | 0 |\n| Ties | 9 | 9 |\n| Losses | 0 | — |\n| Avg cost | $0.001–0.01 | $0.03–0.10 |\n\n---\n\n## API\n\n| Endpoint | Method | Description |\n|---|---|---|\n| `/api/route` | POST | Route a task to best MCP server + LLM (unified) |\n| `/api/route/model` | POST | Route to best LLM model only (no MCP server) |\n| `/api/mcp` | POST (JSON-RPC) | MCP server — 16 tools |\n| `/api/mcp` | GET (SSE) | SSE transport for MCP clients |\n| `/api/report` | POST | Report MCP server outcome (lightweight) |\n| `/api/contributions` | POST | Advanced MCP skill telemetry (requires `skill_id` or `skill_slug` in payload) |\n| `/api/report/model` | POST | Report **LLM model** outcome — use this for model telemetry, **not** `/api/contributions` |\n| `/api/verify/model` | POST | Verify model output quality |\n| `/api/skills` | GET | Search MCP server catalog |\n| `/api/agents/register` | POST | Register agent identity |\n| `/api/agents/preferences` | POST | Set routing preferences (Strategy D Phase 2 — `allow_china`, `regulated_industries`) |\n| `/api/health` | GET | Service health check (DB + uptime) |\n| `/api/metrics` | GET | Public aggregate platform metrics (no auth) |\n\nFull reference at [toolroute.io/api-docs](https://toolroute.io/api-docs)\n\n---\n\n## SDK\n\n```bash\nnpm install @toolroute/sdk\n```\n\n```typescript\nimport { ToolRoute } from '@toolroute/sdk'\n\nconst tr = new ToolRoute()\nconst rec = await tr.route({ task: 'parse this CSV and summarize it' })\n// execute with rec.recommended_model ...\nawait tr.report({ skill: rec.recommended_skill, outcome: 'success', latency_ms: 1400 })\n```\n\n---\n\n## Self-hosting\n\n```bash\ngit clone https://github.com/grossiweb/ToolRoute.git\ncd ToolRoute\ncp .env.local.example .env.local\nnpm install\nnpm run dev\n```\n\nRequires: `NEXT_PUBLIC_SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_ANON_KEY`, `SUPABASE_SERVICE_ROLE_KEY`\n\n---\n\n## How routing works\n\nToolRoute classifies each task using an LLM classifier (Gemini Flash Lite,\n~$0.00001/call) with a keyword fallback. The resulting tier maps to a specific\nmodel via `src/lib/routing/tiers.ts`. Live pricing and capability data come\nfrom the `models` table. See [docs/architecture.md](./docs/architecture.md)\nfor the full picture.\n\n---\n\n## Stack\n\nNext.js 14 (App Router) · Supabase (Postgres) · Vercel\n\n## License\n\nMIT\n",
  "bytes": 4474,
  "sha": "b0da3212a35f2ca2188496a3a953eafb2250ea804c7551fb306ba0ed050ca11e",
  "repo_slug": "grossiweb/toolroute",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_grossiweb_toolroute_00d6f1c5/readme"
}