Skip to main content
Glama

analyze_method

Analyzes a Java method by file path and zero-based coordinates, returning signature, parameters, exceptions, callers, callees, and override details in a single call.

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?

No annotations are provided, so the description carries the full burden. It describes the combined output and zero-based coordinate requirement but does not discuss performance implications, potential latency, or any side effects. Basic behavioral disclosure is present but not exhaustive.

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-structured with a clear header, usage example, output list, combined list, and important notes. Each line adds value and is easy to parse. Slight improvement could be replacing the angle-bracketed example with actual values.

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 no output schema, the description comprehensively outlines the return fields and prerequisites. It also provides context on when to use this tool versus siblings, making the overall definition complete for an AI agent.

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?

Input schema has 100% description coverage, so baseline is 3. The description adds value by clarifying zero-based coordinates, providing a usage example, and explaining how maxCallers/maxCallees relate to the output list. This justifies a 4.

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 'Comprehensive method analysis in a single call' and lists all included analyses. It distinguishes itself from siblings like get_method_at_position and call hierarchy tools by combining their functionality.

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?

It explicitly recommends using this tool instead of multiple separate calls for method info and hierarchy. It also notes the prerequisite 'Requires load_project to be called first' and provides a usage example. However, it doesn't mention scenarios where individual tools might be preferred.

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