Skip to main content
Glama

get_document_symbols

Get all symbols (types, methods, fields, and nested types) from a Java source file by providing the file path.

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
filePathYesPath to source file
includePrivateNoInclude private members (default true)
maxResultsNoMaximum symbols to return (default 500)
Behavior3/5

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

No annotations exist, so the description carries the burden. It discloses that output is hierarchical, includes locations/kinds/modifiers, and states the prerequisite. However, it does not mention potential errors, performance characteristics, or side effects. The disclosure is adequate but not comprehensive.

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 concise with three clear lines: purpose, usage, and output format, plus a prerequisite. It is front-loaded and avoids redundancy. Could be slightly more structured, but overall 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?

Given the tool's complexity (3 parameters, no output schema), the description covers purpose, usage, output format, and prerequisite. It omits error handling and edge cases, but for a simple symbol retrieval tool, it provides sufficient context for an agent to use it correctly.

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 coverage is 100%, so baseline is 3. The description does not add extra meaning to parameters like includePrivate or maxResults beyond what the schema provides. It only repeats 'Provide a file path' which matches the required filePath parameter. No additional semantics.

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 'Get all symbols (types, methods, fields) in a source file,' using a specific verb and resource. It distinguishes from sibling tools like get_symbol_info (single symbol) and get_type_members (type-level), and notes the prerequisite 'Requires load_project to be called first.'

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: 'Provide a file path to get all symbols in that file' and the prerequisite. While it doesn't explicitly contrast with alternatives like search_symbols, the context of siblings makes the use case clear. Implicitly, it's for bulk retrieval when all symbols in a file are needed.

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