Skip to main content
Glama

get_document_symbols

Retrieves all symbols (types, methods, fields) from a Java source file, returning a hierarchical list with locations, kinds, and modifiers. Requires load_project to be called first.

Instructions

Get all symbols (types, methods, fields) in a source file.

USAGE: Provide a file path to get all symbols in that file OUTPUT: Hierarchical list of all types, methods, fields, and nested types

Returns symbols with their locations, kinds, and modifiers.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum symbols to return (default 500)
filePathYesPath to source file
includePrivateNoInclude private members (default true)
Behavior3/5

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

With no annotations, the description carries the full burden. It states the output is a hierarchical list with locations, kinds, and modifiers, and mentions the prerequisite. However, it omits limitations (maxResults), side effects, or permission requirements, making it adequate but not rich.

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 structured with clear sections (purpose, usage, output) and is front-loaded. It is concise with 4-5 sentences, each adding information. Slight room for improvement by merging lines.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters (all documented in schema) and no output schema, the description explains the output structure and prerequisite. However, it fails to mention maxResults and includePrivate parameters, which are relevant for callers. Completeness is just adequate.

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 schema covers all three parameters with 100% description coverage. The description only mentions filePath, adding no value beyond the schema for maxResults or includePrivate. Baseline 3 is correct.

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 all symbols (types, methods, fields) from a source file. This is a specific verb+resource pair, and it distinguishes itself from sibling tools that analyze symbols rather than simply listing them.

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 explicit usage instructions ('Provide a file path') and notes a prerequisite ('Requires load_project to be called first'). However, it does not contrast this tool with alternatives like search_symbols or get_symbol_info, nor does it specify when not to use it.

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