# TreeRequest

Request for recursive directory listing. Designed for AI agents understanding codebase structure.

**Kind:** an object, used in requests.

## Fields

| Field | Type | Required | Description |
|---|---|---|---|
| `path` | `string` |  | Starting path. Defaults to "/". |
| `maxDepth` | `integer` |  | Maximum depth to recurse. -1 for unlimited. |
| `includeFiles` | `boolean` |  | Include files in output (not just directories). |
| `includeHidden` | `boolean` |  | Include hidden files/directories. |
| `pattern` | `string \| null` |  | Glob pattern to filter results (optional). |

## Example

```json
{
  "path": "...",
  "maxDepth": 0,
  "includeFiles": false,
  "includeHidden": false,
  "pattern": "..."
}
```

## Where it's used

- [`vfs.open(name).tree`](https://docs.maitento.com/reference/api/vfs.md) (`POST /namespaces/{namespaceName}/vfs/by-name/{name}/tree`)
- [`vfs.openById(id).tree`](https://docs.maitento.com/reference/api/vfs.md) (`POST /vfs/by-id/{id}/tree`)
