Skip to main content
Glama

get_page_tree

Retrieve the hierarchical structure of a Figma file to locate frames, components, and nodes by name. Use this tool to understand file organization and obtain node IDs for automated operations without manual selection.

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 figma_execute.

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

TableJSON Schema
NameRequiredDescriptionDefault
depthNoMaximum 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.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes prerequisites ('Requires Figma bridge running and plugin connected'), error behavior ('Throws "Figma not connected" if no plugin is connected'), performance implications ('Very high depth values may time out for large files'), and output usage ('Node IDs from this tree can be passed directly to capture_screenshot or figma_execute'). It lacks details on rate limits or authentication needs, but covers key operational aspects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by prerequisites, returns, error behavior, and usage guidelines. Each sentence adds value without redundancy, such as explaining depth configurations and practical applications, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description does an excellent job covering prerequisites, error handling, performance, and usage scenarios. It could be slightly more complete by detailing the exact structure of returned nodes (beyond mentioning types like frames and components) or listing all possible node types, but it provides sufficient context for effective tool use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'depth' parameter thoroughly with default values and usage examples. The description reinforces this by explaining depth levels (depth=1 for pages only, etc.) and performance warnings, but adds minimal new information beyond what the schema provides, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get the hierarchical node tree of the current Figma file, up to a configurable depth.' It specifies the verb ('Get'), resource ('hierarchical node tree'), and scope ('current Figma file'), distinguishing it from siblings like get_selection (which gets selected nodes) or capture_screenshot (which captures visuals).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to 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.' It also gives depth-specific examples (depth=1 for pages only, depth=2 for top-level frames, depth=3+ for component internals) and mentions performance considerations for large files.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sarveshsea/m-moire'

If you have feedback or need assistance with the MCP directory API, please join our Discord server