Skip to main content
Glama

get_call_hierarchy_incoming

Find all incoming calls for a Java method before changing it to assess dependencies and avoid breaking callers. Load the project first; use zero-based cursor coordinates.

Instructions

Find all callers of a method (incoming calls).

USAGE: Position cursor on a method name OUTPUT: List of methods that call this method

IMPORTANT: Uses ZERO-BASED coordinates.

Useful for understanding who depends on a method before changing it.

The callers of a method of a class file, such as a JDK method, are those in the project's source files. maxResults outside 0 to 500 is INVALID_PARAMETER.

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 callers to return, 0 to 500 (default 50)

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses the maxResults bound and the INVALID_PARAMETER failure mode, the load_project prerequisite, the output shape, and how potentialMatches ('never counted or listed as results') behaves. It doesn't state read-only/reversibility explicitly, but the query nature is evident.

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 core purpose and uses labeled USAGE/OUTPUT/IMPORTANT sections, which is easy to scan. It is somewhat long and mildly redundant ('all callers' restated as 'List of methods that call this method'), but nearly every sentence earns its place given the absent output schema.

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?

For a 4-param query tool with no annotations and no output schema, the description covers output format, coordinate convention, bounds/error behavior, an edge case (potentialMatches) and a prerequisite. Nothing an agent needs to invoke it correctly is missing.

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% (baseline 3), and the description adds real value on top: it stresses ZERO-BASED coordinates and specifies that maxResults outside 0-500 is INVALID_PARAMETER. These constraints are behavioral semantics the schema alone doesn't fully convey.

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+resource ('Find all callers of a method') and scopes it with '(incoming calls)', which cleanly distinguishes it from the sibling get_call_hierarchy_outgoing and other reference-style tools. An agent can identify the operation immediately.

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 clear context for use ('understanding who depends on a method before changing it'), a positional prerequisite ('Position cursor on a method name'), and a hard dependency ('Requires load_project to be called first'). It does not name explicit alternatives such as find_references, so it stops short of a 5.

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