Skip to main content
Glama
gclluch
by gclluch

list_functions

Get a complete inventory of functions and methods in a Python file, including signatures, annotations, decorators, and line ranges. Useful for code analysis and documentation.

Instructions

List all functions and methods with full signatures and line ranges.

Includes parameter annotations and defaults, return annotation, decorators, async flag, and nested function relationships.

Args: path: Path to a .py file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
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 a rich set of behavioral aspects: inclusion of parameter annotations, defaults, return annotations, decorators, async flag, and nested function relationships. However, it remains silent on performance, error handling, or recursion depth, which would be useful but are not critical for a non-mutating list 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 compact and well-organized. The first sentence gives the core purpose, followed by a concise bullet list of included features, and a simple Args block. Every sentence earns its place, with no redundant or filler content.

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?

The tool has a single parameter and an output schema, so the description needn't detail return structure. It nevertheless enumerates the key return elements (signatures, line ranges, annotations, decorators, nested relationships), making it sufficient for a listing tool. Minor omissions like handling of invalid paths or large files do not undermine completeness for typical usage.

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 description coverage is 0%, so the description must compensate. It does this via an explicit Args section: 'path: Path to a .py file.' This adds meaningful meaning beyond the schema's bare 'Path' title. While minimal, it fully clarifies the single parameter's purpose and type expectation.

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 tool's purpose with a specific verb ('List') and resource ('functions and methods'), and enriches it with defining details like 'full signatures and line ranges'. It also distinguishes from siblings by specifying the exact content (parameter annotations, decorators, async flag, nested relationships), making the intent unmistakable.

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 usage by stating what it lists, but provides no explicit guidance on when to choose this over sibling tools like list_methods or list_declarations. No alternatives or exclusions are mentioned, so the agent must infer context from the purpose alone.

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