Skip to main content
Glama

go_to_definition

Navigate from Java symbol references to their definitions to understand code structure. Returns file path, line, and column coordinates for precise location.

Instructions

Navigate to symbol definition.

USAGE: Position cursor on a symbol reference, returns definition location. OUTPUT: File path, line, column of the definition.

IMPORTANT: Uses ZERO-BASED coordinates. If editor shows 'Line 14, Column 5', pass line=13, column=4

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to source file (absolute or relative to project)
lineYesZero-based line number
columnYesZero-based column number
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the tool returns definition location (file path, line, column), uses zero-based coordinates with specific conversion examples, and has a dependency on 'load_project'. It doesn't mention error conditions, performance characteristics, or whether it modifies state, but covers the essential operational context well.

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 well-structured with clear sections (purpose, usage, output, important notes, prerequisites) and every sentence adds value. It's appropriately sized for a tool with 3 parameters and no annotations, with no redundant information. The zero-based coordinate explanation is particularly efficient.

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?

For a navigation tool with 3 parameters, 100% schema coverage, and no output schema, the description provides good contextual completeness. It explains what the tool does, how to use it, what it returns, coordinate system details, and prerequisites. The main gap is lack of output schema, but the description adequately describes the return format. It could benefit from mentioning error cases or limitations.

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%, providing complete parameter documentation. The description adds value by explaining the zero-based coordinate system with concrete conversion examples ('If editor shows Line 14, Column 5, pass line=13, column=4'), which clarifies the parameter semantics beyond the schema's basic descriptions. However, it doesn't elaborate on filePath format or validation rules.

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?

The description clearly states the tool's purpose as 'Navigate to symbol definition' with the specific action of positioning the cursor on a symbol reference. It distinguishes from siblings like 'find_references' or 'get_symbol_info' by focusing on navigation to definition locations rather than finding usages or getting symbol metadata. However, it doesn't explicitly contrast with all similar tools like 'get_enclosing_element' or 'get_type_at_position'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Position cursor on a symbol reference' indicates when to use it, and 'Requires load_project to be called first' specifies a critical prerequisite. It doesn't mention alternatives, but the context is clear enough for an agent to understand this is for navigating to definitions rather than analyzing or finding references.

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