Skip to main content
Glama

document_symbols

Retrieve a hierarchical tree of all symbols defined in a file, including functions, classes, and variables, to see code structure at a glance.

Instructions

Get all symbols (functions, classes, variables, etc.) defined in a file as a hierarchical tree.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesRelative file path from project root

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the behavioral burden. It mentions 'hierarchical tree' as a return format, but lacks details on what specific symbol types are included, whether it includes nested symbols, or error behavior for invalid paths. It does not disclose any side effects, but it is a read operation.

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 a single sentence, directly stating the purpose and output format. It is front-loaded with the key action and resource, with no wasted words.

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 simple 1-parameter tool with no output schema, the description is fairly complete. It conveys the main purpose and output structure. However, it could be improved by noting specific symbol types (e.g., functions, classes) and whether the tree is collapsible, but these are minor given the tool's simplicity.

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 single parameter 'file' has 100% schema description coverage, already stating 'Relative file path from project root'. The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

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 retrieves all symbols (functions, classes, variables, etc.) defined in a file as a hierarchical tree. It uses a specific verb 'Get' and resource 'symbols in a file', distinguishing it from sibling tools like goto_definition or find_references, though it doesn't explicitly name them.

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

Usage Guidelines3/5

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

The description implies it is for file-level symbol listing, which contrasts with siblings like workspace_symbols (global search) or goto_definition (location-based). However, it doesn't explicitly state when to use it over these alternatives or provide exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.