tool-selector
4
总安装量
3
周安装量
#48360
全站排名
安装命令
npx skills add https://github.com/fatih-developer/fth-skills --skill tool-selector
Agent 安装分布
gemini-cli
3
github-copilot
3
codex
3
kimi-cli
3
cursor
3
amp
3
Skill 文档
Tool Selector Protocol
Determine which tools are needed to solve the task, plan the most efficient sequence, and eliminate unnecessary calls before they happen.
Core principle: Every tool call costs time, tokens, and rate limits. The right tool, in the right order, called once.
Tool Catalog
| Tool | Cost | Side Effect | Best For |
|---|---|---|---|
| Web search | Medium | None (read-only) | Current info, external sources |
| Code execution | Medium | Environment-dependent | Computation, transformation, testing |
| File read | Low | None | Local data, config, content |
| File write | Medium | Persistent change | Saving output, updates |
| API call | High | Rate limits, cost | External service integration |
| Database query | Medium-High | Persistent on writes | Data read/write |
| Memory/context | Low | None | Retrieve previous information |
Selection Algorithm
For each tool candidate, ask these questions in order:
1. Can this tool actually solve this task? â No = eliminate
2. Can a cheaper/simpler tool do the same job? â Yes = use that instead
3. Was this tool already called for this task? â Yes = use cached result
4. Is this call actually needed right now? â No = defer
5. Does this tool depend on another tool's output? â Yes = add to sequence
Anti-Patterns â Block These
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Reading the same file repeatedly | Each read costs tokens | Cache on first read |
| Web search for known information | Unnecessary latency | Use existing knowledge |
| Serial API calls (could be parallel) | Slow | Plan parallel calls |
| Tool chain when one tool suffices | Extra steps | Consolidate |
| Read before write (when unnecessary) | Extra call | Skip the read |
| Loading memory every step | Token waste | Load once, reference |
Output Format
TOOL SELECTOR
Task : [task summary]
Selected: N tools | Total calls: N | Blocked: N
## Tool Plan
| Step | Tool | Purpose | Depends On | Cached? |
|------|------|---------|------------|---------|
| 1 | [tool] | [why] | â | No |
| 2 | [tool] | [why] | #1 | Yes â use #1 output |
## Blocked Calls
| Blocked | Reason | Alternative |
|---------|--------|-------------|
| [tool call] | [rationale] | [what to do instead] |
## Optimization Notes
- [Parallel opportunities]
- [Cached outputs]
- [Rate limit warnings]
Approve? Proceed?
Tool Combination Guide
| Task Type | Typical Chain | Block |
|---|---|---|
| Research & Report | Search â File read â Code (analyze) â File write | Searching same topic twice |
| Data Processing | File read â Code â File write | Re-reading file each step |
| API Integration | Memory (creds) â API â Code (parse) â DB write | Re-auth per request |
| Code Development | File read â Code (test) â File write â Code (verify) | Full test suite on every change |
| Database Operation | Memory (schema) â DB (SELECT) â Code (prepare) â DB (write) | Running same SELECT twice |
When to Skip
- Single-tool task (“read this file”)
- User already specified which tool to use
- Single-step, side-effect-free task
Guardrails
- Never call an API when cached data suffices â always check cache first.
- Prefer low-cost tools â file read over web search when local data exists.
- Cross-skill: works with
parallel-planner(parallel tool calls) andtask-decomposer(tool needs per subtask).