get_directory_tree
Display a visual directory tree showing only folders, with adjustable depth. For Xcode projects, accepts .xcodeproj or .xcworkspace paths to show project root structure.
Instructions
Get a visual tree of directories (folders only) in the specified path.
Shows the folder structure as a tree diagram with box-drawing characters. Does not include individual files - use get_directory_listing for file details.
Special behavior: If directory_path ends with .xcodeproj or .xcworkspace, the tree will show the parent directory structure (since these are typically at the root of a project folder).
Args: directory_path: Path to directory to scan. Can also be a .xcodeproj or .xcworkspace path (will scan parent directory in that case). max_depth: Maximum recursion depth (default 4, prevents excessive output). Depth 1 = immediate subdirectories only, Depth 4 = up to 4 levels deep.
Returns: A visual tree representation showing only directories/folders, with a note about using get_directory_listing for file-level details.
Example:
/Users/you/Projects/MyApp/
├── Sources/
│ ├── Models/
│ └── Views/
├── Tests/
└── Resources/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory_path | Yes | ||
| max_depth | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |