Skip to main content
Glama

analyze_method

Analyze a Java method in a single call: get signature, parameters, exceptions, incoming/outgoing calls, and override info. Uses zero-based line/column coordinates.

Instructions

Comprehensive method analysis in a single call.

USAGE: analyze_method(filePath="path/to/File.java", line=N, column=N) OUTPUT: Method info, parameters, exceptions, callers, callees, override info

Combines:

  • Method info (signature, modifiers, return type)

  • Parameters with types

  • Declared exceptions

  • Incoming calls (who calls this method)

  • Outgoing calls (what this method calls)

  • Override information (super method, overriding methods)

Use this instead of multiple calls to get_method_at_position + call hierarchy tools.

IMPORTANT: Uses ZERO-BASED coordinates.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to source file
lineYesZero-based line number
columnYesZero-based column number
maxCallersNoMaximum callers to return (default 20)
maxCalleesNoMaximum callees to return (default 50)
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that coordinates are zero-based and that the tool combines multiple analyses. However, it does not mention whether the tool is read-only, potential performance impact, authorization requirements, or error handling.

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?

The description is well-organized with USAGE, OUTPUT, and a bullet-style list of combined information. It is reasonably concise, though the list of outputs could be slightly more compact. Overall, it is front-loaded with the core purpose.

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?

Given the absence of an output schema, the description effectively outlines the expected return values. It includes prerequisites (load_project) and a usage example. While it could mention error conditions or limits, it provides sufficient context for an agent to use the tool 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 coverage is 100%, so the schema already describes all parameters. The description illustrates usage with filePath, line, and column in an example, and indirectly references maxCallers/maxCallees via the default values in the schema. It adds minimal meaning beyond the schema, achieving the baseline of 3.

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?

The description clearly states the tool performs 'comprehensive method analysis', listing specific outputs (method info, parameters, exceptions, callers, callees, override info). It distinguishes itself from sibling tools like get_method_at_position and call hierarchy tools by stating it combines them.

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?

The description explicitly recommends using this tool instead of multiple calls to get_method_at_position and call hierarchy tools. It also provides a usage example and notes the prerequisite load_project. However, it does not specify when not to use it or list alternatives beyond the combination hint.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pzalutski-pixel/javalens-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server