Search code semantically
localscope_searchSearch local code or docs by meaning, symbol, or fragment to find where a feature is implemented. Returns file, line range, snippet, and match type.
Instructions
Search the local index for code or docs by meaning, symbol name, or fragment. Combines embeddings (if installed) with lexical identifier matching — all offline.
Args:
query (string): what to find, e.g. "retry with backoff", "parseConfig", "where do we validate webhooks"
path (string): repo root previously indexed, default "."
limit (number): max results 1-100, default 20
response_format ('markdown' | 'json'): default 'markdown'
Returns: Hits with file, line range, symbol, score, snippet, and how it matched (semantic/lexical/symbol).
Use when: "where is X handled?", "find code that does Y". Requires localscope_index first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Repository path (must match a previously indexed root) | . |
| limit | No | Maximum results to return | |
| query | Yes | Natural-language query, symbol name, or code fragment to find | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable | markdown |