Explore the layer tree
fig_treeList layers under a Figma node by depth, returning a flat JSON hierarchy or indented outline. Use the cursor to continue browsing large subtrees.
Instructions
List the layers under a node, breadth-limited by depth (default 2, max 6). Returns a FLAT list in document order; each entry carries depth (relative to the requested root) and parent, so the hierarchy is reconstructable, and children (count) so you can see where to deepen. format:"outline" returns indented text lines instead of JSON and is roughly 4x denser for browsing. Large subtrees are truncated with truncated:true and a nextCursor you can pass back to continue.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path to the .fig / .figma file (absolute, or relative to the server CWD). | |
| root | No | Guid to start from, e.g. "2:1339". Defaults to the DOCUMENT node. | |
| depth | No | Levels below the root to include (default 2, max 6). | |
| types | No | Only include these node types, e.g. ["FRAME","TEXT"]. Depth still applies. | |
| cursor | No | Opaque nextCursor from a previous truncated response; resumes where it stopped. | |
| format | No | Default "json". |