Skip to main content
Glama

get_method_at_position

Retrieve method signature, parameters, return type, modifiers, and exceptions at a specific line and column in a Java source file.

Instructions

Get method information at a specific position.

USAGE: Position on a method reference or declaration OUTPUT: Method signature, parameters, return type, modifiers, exceptions

IMPORTANT: Uses ZERO-BASED coordinates.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYesZero-based column number
lineYesZero-based line number
filePathYesPath to source file
Behavior4/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 of behavioral disclosure. It discloses the return format (signature, parameters, etc.), zero-based coordinate requirement, and dependency on load_project. It does not mention side effects, but read-only behavior is implied. No contradictions with annotations since none exist.

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, using a front-loaded format with headers (USAGE, OUTPUT, IMPORTANT). Every sentence is informative: main purpose, usage location, output, coordinate system, prerequisite. There is no redundancy or filler.

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 having no output schema, the description clearly lists the output components (method signature, parameters, return type, modifiers, exceptions). It covers the prerequisite (load_project), coordinate system detail, and usage context. Given the tool's complexity (3 required parameters, no nested objects), this description is complete and sufficient.

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?

Input schema has 100% coverage with descriptions for each parameter (e.g., 'Zero-based column number'). The description adds context by stating 'Position on a method reference or declaration' and reiterating zero-based coordinates. According to the scoring guidelines, baseline is 3 for high coverage; the description provides marginal added value beyond the schema.

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 retrieves method information at a specific position, using specific verb 'get' and resource 'method information'. It distinguishes from sibling tools like get_field_at_position and get_type_at_position by specifying 'method'. The USAGE line further clarifies the target: method reference or declaration.

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 provides clear usage context: position on a method reference or declaration, zero-based coordinates, and prerequisite that load_project must be called first. However, it does not explicitly state when not to use the tool or mention alternatives like get_field_at_position for fields, which would improve guidance.

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