Directory Tree
directory_treeRetrieve a recursive JSON tree of files and directories within a specified path. Each entry includes name, type, and children for directories, formatted with 2-space indentation.
Instructions
Get a recursive tree view of files and directories as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed 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": {
"path": "<path>"
},
"name": "directory_tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| excludePatterns | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes |