Skip to main content
Glama

get_layout_tree

Retrieves a flat pre-order layout tree for a Figma subtree, including geometry, auto-layout, sizing, and visibility, to inspect structure and diagnose layout issues.

Instructions

Flat geometry dump of a subtree (pre-order): id, name, type, parentId, depth, absolute x/y/width/height (absoluteBoundingBox), absoluteRenderBounds, rotation, visible, and layoutMode/padding/itemSpacing, layoutPositioning, sizing (hug/fill/fixed), constraints where relevant. rootId defaults to the current page. truncated is true when maxNodes was hit.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_layout_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoTarget file (fileKey, id or name). Defaults to the most recently active file.
rootIdNoRoot node or page id; default current page
maxDepthNoMax depth below root (default unlimited)
maxNodesNoDefault 2000
includeHiddenNoInclude hidden nodes (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden and does deliver the most important behavioral fact: results are silently capped and flagged via `truncated` when maxNodes is hit, which is not derivable from the schema. It still leaves gaps on the read-only nature, coordinate units, error behavior for an invalid rootId, and whether hidden nodes affect depth counting even though includeHidden defaults to true.

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

Conciseness4/5

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

It is front-loaded with the operation and result shape, and every clause either enumerates a returned field or states a default/truncation rule. The field enumeration is dense and run-on but not padded; a short split into 'returns' and 'parameters' would read better without changing length.

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?

There is no output schema, so the description must describe return values, and it does so field-by-field including the truncation sentinel, which is exactly what an agent needs to parse the result. It is close to complete for a moderately complex read tool; the only real omissions are error conditions and what the nodes are ordered by beyond 'pre-order'.

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 every parameter already carries its own meaning and defaults, making 3 the baseline. The description reinforces the rootId default and links maxNodes to the `truncated` output, but adds no new semantics for file, maxDepth, or includeHidden beyond what the schema states.

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?

"Flat geometry dump of a subtree (pre-order)" states a specific operation and shape, and the field list (id, name, absoluteBoundingBox, layoutMode, sizing) makes clear it returns geometry rather than structure or component metadata. It stops short of naming a sibling such as get_node, so an agent must infer that get_node is for a single node while this is the subtree traversal.

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

Usage Guidelines3/5

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

Usage is implied by the word "subtree" and by the documented fallbacks (rootId defaults to the current page), which tells the agent it can call this with no arguments to walk the active page. However, there is no explicit when-to-use versus get_node/get_document, and no guidance on choosing maxDepth versus maxNodes when a tree is large.

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