Skip to main content
Glama

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

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.
Behavior5/5

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

With no annotations, the description fully discloses prerequisites (Figma bridge running), return structure (nested tree with node details), and error cases ('Figma not connected', timeouts). This meets the burden for behavioral transparency.

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 with clear sections (main, prerequisites, returns, errors, usage), and every sentence adds value. No redundant or verbose language.

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

Completeness5/5

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

Given the tool's simplicity (one parameter, no output schema), the description covers all essential aspects: purpose, prerequisites, return details, error behavior, and concrete usage advice. It also connects to sibling tools by mentioning node IDs can be used by capture_screenshot and analyze_design.

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?

The single parameter 'depth' is well-documented in the input schema with a description covering defaults, values, and performance implications. The description repeats this info in context but adds no new semantic meaning beyond the schema. Baseline 3 is appropriate given 100% schema coverage.

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

Purpose4/5

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

The description states 'Get the hierarchical node tree of the current Figma file, up to a configurable depth' which clearly identifies the action and resource. However, it does not explicitly differentiate from sibling tools like analyze_design or capture_screenshot, though the tool's purpose is distinct enough.

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

Usage Guidelines4/5

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

Explicitly recommends when to use the tool: 'at the start of a session to understand file structure...' and provides depth recommendations. It also mentions prerequisites and error behavior. However, it does not state when not to use it or provide alternatives, reducing clarity.

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/memi'

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