Skip to main content
Glama
gclluch
by gclluch

list_declarations

Retrieve module-level variable declarations with annotated or inferred types from a Python file's AST, enabling quick inspection of typed assignments.

Instructions

List module-level assignments with annotated or inferred types.

Args: path: Path to a .py file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It adds useful behavioral context by noting that types are 'annotated or inferred', but it does not disclose potential limitations (e.g., file must be valid Python, what happens with syntax errors) or explicitly state that it is a read-only operation. This is 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: one sentence stating purpose plus a minimal Args section. It is front-loaded with the core behavior and contains no wasteful words or repetition.

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 simplicity (one parameter, output schema provided) and sibling context, the description is nearly complete. It explains what the tool does and what input it expects. Minor gaps like error handling or return format are covered by the output schema and are not critical for a listing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate for parameter meaning. It does so by explaining that 'path' is 'Path to a .py file', adding the critical fact that it expects a Python file path. This is clear and sufficient for the single parameter, though it could have added details on path resolution.

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 uses a specific verb ('List') and resource ('module-level assignments') with a distinguishing detail ('annotated or inferred types'). This clearly differentiates it from sibling tools like list_functions, list_methods, and list_imports, which cover different code elements.

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 clearly implies when to use the tool (to inspect module-level variable assignments), but it does not explicitly contrast it with alternatives like list_exports or list_imports, nor does it mention exclusions or prerequisites. Context is sufficient for a simple listing tool but lacks explicit guidance.

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/gclluch/py-ast-mcp'

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