Search code
search_codePerform graph-augmented code search: deduplicate grep matches into functions, rank by structural importance. Choose signatures, source, or file paths.
Instructions
Graph-augmented code search. Finds text patterns via grep, then enriches results with the knowledge graph: deduplicates matches into containing functions, ranks by structural importance (definitions first, popular functions next, tests last). Modes: compact (default, signatures only — token efficient), full (with source), files (just file paths). Use path_filter regex to scope results. TRUNCATION: enriched results are capped at limit (default 10). Response carries 'total_grep_matches' (raw grep hit count) and 'total_results' (deduplicated function count) — compare to limit to detect truncation. There is no offset parameter; to see more, raise limit or narrow the query with file_pattern / path_filter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | compact: signatures+metadata (default). full: with source. files: just file list. | compact |
| limit | No | Max enriched results per call. Default 10. Response includes 'total_grep_matches' and 'total_results' so callers can detect truncation. No offset parameter — raise limit or narrow with file_pattern / path_filter to see more. | |
| regex | No | ||
| context | No | Lines of context around each match (like grep -C). Only used in compact mode. | |
| pattern | Yes | ||
| project | Yes | ||
| path_filter | No | Regex filter on result file paths (e.g. ^src/ or \.(go|ts)$) | |
| file_pattern | No | Glob for grep --include (e.g. *.go) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||