Nodes
nodes
Pydantic models for AST node representations.
Each model captures the structural information that AI agents need to understand a Python library without reading its full source code.
ClassInfo
Bases: BaseModel
Metadata for a single class.
Example
cls = ClassInfo(name="Parser", line_start=1, line_end=50) cls.is_public True
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
is_public
property
Whether this class is part of the public API.
FunctionInfo
Bases: BaseModel
Metadata for a single function or method.
Example
fn = FunctionInfo(name="parse", line_start=10, line_end=25) fn.is_public True
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
is_public
property
Whether this function is part of the public API.
signature
property
Human-readable signature string.
FunctionKind
Bases: StrEnum
Classification of a callable based on its decorators.
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
ImportInfo
Bases: BaseModel
A single import statement.
Example
imp = ImportInfo(module="pathlib", names=["Path"]) imp.is_relative False
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
ModuleInfo
Bases: BaseModel
Full introspection result for a single Python module.
Example
mod = ModuleInfo(path=Path("foo.py")) len(mod.functions) 0
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
public_classes
property
Classes that are part of the public API.
public_functions
property
Functions that are part of the public API.
PackageInfo
Bases: BaseModel
Full introspection result for a Python package.
Example
pkg = PackageInfo(name="mylib", root=Path("src/mylib")) len(pkg.modules) 0
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
module_names
property
List of dotted module names.
public_api
property
All public functions and classes across the package.
ParameterInfo
Bases: BaseModel
A single function/method parameter.
Example
p = ParameterInfo(name="path", annotation="Path", default="None") p.name 'path'
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
SymbolKind
Bases: StrEnum
Filter enum for symbol search — superset of FunctionKind + class.
Used by search_symbols and the ast_search MCP tool to let
callers filter results by symbol type.
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
VariableInfo
Bases: BaseModel
A module-level variable or constant.
Example
v = VariableInfo(name="all", line=5) v.name 'all'
Source code in packages/axm-ast/src/axm_ast/models/nodes.py
WorkspaceInfo
Bases: BaseModel
Multi-package workspace introspection result.
Aggregates multiple PackageInfo from a uv workspace.
Example
ws = WorkspaceInfo(name="my-ws", root=Path("/ws")) len(ws.packages) 0