get_page_tree
Retrieve the hierarchical node tree of a Figma file to understand its structure, locate frames by name, and obtain node IDs for screenshots or analysis, with configurable depth.
Instructions
Get the hierarchical node tree of the current Figma file, up to a configurable depth.
Prerequisites: Requires Figma bridge running and plugin connected.
Returns on success: Nested tree structure — top level is an array of page objects, each with { id, name, type: "PAGE", children: [] }. Children are frames, components, groups, and other nodes. Each node has { id, name, type, children? }. Node IDs from this tree can be passed directly to capture_screenshot or analyze_design.
Error behavior: Throws "Figma not connected" if no plugin is connected. Very high depth values may time out for large files.
Use this tool: at the start of a session to understand file structure and locate frames by name, to find node IDs without requiring manual selection in Figma, or to enumerate all pages before performing bulk operations. Use depth=1 to list pages only, depth=2 (default) to see top-level frames, depth=3+ to drill into component internals.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Maximum tree depth to traverse (default 2). Depth 1 = pages only, depth 2 = pages + top-level frames, depth 3+ = deeper into component trees. Large files at depth 4+ may be slow. |