find_usages
Find symbol references grouped by definitions, imports, and usages. Filter by scope, kind, language, and limit results. Include context lines for surrounding code.
Instructions
Use INSTEAD OF Grep for finding symbol references. Semantic search — groups by: definitions, imports, usages. Supports scope, kind, limit, lang filters. Use context_lines to include surrounding code. HINT: for very short / generic symbols (≤4 chars like id, err, Cmd, db) Grep is usually cheaper than find_usages — the semantic grouping doesn't pay off when the symbol resolves ambiguously across thousands of files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Symbol name to find usages of | |
| scope | No | Filter results by path prefix (e.g., "src/Domain/") | |
| kind | No | Show only specific section (default: "all") | |
| limit | No | Max results per category (default: 50, max: 500) | |
| lang | No | Filter by language/extension (e.g., "php", "typescript") | |
| context_lines | No | Lines of source context around each match (0-10). When set, shows surrounding code — saves follow-up read_symbol calls. | |
| mode | No | Output mode: full (with context, default), list (file:line only, 5-10x smaller for initial discovery) |