search_graph
Search code knowledge graph for functions, classes, routes, and variables using natural-language, regex, or semantic vector queries to find definitions and relationships.
Instructions
Search the code knowledge graph for functions, classes, routes, and variables. Use INSTEAD OF grep/glob when finding code definitions, implementations, or relationships. Three search modes: (1) query='update settings' for BM25 ranked full-text search with camelCase splitting and structural label boosting — recommended for natural-language discovery; (2) name_pattern='.regex.' for exact pattern matching; (3) semantic_query=[...] for vector cosine search that bridges vocabulary (finds 'publish' when you search 'send'). The three modes are independent and can be combined in a single call. PAGINATION: results are capped at limit (default 200) — broader queries are silently truncated. The response always includes 'total' (full match count before limit) and 'has_more' (true when total > offset+returned). Detect truncation with has_more, then page by re-calling with offset=offset+limit until has_more is false. Narrow first via label/file_pattern/min_degree before paginating large result sets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| query | No | Natural-language or keyword full-text search using BM25 ranking. Tokens are split on whitespace; camelCase identifiers are indexed as individual words (updateCloudClient → update, cloud, client). Results are ranked with structural boosting: Functions/Methods +10, Routes +8, Classes/Interfaces +5. Noise labels (File/Folder/Module/Variable) are filtered out. When provided, name_pattern is ignored. | |
| label | No | ||
| name_pattern | No | ||
| qn_pattern | No | ||
| file_pattern | No | ||
| relationship | No | ||
| min_degree | No | ||
| max_degree | No | ||
| exclude_entry_points | No | ||
| include_connected | No | ||
| semantic_query | No | MUST be an ARRAY of keyword strings (e.g. ["send","pubsub","publish"]) — NOT a single string. Each keyword is scored independently via per-keyword min-cosine; results reflect functions that score well on ALL keywords. Requires moderate/full index mode. Results appear in the 'semantic_results' field (separate from 'results'). | |
| limit | No | Max results per call. Default 200. Response carries 'total' (full match count) and 'has_more' (true if truncated) so callers can detect the limit and paginate. | |
| offset | No | Skip the first N matching nodes. Combine with 'limit' to page: increment offset by limit and re-call while has_more is true. |