Skip to main content
Glama
figma-forge-mcp

figma-forge-mcp

by TBlopT

build_tree

Build entire Figma node trees in a single call from structured specs, including auto-layout, fills, text, effects, and instances, to avoid creating nodes one by one.

Instructions

Build a complete node tree in ONE call. Far faster and more precise than creating nodes one by one. Node spec: { type: FRAME|COMPONENT|TEXT|RECT|ELLIPSE|LINE|INSTANCE|SVG, name, x, y, w, h, children: [...] }

  • Auto-layout: layout: { mode: HORIZONTAL|VERTICAL, gap, pad: n|[v,h]|[t,r,b,l], primary: MIN|CENTER|MAX|SPACE_BETWEEN, counter, wrap, crossGap }

  • Sizing: sizeH / sizeV: FIXED|HUG|FILL, grow, minW, maxW, minH, maxH, absolute (absolute position inside auto-layout)

  • Paint: fills: ["#hex" | {color, opacity} | {type: GRADIENT_LINEAR, angle, stops:[{pos,color,opacity}]} | {type: GRADIENT_RADIAL, cx, cy, rx, ry, stops}], fillStyle: "Style/Name", fillVar: "variable/name"

  • Strokes: strokes, strokeWeight, strokeAlign: INSIDE|CENTER|OUTSIDE, dash: [4,2]; radius: n|[tl,tr,br,bl] (corner smoothing 60% by default), smoothing

  • Effects: effects: [{type: DROP_SHADOW|INNER_SHADOW, color, opacity, x, y, blur, spread} | {type: LAYER_BLUR|BACKGROUND_BLUR, radius}], effectStyle

  • Text: text: { chars, style: "Text/Style" OR font: "Any Family", weight: "Regular|Medium|SemiBold|Bold|Light", size, lineHeight (px number or "120%"), letterSpacing (%), textCase, align, decoration, color, ranges: [{match, color, font, weight, underline}] }, autoResize

  • Other: opacity, blend, rotation, clip, mask, constraints, grids: [{pattern: COLUMNS|ROWS|GRID, count, gutter, offset, alignment, size, color, opacity}], exports: [{format, scale}], description (components)

  • INSTANCE: { type: INSTANCE, componentId }. SVG: { type: SVG, svg: "<svg…>", svgColor } The root is built hidden and shown when finished. Returns root id, size and (with returnIds) a name→id map.

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": "build_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
treeNoRoot node spec (see description)
pageIdNoPage id to build on (switches to it)
parentIdNoParent node id (frame/section/component)
returnIdsNoReturn a map of layer name → node id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does add real behavior: the root is built hidden and revealed on completion, pageId switches the active page, and the return payload (root id, size, optional name→id map) is stated. It does not cover failure modes, partial-build behavior on invalid specs, or performance limits on tree size.

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?

The value proposition and build semantics are front-loaded in two sentences, followed by a scannable, labeled reference list grouped by concern (layout, sizing, paint, strokes, effects, text, other). It is long, but for a tool whose payload is a DSL nearly every line carries specification rather than filler.

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 correctly states the return values, and it documents the tree grammar the schema punts on. Remaining gaps are behavioral edge cases (validation errors, what happens on an invalid child spec) rather than anything blocking a correct invocation.

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?

Schema coverage is 100%, so the baseline would be 3, but the schema defers the entire `tree` payload to 'see description' — the description then supplies the full node grammar (type enum, layout, sizing, paints, strokes, effects, text, instance/SVG variants), which is meaning no structured field 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?

Opens with a specific verb and resource ('Build a complete node tree in ONE call') and immediately contrasts it with the sibling pattern of 'creating nodes one by one', so an agent can distinguish it from create_frame/create_rectangle/create_text without opening any schema.

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?

The first two sentences give clear context for when to reach for this tool over the incremental create_* siblings, and the hidden-then-shown build behavior implies it is a batched construction step. It stops short of explicit exclusions (e.g., when to prefer clone_node or create_component_instance instead).

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