tree_scope
Scan a directory and return a compact JSON listing of files and folders with sizes, depths, and order indices for validating mindmap injection.
Instructions
Scan a directory and return compact telemetry (no file content).
Returns a JSON array where each entry is: {title, type, size, oi, parent, depth}
type: "dir", "file", or "root"
size: human-readable for files (e.g. "2.3KB"), item count for dirs
oi: 1-based order_index (matches what tree_to_mindmap would produce)
parent: order_index of the parent node
depth: nesting level (0 = root's direct children)
Use this BEFORE inject_directory_to_mindmap to get a reference count of expected nodes (1 root + N dirs + M files). After injection, compare the summary's total_nodes with this count to validate — no need to call get_mindmap afterwards.
Does NOT read file content — just names, sizes, and structure. Hidden files and VCS dirs are skipped automatically.
Args: root_path: absolute path to the directory to scan root_title: title for the root entry (empty = use directory name) max_depth: maximum nesting depth to scan (default 10)
Returns: JSON string — array of compact scope entries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_depth | No | ||
| root_path | Yes | ||
| root_title | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |