dir_tree
Get a compact file and folder tree up to a specified depth for a quick overview of project structure.
Instructions
Returns a compact file and folder tree with depth limitation.
Agent usage guidelines: - Use this tool when you need to get a quick overview of the file and folder structure of a project or directory. - Use when you need to display or analyze the hierarchy of files and folders up to a certain depth. - Do not use for reading file contents or for non-existent/relative paths.
Path requirements: - The path must not contain URL-encoding (e.g., '%'). - The path must be absolute. - The path must exist on disk. Example paths: - Windows: "C:\Users\User\project" - Linux: "/home/user/project"
Args: root_path (str): Absolute path to the root directory. max_depth (int): Maximum nesting depth. Default is 1. output_format (str | None): Output format ('json' or 'markdown'). Defaults to server setting (markdown by default).
Returns: str | dict: File and folder tree in the requested format or error dict.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_depth | No | ||
| root_path | Yes | ||
| output_format | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |