Skip to main content
Glama
figma-mcp
by ivn4k

Create nodes

create_nodes

Creates one or more Figma node trees in a single undo step and returns their new IDs, so you can build nested frames, text, components, and images in one call.

Instructions

Create one or more node trees in one call (one undo step). Returns the new ids. NODE SPEC: {type, ...PROPS, children?: [NODE SPEC]}. type: FRAME (default) | RECTANGLE | ELLIPSE | LINE | POLYGON | STAR | TEXT | COMPONENT | SECTION | GROUP (needs children) | SVG (svg: "<svg…>" or svgPath) | IMAGE (rectangle with an image fill: imagePath | imageUrl | imageBase64, scaleMode; natural size when width/height omitted) | INSTANCE (componentId of a COMPONENT/COMPONENT_SET, or componentKey of a library component) | PAGE (top level only). Nested frames get no fill unless fills are given (top-level frames: white). Auto-layout frames hug their content on axes without width/height; plain frames without size grow to fit their children. TEXT: width without height → fixed width, wrapping. Top-level nodes without x/y are placed to the right of existing content. Example: {"type":"FRAME","name":"Card","layoutMode":"VERTICAL","padding":24,"itemSpacing":12,"cornerRadius":16,"fills":["#FFFFFF"],"effects":[{"type":"DROP_SHADOW","color":"#0000001A","offset":{"x":0,"y":4},"radius":16}],"children":[{"type":"TEXT","characters":"Title","fontFamily":"Inter","fontWeight":700,"fontSize":24},{"type":"TEXT","characters":"Body","fontSize":14,"fills":["#666666"],"layoutSizingHorizontal":"FILL"}]}

PROPS (all optional):

  • Geometry: name, x, y, width, height, rotation, opacity, visible, locked, constraints, blendMode.

  • fills / strokes: array of "#RRGGBB" | "#RRGGBBAA" | "rgba(r,g,b,a)" | {type:"SOLID", color, opacity?, variable?} | {type:"GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", stops:[{color, position}] or ["#hex", ...], angle? (linear only, degrees: 0 = left→right, 90 = top→bottom)} | {type:"IMAGE", imagePath (local file) | imageUrl | imageBase64, scaleMode?: "FILL"|"FIT"|"CROP"|"TILE"}. [] removes all. Shorthand: fill / stroke = single paint.

  • strokeWeight, strokeAlign ("INSIDE"|"OUTSIDE"|"CENTER"), dashPattern, cornerRadius (number or [tl,tr,br,bl]).

  • effects: [{type:"DROP_SHADOW"|"INNER_SHADOW", color, offset:{x,y}, radius, spread?} | {type:"LAYER_BLUR"|"BACKGROUND_BLUR", radius}].

  • Auto layout (FRAME/COMPONENT): layoutMode ("HORIZONTAL"|"VERTICAL"|"GRID"|"NONE"), itemSpacing, padding (number | [vertical, horizontal] | [top,right,bottom,left] | {top,right,bottom,left}), primaryAxisAlignItems ("MIN"|"CENTER"|"MAX"|"SPACE_BETWEEN"), counterAxisAlignItems ("MIN"|"CENTER"|"MAX"|"BASELINE"), layoutWrap ("WRAP"|"NO_WRAP"), counterAxisSpacing, clipsContent.

  • Inside an auto-layout parent: layoutSizingHorizontal / layoutSizingVertical ("FIXED"|"HUG"|"FILL"), layoutPositioning ("ABSOLUTE"), layoutGrow.

  • TEXT: characters, fontFamily, fontStyle ("Bold", "Medium Italic"…), fontWeight (100-900), fontSize, lineHeight (px | "150%" | "auto"), letterSpacing (px | "2%"), textAlignHorizontal ("LEFT"|"CENTER"|"RIGHT"|"JUSTIFIED"), textAlignVertical, textAutoResize ("WIDTH_AND_HEIGHT"|"HEIGHT"|"NONE"|"TRUNCATE"), textCase, textDecoration, paragraphSpacing, hyperlink (url). Fonts are loaded automatically. Partial styling: rangeStyles [{text: "substring" | start, end, fontFamily?, fontStyle?, fontWeight?, fontSize?, fills?, textDecoration?, textCase?, letterSpacing?, lineHeight?, hyperlink?, textStyleId?, fillStyleId?}] (applied after characters).

  • Styles: fillStyleId / strokeStyleId / effectStyleId / textStyleId / gridStyleId — style id or exact local style name.

  • Variables: boundVariables {field: variableId | variable name | null}, fields e.g. fills, strokes, width, height, itemSpacing, paddingLeft, cornerRadius, opacity, characters.

  • INSTANCE: componentProperties {propName: value} (names without the #id suffix are fine), swapComponentId.

  • Any other writable Plugin API property is assigned as-is; problems are reported in "warnings" instead of failing the whole call.

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": {
      "nodes": "<nodes>"
    },
    "name": "create_nodes"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodesYesNODE SPECs
selectNoSelect the created top-level nodes and zoom to them
parentIdNoParent (frame, group, section, component, page). Default: current page

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: one undo step for the whole batch, 'Returns the new ids', default fill behavior (nested frames get none, top-level frames white), auto-layout and plain-frame sizing/hug rules, TEXT wrapping semantics, automatic font loading, and the key failure mode — unknown writable properties are assigned as-is with problems surfaced in "warnings" instead of failing the call.

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 long, but the length is justified by an otherwise opaque nested spec. Structure is front-loaded correctly: contract sentence, then NODE SPEC, then a worked example, then grouped PROPS bullets. A few bullet entries (e.g. primaryAxisAlignItems, counterAxisAlignItems enums) restate Figma conventions the agent may not need, keeping it short of full marks.

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?

For a high-complexity mutation tool with no output schema and a free-form nodes payload, the description covers return value (new ids), placement defaults, sizing defaults, and warning-vs-failure behavior. Nothing an agent needs in order to make a correct first call is missing; only rate/permission concerns are absent, which are outside this tool's contract.

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 three top-level parameters are documented in the schema, but the `nodes` items are declared as unconstrained objects (additionalProperties: {}), so the schema alone conveys nothing about node content. The description compensates by supplying the entire NODE SPEC grammar: type enumeration with per-type requirements (GROUP needs children, INSTANCE needs componentId/componentKey, PAGE top-level only), the fills/strokes paint union, effects, auto-layout, text, styles, and boundVariables.

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?

"Create one or more node trees in one call (one undo step). Returns the new ids." names the verb, the resource (node trees), the batching scope, and the transactional semantics in one sentence. The verb 'create' cleanly separates it from sibling names like clone_nodes, update_nodes, and restructure_nodes without ambiguity.

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 scope statement — build new trees in one call rather than many — and the placement rule for top-level nodes without x/y tells the agent it does not need to compute coordinates. However, the description never states when to prefer this over clone_nodes (duplicating existing trees) or update_nodes, and names no alternatives or exclusions, so the agent must infer routing.

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