mcp-tool-selection

Guidance for choosing between semantic code search through an MCP Qdrant-Indexer and exact text or file searches. Semantic search finds code by meaning and context, while literal search looks for a known string.

In plain words
What is it for?
Use it when exploring a codebase, investigating bugs, or answering where or why a piece of code works a certain way.
Why use it?
It helps an agent choose an appropriate way to explore unfamiliar code instead of relying on a slow or inaccurate search method.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/context-engine-ai/context-engine/mcp-tool-selection
Any agent
npx skills add Context-Engine-AI/Context-Engine --skill mcp-tool-selection
Clone the repo
git clone --depth 1 https://github.com/Context-Engine-AI/Context-Engine

Made for: Claude Code, Codex.

Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,278 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.01278
Opus 5 $0.00023 $0.00639
Sonnet 5 $0.00009 $0.00256
Haiku 4.5 $0.00005 $0.00128

Measured 2d ago against content hash a3328f21231e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp-tool-selection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.skills/mcp-tool-selection/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP Tool Selection Rules

Core principle: MCP Qdrant-Indexer tools are primary for exploring code and history. Start with MCP for exploration, debugging, or "where/why" questions; use literal search/file-open only for narrow exact-literal lookups.

STOP — Do NOT Use Read File or Grep for Exploration

DO NOT use Read File, grep, ripgrep, cat, find, or any filesystem search tool for code exploration. You have MCP tools that are faster, smarter, and return ranked, contextual results.

  • About to Read a file to understand it? → use search or repo_search or context_answer
  • About to grep for a symbol? → use search or symbol_graph or search_callers_for
  • About to grep -r for a concept? → use search with natural language
  • About to find/ls for project structure? → use qdrant_status (with list_all=true)

TIP: Use search as your DEFAULT tool — it auto-detects intent and routes to the best specialized tool.

The ONLY acceptable use of grep/Read: confirming exact literal strings (e.g., REDIS_HOST), or reading a file you already located via MCP for editing.

Use MCP Qdrant-Indexer When

  • Exploring or don't know exact strings/symbols
  • Need semantic or cross-file understanding (relationships, patterns, architecture)
  • Want ranked results with surrounding context, not just line hits
  • Asking conceptual/architectural or "where/why" behavior questions
  • Need rich context/snippets around matches
  • Finding callers, definitions, or importers of any symbol

Use Literal Search/File-Open Only When

  • Know exact string/function/variable or error message
  • Only need to confirm existence or file/line quickly (not to understand behavior)

Grep Anti-Patterns (DON'T)

grep -r "auth" .        # → Use MCP: "authentication mechanisms"
grep -r "cache" .       # → Use MCP: "caching strategies"  
grep -r "error" .       # → Use MCP: "error handling patterns"
grep -r "database" .    # → Use MCP: "database operations"
# Also DON'T:
Read File to understand a module  # → Use repo_search or context_answer
Read File to find callers         # → Use symbol_graph
find/ls for project structure     # → Use qdrant_status (list_all=true)

Read the full file on GitHub · 90 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 90 lines · 46 tokens per session scan A a3328f21231e

Subscribe to this mod's changes

mcp-tool-selection is a skill published in the GitHub repository Context-Engine-AI/Context-Engine (400 stars, last pushed 1mo ago), licensed MIT. It adds 46 tokens to every session and 1,278 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.