find_references
Enumerate every use site of a symbol as path:line, including inline expressions, assignments, and type references, not just calls.
This is the broader sibling of get_callers. get_callers answers "what would break if I change this function's behaviour"; find_references answers "everywhere this name is mentioned", which is what you want before a rename.
Input schema
{
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Symbol to enumerate references of (bare name or full signature)"
},
"path": {
"type": "string",
"description": "Optional repo-relative file-path hint to disambiguate overloaded names"
}
},
"required": ["symbol"],
"additionalProperties": false
}
Ambiguity is reported, not guessed
A bare name defined in more than one place returns the candidates rather than picking one, so a rename never silently targets the wrong symbol. Disambiguate with the path hint, or pass a full signature such as method:Widget.area instead of area.
For the same reason, a bare call to a name defined in several files may be left unindexed rather than attributed to a guess. An empty result for an ambiguous name is a refusal to mis-target, not a claim that no uses exist.
Output
Use sites as path:line, one per line. When a language has no occurrence lines yet, the tool falls back to the definitions of calling symbols so the answer degrades rather than disappearing, and says so.
When to use
- Before a rename, where missing a type annotation or a re-export is what breaks the build.
- Auditing a symbol's reach across languages, since the occurrence store is language-agnostic.
Notes
- Available over both stdio and SSE.
- Requires Phase B for full fidelity. Check
get_index_statusif results look thin: a language reportingunavailablehas no analyzer installed, so its use sites were never recorded. - The CLI equivalent is
travsr references <symbol>.