mcp-tool-routinglisted
Install: claude install-skill mouadja02/skills
# MCP Tool Routing
Use this skill when an agent has too many tools to place in context at once, when MCP server inventories change, or when routing errors dominate agent failures.
## Core Principle
Treat tool routing as a retrieval system with governance. Do not stuff every tool schema into the prompt. Maintain a synchronized tool index, retrieve candidate tools at runtime, rerank with capability and safety signals, and expose only the smallest useful tool set to the agent.
## Routing Workflow
1. **Build a tool inventory**
- Record server, tool name, description, schema, auth scope, side-effect class, and owner.
- Hash each tool definition so stale schemas can be detected.
- Separate read-only, write-capable, privileged, and destructive tools.
2. **Create retrieval documents**
- Include tool name, natural-language description, argument names, examples, failure modes, and synthetic user questions.
- Weight stable identifiers and argument semantics more heavily than marketing descriptions.
- Keep raw schemas available for final validation even if retrieval uses summaries.
3. **Route dynamically**
- Retrieve candidate tools from the inventory for the current user goal.
- Traverse from tools to parent servers or specialist agents when using graph routing.
- Rerank by relevance, schema fit, safety class, freshness, and historical success.
- Load only the selected tools into the agent context.
4. **Verify before invocation**
- Validate argum