Guide for using MCP symbol search tools effectively
Explains when to use MCP symbol search tools versus grep for code exploration tasks.
/plugin marketplace add ChipFlow/claude-context-tools/plugin install context-tools@chipflow-context-toolsThe context-tools plugin provides fast MCP tools for code symbol lookups using a pre-built SQLite index. Use these instead of grep when searching for functions, classes, or methods.
search_symbols with patterns like setup_*, *Handler, Config*get_file_symbols shows all functions/classes without reading the fileget_symbol_content retrieves the full source by nameScenario: User asks "Can we compare our generated code against OSDI?"
Inefficient approach (using grep):
grep -r "setup_model\|setup_instance" jax_spice/devices/*.py
# Problems:
# - Slow on large codebases
# - Pattern matching with wildcards is error-prone
# - Doesn't show function signatures
# - Gets interrupted easily
Efficient approach (using MCP tools):
mcp__plugin_context-tools_repo-map__search_symbols
pattern: "setup_*"
# Result: Instant list of all matching functions with file locations
mcp__plugin_context-tools_repo-map__get_symbol_content
name: "setup_model"
# Result: Full function source code without knowing which file
Scenario: Need to find the correct variant name for enum InstructionData (e.g., is it Phi or PhiNode?)
Inefficient approach (using grep):
grep -n "enum InstructionData" openvaf-py/vendor/OpenVAF/openvaf/mir/src
grep -n "Phi" openvaf-py/vendor/OpenVAF/openvaf/mir/src/instructions.rs | head -10
# Problems:
# - Multiple searches needed
# - Have to manually parse enum definition
# - Easy to miss the correct variant name
Efficient approach (using MCP tools):
mcp__plugin_context-tools_repo-map__search_symbols
pattern: "InstructionData"
# Result: Finds the enum definition location instantly
mcp__plugin_context-tools_repo-map__get_symbol_content
name: "InstructionData"
# Result: Complete enum definition showing all variants including PhiNode(_)
Benefits: One search, complete enum definition, see all variants at once.
Scenario: Need to find PSP103 or BSIM4 models in vendor directory
Inefficient approach (using find/ls):
find vendor/OpenVAF/integration_tests -name "*.va" | grep -E "(psp103|bsim4)"
ls -la openvaf-py/vendor/OpenVAF/
ls -la vendor/
ls -la vendor/VACASK/devices/
ls -la vendor/VACASK/devices/psp103v4/
# Problems:
# - Trial and error with directory paths
# - Multiple ls commands to explore structure
# - Slow on large directory trees
Efficient approach (using MCP tools):
mcp__plugin_context-tools_repo-map__list_files
pattern: "*psp103*"
# Result: Instant list of all PSP103-related files
mcp__plugin_context-tools_repo-map__list_files
pattern: "*.va"
# Result: All Verilog-A model files
Benefits: One query, instant results, no trial-and-error with paths.
Search for symbols by pattern:
mcp__plugin_context-tools_repo-map__search_symbols
pattern: "get_*" # Functions starting with "get_"
pattern: "*Handler" # Classes ending with "Handler"
pattern: "*config*" # Anything containing "config"
List all symbols in a file:
mcp__plugin_context-tools_repo-map__get_file_symbols
file: "src/models/user.py"
Get source code by exact name:
mcp__plugin_context-tools_repo-map__get_symbol_content
name: "UserModel" # Class name
name: "process_data" # Function name
name: "User.save" # Method name
List indexed files (discover file structure):
mcp__plugin_context-tools_repo-map__list_files
# List all indexed files
mcp__plugin_context-tools_repo-map__list_files
pattern: "*.va" # All Verilog-A files
pattern: "*psp103*" # PSP103 model files
pattern: "**/devices/*" # All files under devices/
Check index status:
mcp__plugin_context-tools_repo-map__repo_map_status
Manually reindex:
mcp__plugin_context-tools_repo-map__reindex_repo_map
MCP tools use a pre-built SQLite index:
MCP tools automatically adapt to your current directory:
cd /path/to/project-A
# MCP tools query project-A's index
cd /path/to/project-B
# MCP tools now query project-B's index (no restart needed!)
Each project maintains its own .claude/repo-map.db index.
If MCP tools aren't working:
ls -la .claude/repo-map.db/context-tools:status or use repo_map_status tool/context-tools:repo-map or use reindex_repo_map toolclaude continue)