Skip to main content
Glama
kicholiz

Figma Write Bridge MCP

by kicholiz

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

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNoExtra per-node fields. Add "characters" to include TEXT content.
verboseNoReturn the nested {..., children:[...]} tree instead of the flattened columnar table.
maxDepthNoLevels of children to expand. Default 3. Omit for compact overview.
rootNodeIdNo
excludeTypesNo
includeHiddenNoInclude hidden layers. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and handles it well: it discloses the pre-order flattening convention, the depth-encoding rule, default maxDepth=3, that hidden layers are omitted unless includeHidden is true, and that nodes carry only {id,name,type} unless extra fields are requested. It omits any mention of auth/permission needs or result-size limits, which keeps it short of a 5 for a whole-document read.

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

Conciseness3/5

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

Front-loaded and information-dense, with the output contract stated first. However, the exhaustive enumeration of ~25 field names is a large inline block that reads more like reference material than description, and could be pushed to schema or docs without losing agent-relevant meaning.

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?

No output schema exists, so the description must explain return values — and it does so fully: columnar layout, row/node shape, ordering, depth semantics, and the verbose alternative. Combined with defaults and filtering behavior, an agent has everything needed to call it correctly.

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

Parameters4/5

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

Schema coverage is a middling 67%, and the description compensates by explaining every parameter: fields (with examples and the 'characters' tip), verbose (nested vs flattened), maxDepth (default + 'omit for compact overview'), rootNodeId (scoping), excludeTypes (example value), and includeHidden. It adds real meaning beyond the schema, especially for the two undocumented params.

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?

States a specific verb+resource ('structural tree of the whole document (or a subtree)') and immediately specifies the output shape (flattened columnar table with fields/rows/depth). It also distinguishes itself from its own verbose mode, so an agent knows exactly what it gets.

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?

Gives clear operational guidance: use rootNodeId to scope to a frame/page, excludeTypes to drop icon noise, fields to pull extras, verbose for the nested alternative. It does not, however, contrast itself against nearby siblings like get_node_info, read_my_design, find_nodes, or scan_nodes_by_types, so an agent must infer when this beats those.

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

Deploy Server

Other Tools