locate
Search/lookup. Pick a mode, or omit with a bare query to AUTO-ROUTE (text, then semantic on empty; response carries answered_by). Modes:
text (replaces grep): literal identifier/string, one row/occurrence. queries:[...] (<=10 terms) searches several in one call (and implies this mode when mode is omitted). pathsOnly:true = "filePath:lineNumber" only (~5x cheaper). maxPerFile caps rows/file (default 5). Empty carries did_you_mean; do NOT retry reworded, use semantic.
symbol: symbols by name/symbolPath in one repo. kind filters node kind, layer one layer. Tests last unless includeTests:true.
semantic: vector search for symbols similar to a natural-language query (names unknown).
file: fuzzy filename search (basename); filenames only.
config (replaces grep for env/config keys): key/env-var usages with nearest-symbol context; queries:[...] batches several keys.
codebase: cross-repo candidate scan; narrow with repositoryIds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | mode:symbol. Filter by node kind. | |
| mode | No | Force a mode. Omit + bare query = AUTO-ROUTE (text, then semantic on empty). queries without a mode implies text. | |
| name | No | mode:file. Filename fragment; defaults to query. | |
| layer | No | mode:symbol. Scope to one layer (e.g. browser, node, common, test). | |
| limit | No | Max results. Per-mode caps apply (text 200/20, symbol 20, semantic 5, file 10, config 20/20, codebase 20/10). | |
| query | No | Search term or NL query. Required for symbol/semantic/codebase; text/config: query or queries; file: query or name. | |
| queries | No | text/config. Up to 10 terms; interleaved, deduped, each tagged matchedQuery. Without an explicit mode, implies mode:text. Accepts a JSON-array string. | |
| feedback | No | Optional: report how a previous answer worked out; piggybacks on any call. | |
| commitSha | No | Pin an indexed revision (text/symbol/semantic/config; ignored by file/codebase). | |
| pathsOnly | No | mode:text. "filePath:lineNumber" only, no snippets (~5x fewer tokens). | |
| projectId | No | Project id from init/list_projects. Omit for the active project. | |
| maxPerFile | No | mode:text. Cap occurrences/file (default 5; capped file carries moreInFileTruncated). 0 = uncapped. | |
| pathPrefix | No | text/symbol/config. Restrict to paths under this prefix. | |
| repository | No | Single-repo scope (not codebase; that is project-wide, use repositoryIds). | |
| includeTests | No | text/symbol/semantic. Include test files. Default false ranks them last; auto-on for test queries. | |
| repositoryIds | No | mode:codebase. Narrow to these repository ids; omit to scan all. |