Skip to main content
Glama

get_document_symbols

Extract symbols like functions, classes, and variables from Python code to analyze structure and identify elements for navigation or documentation.

Instructions

Get all symbols in a Python document.

Returns document symbols including functions, classes, variables, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython code as string.
python_pathNoOptional path to Python interpreter.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/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 mentions the return includes 'document symbols including functions, classes, variables, etc.', which adds some behavioral context about output content. However, it lacks details on performance (e.g., handling large code), error conditions, or dependencies like the 'python_path' parameter's effect, leaving gaps in transparency.

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 two sentences: the first states the purpose, and the second clarifies the return content. It's front-loaded with the main action. There's no wasted text, though it could be slightly more structured by explicitly separating purpose and output details.

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 the tool's moderate complexity (analyzing code for symbols), 100% schema coverage, and the presence of an output schema (implied by 'Has output schema: true'), the description is minimally adequate. It covers what the tool does and the return types, but lacks usage context, error handling, or examples, making it incomplete for optimal agent guidance.

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 fully documents parameters ('code' as Python code string, 'python_path' as optional interpreter path). The description adds no additional meaning beyond this, such as examples or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to heavily.

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 all symbols in a Python document' with specific examples like 'functions, classes, variables, etc.' This distinguishes it from siblings like 'get_definition' (specific symbol) or 'get_completions' (suggestions). However, it doesn't explicitly contrast with 'find_references' (which might find symbol usage), leaving some ambiguity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios like code analysis, navigation, or comparison with siblings such as 'get_definition' (for a single symbol) or 'find_references' (for symbol usage). This lack of context makes it harder for an agent to choose appropriately.

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/daedalus/mcp-pyright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server