List dir
list_dir
ListDirTool — directory listing with file metadata.
Registered as list_dir via the axm.tools entry point.
ListDirTool
Directory listing with file metadata for AI agents.
Lists files and directories within a sandboxed root directory.
Supports recursive listing via max_depth. Hidden entries and
build artefacts (__pycache__, node_modules, etc.) are
skipped automatically.
Registered as list_dir via axm.tools entry point.
Source code in packages/axm-edit/src/axm_edit/tools/list_dir.py
name
property
Tool name used for MCP registration.
execute(*, path='.', max_depth=1, **kwargs)
List files and directories in a project directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Root directory to list (default "."). |
'.'
|
max_depth
|
int
|
Recursion depth — 1 for immediate children only, >1 for nested listing (default 1). |
1
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with entries list (name, path, type, |
ToolResult
|
size_bytes), count, and truncated flag. |
Source code in packages/axm-edit/src/axm_edit/tools/list_dir.py
render_text(*, entries, count, truncated)
Render a compact, ls-style LLM-facing view of the listing.
One entry per line, using the relative path (which subsumes name
and encodes the directory hierarchy when max_depth > 1). Directories
get a trailing /; files carry a compact human-readable size. The
header carries the total entry count, the dir/file split, and an explicit
TRUNCATED flag when the entry cap was reached. Every entry (path,
type, size) and the truncation signal are preserved verbatim, so no
information is lost relative to data.