Skip to main content
Glama

find_references

Locates all references to a Java symbol across your project. Position on a symbol to see every usage with context.

Instructions

Find all references to a symbol across the project.

USAGE: Position on symbol, find all usages OUTPUT: List of reference locations with context

The references of a symbol of a class file, such as a JDK method, are those in the project's source files. A position on a name the compiler cannot resolve has no symbol: SYMBOL_NOT_FOUND. maxResults outside 0 to 1000 is INVALID_PARAMETER.

IMPORTANT: Uses ZERO-BASED coordinates.

potentialMatches, present only when there are any, holds the places JDT's search reports as possible matches but cannot confirm, because a type or name there does not resolve (a missing dependency or a compile error): count is their exact number, and locations lists them, as many as the results it stands beside may list. They are never counted or listed as results.

Requires load_project to be called first.

Input Schema

NameRequiredDescriptionDefault
lineYesZero-based line number
columnYesZero-based column number
filePathYesPath to source file
maxResultsNoMax references to return, 0 to 1000 (default 100)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.3
    • changedInput schema / properties / maxResults / description
      Previous value: -"Max references to return (default 100)"New value: +"Max references to return, 0 to 1000 (default 100)"
  2. Addedv1.3.4
  3. Removedv1.3.3
  4. First observedv1.2.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does so well: it discloses the SYMBOL_NOT_FOUND error for unresolvable names, the INVALID_PARAMETER condition for maxResults, the zero-based coordinate convention, and the subtle semantics of potentialMatches (unconfirmed matches never counted as results). The load_project prerequisite is also stated, which is essential operational context.

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

Conciseness4/5

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

Front-loaded purpose then USAGE/OUTPUT headers make it scannable, and the prerequisite sits at the end where it is easy to catch. The potentialMatches paragraph is dense and somewhat long, but each clause explains a genuinely non-obvious return behavior, so the length is largely earned.

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

Completeness4/5

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

There is no output schema, so the description must explain returns, and it does: 'List of reference locations with context' plus the detailed potentialMatches breakdown. Combined with error conditions and the load_project prerequisite, an agent has enough to call and interpret this tool correctly; only alternative-tool routing is absent.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: it reinforces the zero-based convention as an 'IMPORTANT' caveat and restates the maxResults validity window (0-1000) as an error condition rather than just a default.

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

Purpose4/5

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

States a specific verb+resource: 'Find all references to a symbol across the project.' An agent understands this is a usage-search tool. However, it does not distinguish itself from near-siblings like find_method_references or find_annotation_usages, so the boundary is inferred from the name rather than stated.

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

Usage Guidelines3/5

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

'USAGE: Position on symbol, find all usages' implies you must first have a cursor position, and the closing line states the load_project prerequisite. There is no when-not guidance and no routing to alternative reference-search tools among the many siblings.

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