Skip to main content
Glama

get_field_at_position

Retrieve Java field details including type, modifiers, and constant values by specifying file path and zero-based coordinates within the source code.

Instructions

Get field information at a specific position.

USAGE: Position on a field reference or declaration OUTPUT: Field type, modifiers, constant value if applicable

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
Behavior3/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 adds important context about 'ZERO-BASED coordinates' and the prerequisite 'load_project' requirement, which are valuable behavioral details. However, it doesn't describe error conditions, performance characteristics, or what happens with invalid positions. For a tool with no annotations, this represents moderate but incomplete transparency.

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 extremely well-structured and concise. It uses clear section headers (USAGE, OUTPUT, IMPORTANT) and every sentence adds essential information without redundancy. The four-line format with bullet-like sections is front-loaded and efficient, making it easy for an AI agent to parse quickly.

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 moderate complexity (position-based field analysis), no annotations, and no output schema, the description does a good job covering essentials: purpose, usage context, coordinate system, and prerequisites. However, without an output schema, the description should ideally provide more detail about the return format beyond 'Field type, modifiers, constant value if applicable.' The completeness is strong but not perfect for this context.

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%, so the schema already documents all three parameters (filePath, line, column) with their types and descriptions. The description adds the important 'ZERO-BASED coordinates' clarification, which provides additional semantic meaning beyond the schema's basic descriptions. This earns the baseline 3 score for when schema coverage is complete.

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: 'Get field information at a specific position' with details about what information is retrieved (field type, modifiers, constant value). It distinguishes from siblings like 'get_method_at_position' and 'get_type_at_position' by specifying it's for fields, but doesn't explicitly contrast with all analysis tools. The verb 'Get' is specific and the resource 'field information' is well-defined.

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 field reference or declaration' and 'Requires load_project to be called first.' This gives important prerequisites and positioning guidance. However, it doesn't explicitly state when NOT to use this tool or name specific alternatives among the many sibling analysis tools, which prevents a perfect score.

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