get_document_tree
Retrieve a compact structural tree of a Figma document or subtree as a flattened columnar table, with depth and node id, name, type; scope by root, depth, or hidden layers.
Instructions
Compact structural tree of the whole document (or a subtree). Returns a flattened columnar table: fields lists the column names, rows holds one array per node in pre-order, and the depth column gives nesting level (depth 0 is the root, each +1 is a child of the nearest preceding row with depth-1). Every node is {id, name, type}; no extra fields unless requested. Default maxDepth is 3. Hidden layers are omitted unless includeHidden is true. Pass fields to pull extra per-node values (characters, fills, fillHex, fillCount, strokes, x, y, width, height, absoluteBoundingBox, strokeWeight, cornerRadius, fillStyleId, strokeStyleId, textStyleId, layoutMode, layoutWrap, layoutSizingHorizontal, layoutSizingVertical, layoutPositioning, primaryAxisAlignItems, counterAxisAlignItems, layoutGrow, itemSpacing, padding, visible, opacity). Use rootNodeId to scope to a frame/page and excludeTypes (e.g. ["VECTOR"]) to drop icon noise. verbose returns the nested tree instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Extra per-node fields. Add "characters" to include TEXT content. | |
| verbose | No | Return the nested {..., children:[...]} tree instead of the flattened columnar table. | |
| maxDepth | No | Levels of children to expand. Default 3. Omit for compact overview. | |
| rootNodeId | No | ||
| excludeTypes | No | ||
| includeHidden | No | Include hidden layers. Default false. |