Skip to main content
Glama

get_super_method

Identify the superclass or interface method that a Java method overrides or implements from a given file position. Use it to trace inherited method declarations.

Instructions

Find the method that this method overrides or implements.

USAGE: Position on a method that overrides/implements another OUTPUT: The superclass/interface method being overridden

The overridden method is the one the compiler binds: the nearest declaration in the superclass chain, else in the interfaces, visible from the method's package. unresolvedSupertypes, present only when there are any, names each supertype of the declaring type the compiler cannot resolve (a missing dependency), as the declaration writes it, with the type whose declaration names it: the method may override a method of one of them.

IMPORTANT: Uses ZERO-BASED coordinates.

Requires load_project to be called first.

Input Schema

NameRequiredDescriptionDefault
lineYesZero-based line number
columnYesZero-based column number
filePathYesPath to source file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.4
  2. Removedv1.3.3
  3. 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 burden and does so substantively: it explains the compiler binding rule (nearest superclass declaration, else interface, visible from the method's package), the conditional unresolvedSupertypes output field, the zero-based coordinate system, and the load_project prerequisite. It omits error behavior for positions that are not on a method, but the disclosure is well above average for an annotation-free tool.

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

Conciseness3/5

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

Purpose is correctly front-loaded and the USAGE/OUTPUT labels aid scanning. The unresolvedSupertypes paragraph is a dense, hard-to-parse run-on that is longer than its practical value warrants, dragging down an otherwise tight structure.

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 describe returns, and it does ('OUTPUT: The superclass/interface method being overridden'), plus it covers the extra unresolvedSupertypes field and the load_project prerequisite. Only the failure mode (position not on an overriding method) is left unaddressed.

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% and all three parameters are documented in the schema, including the zero-based convention, so the baseline is 3. The description's 'IMPORTANT: Uses ZERO-BASED coordinates' repeats what the schema already states rather than adding format or semantics beyond it.

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 and resource: 'Find the method that this method overrides or implements.' An agent immediately grasps the operation. However, it never distinguishes itself from adjacent siblings such as find_implementations (the inverse direction) or get_type_hierarchy, which an agent could confuse with this tool.

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?

'USAGE: Position on a method that overrides/implements another' gives a clear precondition for invocation, and 'Requires load_project to be called first' states a required prerequisite. It does not, however, name when to prefer this over find_implementations or get_type_hierarchy, so there is no exclusion/alternative guidance.

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