Skip to main content
Glama
the-real-talk

the-real-talk

build_tree

Create an entire Figma node tree (frames, rectangles, text) under a parent in one atomic call; if any step fails, all created nodes are rolled back.

Instructions

Build a whole tree of nodes (frames, rectangles, texts) in ONE call, under a given parent. All or nothing: if any step fails, everything created by this call is deleted. Returns the created IDs. Data only, no code. tree is one node object: { type: "FRAME"|"RECTANGLE"|"TEXT", name?, x?, y?, width?, height?, fill?{r,g,b,a? in 0..1}, stroke?, strokeWeight?, cornerRadius?, layoutSizingHorizontal?/layoutSizingVertical? ("FIXED"|"HUG"|"FILL"), bindings?[{property:"FILL"|"STROKE"|"CORNER_RADIUS"|"PADDING"|"PADDING_TOP"|"PADDING_BOTTOM"|"PADDING_LEFT"|"PADDING_RIGHT"|"ITEM_SPACING"|"WIDTH"|"HEIGHT", variable:}], explicitModes?[{collection, mode}], strokeAlign? ("INSIDE"|"OUTSIDE"|"CENTER"), cornerRadii? {topLeft,topRight,bottomRight,bottomLeft}, noFill? (remove all fills), layoutPositioning? ("ABSOLUTE" inside an auto-layout parent, with x, y, width, height, constraintH/constraintV "MIN"|"MAX"|"CENTER"|"STRETCH"|"SCALE"); binding properties also CORNER_TOP_LEFT, CORNER_TOP_RIGHT, CORNER_BOTTOM_LEFT, CORNER_BOTTOM_RIGHT }. Also on any node: props {same keys as set_node_properties}, fieldBindings [{field, variable}] (same fields as bind_variable_field), effects [same shape as set_effects]. Types ELLIPSE (like RECTANGLE) and INSTANCE (componentId of a local COMPONENT, properties {name: value} as in set_instance_properties). FRAME also takes asComponent (true: turn the built frame into a COMPONENT once its children exist; the returned id is the component's). FRAME also takes layoutMode ("NONE"|"HORIZONTAL"|"VERTICAL"), layoutWrap, paddingTop/Right/Bottom/Left, itemSpacing, primaryAxisAlignItems, counterAxisAlignItems and children[] (same node shape, max depth 12, max 500 nodes in total). TEXT takes text (required), fontSize, fontWeight (100..900), textStyle (text style name or ID). Colors set on an element should be bound to variables with bindings rather than left as raw RGB. A property you do not give keeps Figma's own default (no invented padding, spacing, alignment, font size or color). A frame with auto layout and an explicit width or height keeps that size fixed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tree": "<tree>"
    },
    "name": "build_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
treeYesThe root node of the tree to build (see the tool description for the shape)
parentIdNoID of the parent node (frame or section). Defaults to the current page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/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 does substantially well: it discloses all-or-nothing rollback semantics, the return of created IDs, the 'data only, no code' constraint that rules out arbitrary script execution, hard limits (max depth 12, 500 nodes), and the default-preserving rule so no padding/spacing/color is invented. Remaining gaps are permission requirements and whether returned IDs match traversal order.

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?

Purpose, atomicity and return value are front-loaded in the first three sentences before the grammar dump, and virtually no sentence is redundant. Structure suffers, however: the node grammar is one dense semicolon-delimited run-on without headings or bullets, which makes the reference material harder to scan than necessary.

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?

For a deeply nested, high-complexity tool with an effectively empty nested schema and no output schema, the description covers node shape, limits, defaults, atomicity and return values, and it reuses sibling contracts (set_node_properties, bind_variable_field, set_effects, set_instance_properties) by reference. It stops short of describing error/warning reporting on partial failures or ordering guarantees for the returned IDs.

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

Parameters5/5

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

The input schema's 'tree' property is additionalProperties:{} and explicitly defers to the tool description, so the description must supply the entire nested grammar — and it does: node types (FRAME/RECTANGLE/TEXT/ELLIPSE/INSTANCE), geometry, fills, bindings, explicitModes, auto-layout keys, effects, fieldBindings, and children with depth/node limits. This is meaning far beyond what the schema provides.

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 and resource with scope: build a whole tree of nodes under a given parent in ONE call. The phrase 'a whole tree ... in ONE call' implicitly but clearly separates it from the single-node creators in the sibling list (create_frame, create_rectangle, create_text), and it also discloses the return value (created IDs) and atomicity.

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 rather than stated: the 'ONE call' framing and the atomic rollback note suggest this is the efficient/consistent option versus many single-node calls, but no sibling is named as an alternative and no explicit when-not condition is given. It does provide real usage guidance in a different sense ('colors should be bound to variables with bindings rather than left as raw RGB').

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