Skip to main content
Glama
gclluch
by gclluch

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
analyze_fileA

High-level summary of every symbol in a Python file.

Lists classes (with dataclass/enum/Protocol/TypedDict classification), functions, async functions, methods and module-level assignments with line numbers. Start here when exploring an unfamiliar module.

Args: path: Path to a .py file.

list_functionsA

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.

get_function_bodyA

Extract the full source of a function or method, with line numbers.

Args: path: Path to a .py file. name: Function name, Class.method, or a dotted nested path.

list_methodsA

List every method of a class: declared, inherited, properties, class and static methods, plus class-level attributes.

Inherited members are only resolved for base classes defined in the same file; bases from other modules are reported as unresolved.

Args: path: Path to a .py file. type: Class name.

get_type_definitionA

Extract a class, TypeAlias, Enum, Protocol, TypedDict or NamedTuple definition with its members and source.

Args: path: Path to a .py file. name: Type name.

list_declarationsA

List module-level assignments with annotated or inferred types.

Args: path: Path to a .py file.

list_exportsA

List the public symbols of a module.

Respects __all__ when present, otherwise reports non-underscore module-level names, and flags re-exported imports.

Args: path: Path to a .py file.

list_importsB

List all imports: bound name, module path, relative level and aliases, grouped into stdlib / third-party / relative.

Args: path: Path to a .py file.

find_usagesA

Find every occurrence of an identifier with surrounding source lines.

Covers reads, assignments, parameters, attribute access, imports and global/nonlocal declarations. Always reports a project-wide references section: either the cross-file hits, or that there are none, or that jedi is not installed and cross-file references were therefore not checked. An empty result and an unchecked one are not the same answer.

Args: path: Path to a .py file. identifier: Name to search for. context: Lines of context to show around each hit (default 1).

call_graphA

Emit a Mermaid flowchart of the call relationships in a file or package.

Args: path: Path to a .py file. function: Optional root; only calls reachable from it are drawn. direction: Mermaid layout direction: TD, TB, LR, RL or BT. include_external: Include calls to names not defined in scope. scope: "file" (default) or "package" to walk every .py file in the containing directory.

get_callersA

Reverse call graph: who calls this function, directly and transitively.

Args: path: Path to a .py file. function: Function name or Class.method. scope: "file" (default) or "package".

code_complexityA

Cyclomatic complexity per function, with rank and decision-point breakdown.

Counts if/elif, for, while, except, comprehension fors and ifs, boolean operators, ternaries, and match cases other than the irrefutable one. Scores match radon cc --no-assert.

with and assert are deliberately not counted: neither branches. with still adds nesting depth.

Args: path: Path to a .py file. function: Optional single function to analyse in detail.

code_smellsA

Detect long functions, deep nesting, god classes, too many parameters, mutable default arguments, mutable @dataclass field defaults, high complexity, bare excepts and shadowed builtins.

Args: path: Path to a .py file. function: Optional single function to analyse.

find_errorsA

Find Python-specific hazards: bare/broad except, except: pass, handlers made unreachable by an earlier one, mutable default args, mutable @dataclass field defaults (an import-time ValueError), unawaited coroutines (best effort), assert used for runtime validation, late-binding closures over a loop or comprehension variable, == against None/True/False, is against a literal, and methods that never use self.

Args: path: Path to a .py file. function: Optional single function to analyse.

dead_codeA

Find unreferenced private and module-level symbols across a directory.

If path is a file, its containing directory is scanned so that cross-file references are seen.

Args: path: A .py file or a directory. include_tests: Also scan test files (default False).

find_implementationsA

Find classes implementing a Protocol or ABC, both explicitly (as a base class, including indirect subclasses) and structurally (method-set match).

Args: path: A .py file or directory; the containing directory is scanned. interface: Name of the Protocol/ABC/base class. Named interface rather than protocol to match the identical tool in the TypeScript server, so one vocabulary works across both.

get_docA

Extract a docstring and parse it into summary/params/returns/raises when it follows Google or NumPy style.

Args: path: Path to a .py file. name: Symbol name, Class.method, or "module" for the module docstring.

analyze_packageA

Directory-level summary of every .py file: sizes, class/function counts, docstrings and per-file symbol lists.

Args: path: Directory to analyse. include_tests: Include test files (default False).

diff_astA

Structural diff between two Python files: added, removed and modified functions, classes, methods, module variables, imports and __all__. Signature-level, not text-level.

Args: old_path: Path to the original file. new_path: Path to the updated file.

find_node_at_positionA

Identify the AST node at a cursor position with its enclosing scope chain.

Args: path: Path to a .py file. line: 1-based line number. column: 0-based column offset.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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