Skip to main content
Glama

get_document_symbols

Extract symbols like types, methods, and fields from Java source files to analyze code structure and navigation.

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
maxResultsNoMaximum symbols to return (default 500)
includePrivateNoInclude private members (default true)
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. It discloses key behavioral traits: it returns a hierarchical list with locations, kinds, and modifiers, and mentions a prerequisite ('Requires load_project to be called first'). However, it doesn't cover potential rate limits, error conditions, or performance implications, leaving some gaps.

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, details, prerequisite), front-loaded with the core purpose. Every sentence adds value without redundancy, making it efficient and easy to parse.

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 complexity of a tool with 3 parameters, no annotations, and no output schema, the description does a good job by explaining the output format and prerequisite. However, it could improve by detailing error handling or performance limits, but it's largely complete for basic usage.

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 parameters (filePath, maxResults, includePrivate) with descriptions. The description adds no additional parameter semantics beyond what the schema provides, such as explaining symbol hierarchy or default behaviors, so it meets the baseline of 3.

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 verb 'Get' and the resource 'all symbols (types, methods, fields) in a source file,' which is specific and distinguishes it from sibling tools like 'get_symbol_info' or 'get_type_members' that focus on individual symbols or types rather than all symbols in a file.

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?

It explicitly states 'Requires load_project to be called first,' providing a clear prerequisite. It also distinguishes usage by specifying 'Provide a file path to get all symbols in that file,' which helps differentiate from tools like 'search_symbols' or 'get_project_structure' that operate differently.

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