Skip to main content
Glama

analyze_method

Analyze a Java method in one call: get signature, parameters, exceptions, callers, callees, and overrides. Uses zero-based coordinates. Requires prior project load.

Instructions

Comprehensive method analysis in a single call.

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?

No annotations are provided, so the description must fully disclose behavior. It mentions zero-based coordinates and that it combines multiple analyses, but it does not state whether the operation is read-only, expensive, or has any side effects. For a comprehensive analysis tool, some behavioral context is missing.

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

Conciseness5/5

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

The description is concise and well-structured: a single sentence stating the purpose, followed by a bullet list of components, then usage guidance and a prerequisite. Every sentence serves a purpose, and the layout aids readability.

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 tool's complexity (5 params, no output schema), the description provides a thorough list of returned data (method info, callers, callees, etc.) and a prerequisite. It lacks mention of error conditions or return format but is largely complete for an aggregated analysis tool.

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?

The input schema covers all 5 parameters with descriptions (100% coverage). The description reinforces zero-based coordinates and hints at defaults for maxCallers/maxCallees, but does not add significant new semantic meaning beyond the schema. Thus it meets the baseline for high schema coverage.

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 provides 'comprehensive method analysis' and explicitly lists six components (method info, parameters, exceptions, incoming calls, outgoing calls, overrides). It distinguishes from sibling tools like get_method_at_position and call hierarchy tools, making its purpose precise and unique.

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 gives clear guidance to use this tool instead of multiple separate calls (e.g., get_method_at_position + call hierarchy tools), and notes the prerequisite 'Requires load_project to be called first'. However, it does not explicitly state when not to use it or describe alternative scenarios beyond the mentioned tools.

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