list_directory
Lists directory contents with entry type, size in bytes, and child counts. Recurses into subdirectories while honoring .gitignore rules and skipping node_modules, pycache, and .git.
Instructions
List the contents of a directory.
Each entry has a type field: 'dir' for directories, 'file' for files.
Use max_depth > 1 to recurse into subdirectories. Automatically ignores
__pycache__, node_modules, and .git, plus nested .gitignore/.ignore
rules. Returns entry type, size in bytes, and child count for directories.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"absolute_dir_path": "<absolute_dir_path>"
},
"name": "list_directory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_depth | No | How many levels deep to recurse (default: 1 = direct children only). | |
| max_entries | No | Maximum total entries to return. Defaults to server config (200). | |
| include_hidden | No | Include entries starting with '.' (default: false). | |
| absolute_dir_path | Yes | The absolute path to the directory to list. | |
| respect_gitignore | No | Honor nested .gitignore/.ignore files when filtering (default: server default, true). Set false to include ignored entries. |