Skip to main content
Glama

find_references

Read-onlyIdempotent

Find where an identifier is defined and used as file and line numbers to assess dependencies before editing shared code. Lexical matching, not a call graph.

Instructions

Finds where an identifier is defined and where it is used, as file and line numbers. Use it before editing a shared function or type, to see what depends on it, or when you know the name but not the file. These are LEXICAL matches: a same-named identifier in another class, a comment or a string counts as a match too. It is not a call graph — it does not resolve which Charge a given call site means. Prefer anyindex_search when you want code by meaning rather than by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoRestrict to one file, path relative to the indexed root
symbolYesExact identifier to look for, e.g. startWatcher
maxResultsNo
includeDefinitionsNoInclude the sites where the identifier is declared

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
truncatedYes
otherFilesYes
referencesYes
definitionsYes
lexicalOnlyYes
matchedChunksYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantive semantics beyond them: matches are LEXICAL, so same-named identifiers in other classes, comments and strings count, and call sites are not resolved. This is exactly the caveat an agent needs to trust results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four tight sentences, zero filler, ordered from what it does to when to use it to the lexical caveat to the alternative. Every sentence carries distinct decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return format need not be restated. With annotations covering the safety profile and the description covering lexical-matching limits and sibling routing, nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75%, with file, symbol and includeDefinitions documented in the schema itself. The description clarifies the matching semantics of `symbol` (exact identifier) and implies definition-site results, but adds no syntax or default details for file or maxResults. Baseline 3 fits when the schema does most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('finds where an identifier is defined and where it is used') plus the output shape (file and line numbers). It explicitly separates itself from the sibling anyindex_search, so an agent can disambiguate without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete triggers ('before editing a shared function or type', 'when you know the name but not the file') and an explicit exclusion rule ('It is not a call graph'), plus a named alternative with its selecting condition.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.