The directory_tree tool's implementation doesn't match its documented behavior.
Expected behavior (per tool description):
- Returns a recursive tree view of files and directories
- Each directory entry includes a children array containing its nested items
- Provides a hierarchical JSON structure
Actual behavior:
- Returns only immediate children (non-recursive)
- No children property in the output
- Returns a flat array instead of a tree structure
Current output:
[
{"name": "file1.txt", "type": "file"},
{"name": "subdir", "type": "directory"}
]
Expected output:
[
{"name": "file1.txt", "type": "file"},
{
"name": "subdir",
"type": "directory",
"children": [
{"name": "nested.txt", "type": "file"},
{
"name": "deeper",
"type": "directory",
"children": []
}
]
}
]
This breaks compatibility with the original @modelcontextprotocol/server-filesystem that this project claims to reimplement.