Skip to main content
← MCP Tools

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.

Availability: single-repo stdio (travsr mcp) and global stdio (travsr mcp --global). Not served over SSE.

Input schema​

{
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Symbol to enumerate references of (bare name or full signature)"
},
"path": {
"type": "string",
"description": "Optional path hint to scope an overloaded name to a file or directory: a filename, a relative path, a directory prefix, or a path fragment (e.g. ppr.rs, src/ppr.rs, crates/travsr-retrieval, retrieval)"
},
"repo": {
"type": "string",
"description": "Repo name (run repos_list to discover). Only present in global (multi-repo) sessions."
}
},
"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.

A name that resolves to no definition at all is answered with [note: No symbol named 'x' in this repo. find_references needs the whole name; search_symbol finds partial matches.], which is a different statement from an empty list of uses for a symbol that exists.

Each Phase B run replaces a file's recorded reference lines and scip-labeled caller edges rather than adding to them, so a line from an earlier run that has since changed no longer appears.

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 format​

Plain text (wrapped in a <travsr-data> envelope). Opens with a resolved: header naming the exact definition the symbol resolved to, in the same label (kind), em-dash, path:line shape get_callers uses (see the example), then a N reference(s): count line, then one path:line per use site, in no particular order. A live (unratified, resolved from an uncommitted edit) or heuristic (text-matched, not graph-resolved) site gets a trailing marker on its line; a normal graph-resolved site gets none. Past a row cap, the list ends with [truncated: showing N of M sites]. When a language has no occurrence lines yet, the tool falls back to the definitions of calling symbols instead, under a N caller definition(s) (exact occurrence lines unavailable for this language, showing caller definitions): header, so the answer degrades rather than disappearing.

When the name resolves to several Objective-C selectors of one method family (for example initWithFrame: and initWithFrame:style: on the same class), the header is instead resolved: N selector(s) of one method family:, followed by one indented line per selector, and the sites listed are the union of all of them.

Example response: Run against the Travsr repository itself with { "symbol": "wrap_envelope" } (trimmed):

resolved: fn:wrap_envelope (function) — crates/travsr-mcp/src/sanitize.rs:138
19 reference(s):
crates/travsr-mcp/src/observability.rs:19
crates/travsr-mcp/src/observability.rs:287
crates/travsr-mcp/src/sanitize.rs:55
crates/travsr-mcp/src/tools.rs:13
crates/travsr-mcp/src/tools.rs:676

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​

  • Requires Phase B for full fidelity. Check get_index_status if results look thin: a language reporting unavailable has no analyzer installed, so its use sites were never recorded.
  • The CLI equivalent is travsr references <symbol>.