Skip to main content
Glama

find_method_references

Find all locations where a Java method is used as a method reference (Foo::bar) to analyze lambda-style usages and refactoring.

Instructions

Find all method reference expressions (Foo::bar lambda syntax).

JDT-UNIQUE: This fine-grained search is not available in LSP.

USAGE: Position on a method, or provide method details OUTPUT: All locations where the method is used as a method reference

Useful for:

  • Understanding functional programming patterns

  • Finding lambda-style usages of methods

  • Refactoring analysis

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 of the method
columnYesZero-based column number
filePathYesPath to source file containing the method
maxResultsNoMaximum results to return (default 100)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.4
  2. Removedv1.3.3
  3. First observedv1.2.0

TDQS

A4.2/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 burden and does so well: it discloses the zero-based coordinate system, the load_project prerequisite, and detailed semantics of the potentialMatches field (count is exact, locations listed, never counted as results). Output format and prerequisite are covered; return pagination/interaction with maxResults is left implicit.

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-loads the purpose and the JDT-UNIQUE differentiator, which is the highest-value information. The potentialMatches paragraph is long and the 'Useful for' bullet list largely restates an already-clear purpose, adding mild bloat, but the important content is well ordered.

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?

Despite having no output schema and no annotations, the description covers what the tool returns (all reference locations plus potentialMatches), the entry coordinate convention, and the required prior step. An agent has everything needed to call and interpret this correctly.

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 description coverage is 100%, so line, column, filePath and maxResults are already documented with zero-based notes. The description restates the zero-based constraint and the position-or-details pattern but adds no syntax beyond what the schema provides, so the baseline 3 applies.

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 a precisely-scoped resource ('method reference expressions (Foo::bar lambda syntax)'), which distinguishes it from the sibling find_references. The explicit JDT-UNIQUE note further tells the agent this fine-grained search is not available elsewhere, removing ambiguity about which tool to pick.

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

Usage Guidelines4/5

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

Gives concrete invocation context ('Position on a method, or provide method details') and a hard prerequisite ('Requires load_project to be called first'). It does not, however, name an explicit alternative tool or state when-not-to-use it versus find_references, so it stops just short of the top band.

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