Tools
grep_definition
Find semantic definitions by symbol name.
Use grep_definition when you know a symbol name but not its location. It searches semantic definitions in the workspace, rather than arbitrary text or references.
Use when
- You need to discover an unknown symbol or file outline.
- You want language- and kind-aware results before navigating further.
Do not use when
- You have a visible source occurrence; use
jumpinstead. - You need arbitrary text, comments, or usages; use text search or
show_usage.
Request
{"requests":[{"queries":["UserService"],"language_id":"rust","kinds":["type"],"filter_params":{"include_paths":["src/**/*.rs"],"exclude_paths":[],"limit":20}}],"workspace_root":"/workspace/project"}Parameters
| Field | Required | Default / bounds |
|---|---|---|
requests | yes | One or more query groups, with at most 32 queries across all groups. |
requests[].queries | yes | One or more non-empty names; matching is case-insensitive and * enables glob matching. |
requests[].language_id | yes | LSP language identifier. |
requests[].kinds | no | [] (all); union of type, interface, function, module, member, event, constant. |
requests[].filter_params | no | Include/exclude globs and optional limit; excludes win. |
workspace_root | no | Active workspace routing. |
kinds uses language-agnostic categories:
| Category | Definitions included |
|---|---|
type | Classes, structs, interfaces, and enums |
interface | Interfaces and objects |
function | Functions, methods, and constructors |
module | Files, modules, namespaces, and packages |
member | Fields, properties, and enum members—not methods |
event | Events |
constant | Constants |
What it returns
Definitions grouped by matching query, with paths, symbol kind, hierarchy, signatures, and handles when available. Multiple matches are valid; choose by path, parent hierarchy, and kind. A * query can return matching file outlines. Pass a relevant handle to extract for more detail.
Common mistakes
- Grouping queries with different languages, kinds, or filters in one request group.
- Assuming the first match is the intended definition.
- Using
grep_definitionfor a dependency occurrence thatjumpcan resolve precisely.
Related tools
jump, outline, extract, show_usage