Frames
Create and manage frames, shapes, auto-layout containers, sections, and SVG nodes.
Type reference
// depth: omit → id+name stubs | 0 → props + child stubs | N → recurse N | -1 → full tree// fields: whitelist e.g. ["fills","opacity"] — id, name, type always included. Pass ["*"] for all.// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL — how the node sizes within auto-layout.// Colors: fillVariableName/strokeVariableName bind by name — preferred over raw color values.// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).// ---// visible: false hides the node. Omitted from response when true (the default).// locked: true prevents editing in Figma UI. Omitted when false (the default).// rotation: degrees (0-360). Omitted when 0.// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.// properties: escape hatch — set any Figma node property directly. Use only when no dedicated field exists.interface Node { id: string; name: string; type: string; visible?: boolean; // omitted when true locked?: boolean; // omitted when false opacity?: number; // omitted when 1 rotation?: number; // omitted when 0 blendMode?: string; // omitted when PASS_THROUGH layoutPositioning?: "AUTO" | "ABSOLUTE"; layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL"; layoutSizingVertical?: "FIXED" | "HUG" | "FILL"; minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number; absoluteBoundingBox: { x: number; y: number; width: number; height: number }; fills?: Paint[]; // solid: {type: "SOLID", color: {r, g, b, a}} strokes?: Paint[]; effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR children?: NodeStub[]; // stubs: {id, name, type} — use depth to expand}// PatchItem uses flat params matching create shape — no nested sub-objects.// Fill/stroke/corner/layout/text params are identical to frames.create and text.create.// Unknown keys produce a warning, preventing silent failures.// Frames are the primary container in Figma. Use auto_layout for responsive containers.// Sizing: FIXED = explicit size, HUG = shrink to children, FILL = expand to fill parent.// Fill: pass fills:[{type:"SOLID", color:"#hex"}] or [] for transparent. Shorthand: fillColor:"#3B82F6" (auto-binds to matching variable/style).// Also: fillVariableName:"bg/primary", fillStyleName:"Surface/Primary".// Image fill: imageUrl accepts "pexel:<id>", a public URL, or a local file path. SVGs become vector nodes; raster images become IMAGE fills. imageScaleMode: FILL (default), FIT, CROP, TILE.// Stroke: pass strokes:[{type:"SOLID", color:"#hex"}] or [] to clear. Shorthand: strokeColor:"#000", strokeVariableName:"border/default".// Token fields (cornerRadius, opacity, itemSpacing, padding, strokeWeight): pass number for value, string for variable name/ID.// ---// SIZING: Always think about both axes. Containers with text need a width constraint — set width + layoutSizingHorizontal:"FIXED".// HUG/HUG is only correct for intrinsically-sized elements (buttons, badges, icons).// Smart defaults inside auto-layout parent: cross-axis defaults to FILL, primary axis stays HUG.// FILL only works inside an auto-layout parent. Use FIXED for top-level frames.// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.// clipsContent: true (default) clips children to the frame bounds. Set false for overflow-visible.// Sections are top-level organizers (like artboards) — they cannot be nested inside frames.// Shape primitives: rectangle, ellipse, line — for decorative/visual elements (not containers).// group: wraps existing nodes into a Group. boolean_operation: UNION/SUBTRACT/INTERSECT/EXCLUDE combines shapes.// SVG create: pass raw SVG markup string (e.g. "<svg>...</svg>") — Figma converts it to vector nodes.10 methods available.
Get serialized node data
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Node ID |
fields | string[] | ✗ | Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all. |
depth | number | ✗ | Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited. |
verbose | boolean | ✗ | Include all properties (bounding box, constraints, text style details). Default false — returns slim, actionable output. |
Response
Serialized node tree. Shape depends on depth parameter.
| Field | Type | Description |
|---|---|---|
results | object[] | Serialized node trees |
_truncated | boolean | True when node budget exceeded |
_notice | string | Human-readable truncation notice |
Search for nodes (returns stubs only — use get with depth for full properties)
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | ✗ | Name search query (case-insensitive substring match) |
types | string[] | ✗ | Filter by node types (e.g. ["FRAME", "TEXT"]) |
parentId | string | ✗ | Search only within this subtree |
fields | string[] | ✗ | Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all. |
offset | number | ✗ | Skip N items for pagination (default 0) (default: 0) |
limit | number | ✗ | Max items per page (default 100) (default: 100) |
Response
Paginated node search results (uses results not items)
| Field | Type | Description |
|---|---|---|
totalCount | number | Total matching nodes |
returned | number | Nodes in this page |
offset | number | |
limit | number | |
results | object[] | Matching node stubs |
↳ id | string | |
↳ name | string | |
↳ type | string | |
↳ parentId | string | |
↳ parentName | string | |
↳ bounds | object | |
↳ x | number | |
↳ y | number | |
↳ width | number | |
↳ height | number |
update
Section titled “update”Patch node properties
| Parameter | Type | Required | Description |
|---|---|---|---|
items | object[] | ✓ | Array of {id, ...properties} to patch |
↳ fills | array | ✗ | Fill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills. |
↳ fillColor | string | ✗ | Shorthand — sets a single solid fill (auto-binds to matching variable/style) |
↳ fillStyleName | string | ✗ | Paint style name for fill |
↳ fillVariableName | string | ✗ | Color variable by name e.g. 'bg/primary' |
↳ strokes | array | ✗ | Stroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes. |
↳ strokeColor | string | ✗ | Shorthand — sets a single solid stroke (auto-binds to matching variable/style) |
↳ strokeStyleName | string | ✗ | Paint style name for stroke |
↳ strokeVariableName | string | ✗ | Color variable by name for stroke |
↳ strokeWeight | token | ✗ | All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight. |
↳ strokeTopWeight | token | ✗ | |
↳ strokeBottomWeight | token | ✗ | |
↳ strokeLeftWeight | token | ✗ | |
↳ strokeRightWeight | token | ✗ | |
↳ strokeAlign | "INSIDE" | "OUTSIDE" | "CENTER" | ✗ | Stroke position (default: INSIDE) |
↳ cornerRadius | token | ✗ | All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius. |
↳ topLeftRadius | token | ✗ | |
↳ topRightRadius | token | ✗ | |
↳ bottomRightRadius | token | ✗ | |
↳ bottomLeftRadius | token | ✗ | |
↳ visible | boolean | ✗ | Show/hide (default true) |
↳ locked | boolean | ✗ | Lock/unlock (default false) |
↳ opacity | token | ✗ | Opacity (0-1) or variable name |
↳ blendMode | "PASS_THROUGH" | "NORMAL" | "DARKEN" | "MULTIPLY" | "LINEAR_BURN" | "COLOR_BURN" | "LIGHTEN" | "SCREEN" | "LINEAR_DODGE" | "COLOR_DODGE" | "OVERLAY" | "SOFT_LIGHT" | "HARD_LIGHT" | "DIFFERENCE" | "EXCLUSION" | "HUE" | "SATURATION" | "COLOR" | "LUMINOSITY" | ✗ | |
↳ effectStyleName | string | ✗ | Effect style name (e.g. 'Shadow/Card') for shadows, blurs |
↳ layoutMode | "NONE" | "HORIZONTAL" | "VERTICAL" | ✗ | Layout direction (default: NONE) |
↳ layoutWrap | "NO_WRAP" | "WRAP" | ✗ | Wrap children to new rows (HORIZONTAL layout only — Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns. |
↳ padding | token | ✗ | All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft. |
↳ paddingTop | token | ✗ | |
↳ paddingRight | token | ✗ | |
↳ paddingBottom | token | ✗ | |
↳ paddingLeft | token | ✗ | |
↳ primaryAxisAlignItems | "MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN" | ✗ | |
↳ counterAxisAlignItems | "MIN" | "MAX" | "CENTER" | "BASELINE" | ✗ | |
↳ itemSpacing | token | ✗ | Spacing between children (number or variable name string, default: 0) |
↳ counterAxisSpacing | token | ✗ | Gap between wrapped rows (requires layoutWrap: WRAP) |
↳ strokesIncludedInLayout | boolean | ✗ | Include stroke width in layout measurements (default: false) |
↳ layoutSizingHorizontal | "FIXED" | "HUG" | "FILL" | ✗ | |
↳ layoutSizingVertical | "FIXED" | "HUG" | "FILL" | ✗ | |
↳ layoutPositioning | "AUTO" | "ABSOLUTE" | ✗ | ABSOLUTE = floating inside auto-layout parent |
↳ minWidth | number | ✗ | Min width for responsive auto-layout |
↳ maxWidth | number | ✗ | Max width for responsive auto-layout |
↳ minHeight | number | ✗ | Min height for responsive auto-layout |
↳ maxHeight | number | ✗ | Max height for responsive auto-layout |
↳ fontSize | number | ✗ | Font size |
↳ fontFamily | string | ✗ | Font family |
↳ fontStyle | string | ✗ | Font variant e.g. "Bold", "Italic" — overrides fontWeight |
↳ fontWeight | number | ✗ | 100-900. Ignored when fontStyle is set. |
↳ lineHeight | any | ✗ | number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"} |
↳ letterSpacing | any | ✗ | number | {value, unit: "PIXELS"|"PERCENT"} |
↳ textCase | "ORIGINAL" | "UPPER" | "LOWER" | "TITLE" | "SMALL_CAPS" | "SMALL_CAPS_FORCED" | ✗ | |
↳ textDecoration | "NONE" | "UNDERLINE" | "STRIKETHROUGH" | ✗ | |
↳ fontColor | string | ✗ | Shorthand — sets text color (auto-binds to matching variable/style) |
↳ fontColorVariableName | string | ✗ | Bind color variable by name e.g. 'text/primary' |
↳ fontColorStyleName | string | ✗ | Apply paint style — overrides fontColor |
↳ textStyleId | string | ✗ | Apply text style by ID — overrides fontSize/fontWeight |
↳ textStyleName | string | ✗ | Text style by name (case-insensitive) |
↳ textAlignHorizontal | "LEFT" | "CENTER" | "RIGHT" | "JUSTIFIED" | ✗ | |
↳ textAlignVertical | "TOP" | "CENTER" | "BOTTOM" | ✗ | |
↳ textAutoResize | "NONE" | "WIDTH_AND_HEIGHT" | "HEIGHT" | "TRUNCATE" | ✗ | |
↳ id | string | ✓ | |
↳ name | string | ✗ | Rename node |
↳ rotation | number | ✗ | Degrees (0-360) |
↳ x | number | ✗ | |
↳ y | number | ✗ | |
↳ width | number | ✗ | |
↳ height | number | ✗ | |
↳ clearFill | boolean | ✗ | Remove all fills |
↳ imageUrl | string | ✗ | Image source — 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills. |
↳ imageScaleMode | "FILL" | "FIT" | "CROP" | "TILE" | ✗ | How the image is scaled within the frame (default: FILL) |
↳ effects | object[] | ✗ | Effect array (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR) |
↳ overflowDirection | "NONE" | "HORIZONTAL" | "VERTICAL" | "BOTH" | ✗ | Scroll overflow in prototype (default: NONE) |
↳ constraints | object | ✗ | |
↳ horizontal | "MIN" | "CENTER" | "MAX" | "STRETCH" | "SCALE" | ✗ | |
↳ vertical | "MIN" | "CENTER" | "MAX" | "STRETCH" | "SCALE" | ✗ | |
↳ bindings | object[] | ✗ | Bind variables to properties. field path examples: 'fills/0/color', 'strokes/0/color', 'opacity', 'width', 'cornerRadius', 'itemSpacing'. |
↳ field | string | ✓ | |
↳ variableName | string | ✗ | |
↳ variableId | string | ✗ | |
↳ explicitMode | object | ✗ | Pin variable mode — use { collectionName, modeName } (preferred) or { collectionId, modeId } |
↳ exportSettings | object[] | ✗ | Export settings |
↳ annotations | object[] | ✗ | Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type. |
↳ properties | object | ✗ | Direct Figma API props (escape hatch) |
Response
| Field | Type | Description |
|---|---|---|
results | any[] | Array of "ok" or {error} per item |
delete
Section titled “delete”Delete nodes
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✗ | Single node ID |
items | object[] | ✗ | Batch: [{id}, ...] |
↳ id | string | ✗ |
Response
| Field | Type | Description |
|---|---|---|
results | string[] | Array of "ok" per item |
Duplicate nodes — produces a same-type copy (frame→frame, instance→instance, component→component). Instance clones reference the same source component; they do not duplicate the component definition.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✗ | Node ID |
name | string | ✗ | Rename the clone (set before appending to parent — required when cloning a variant into its component set to avoid duplicate names) |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
items | object[] | ✗ | Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params. |
↳ id | string | ✓ | Node ID to clone |
↳ name | string | ✗ | Rename the clone |
↳ parentId | string | ✗ | Target parent |
↳ x | number | ✗ | |
↳ y | number | ✗ | |
depth | number | ✗ | Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited. |
Response
| Field | Type | Description |
|---|---|---|
results | object[] | One entry per input item |
↳ id | string |
Run lint on a node — returns severity-ranked findings
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Node ID to audit |
rules | string[] | ✗ | Rules to check. Default: ["all"]. Categories: "component", "composition", "token", "naming", "wcag". |
maxDepth | number | ✗ | Max tree depth (default: 10) |
maxFindings | number | ✗ | Max findings (default: 50) |
minSeverity | "error" | "unsafe" | "heuristic" | "style" | "verbose" | ✗ | Minimum severity to report (default: style). Set to 'verbose' to include AAA contrast and line-height checks. |
skipInstances | boolean | ✗ | Skip instance internals — findings inside instances are owned by the component (default: true) |
Response
| Field | Type | Description |
|---|---|---|
nodeId | string | |
nodeName | string | |
categories | array | Sorted by severity (error > unsafe > heuristic > style) |
reparent
Section titled “reparent”Move nodes into a new parent
| Parameter | Type | Required | Description |
|---|---|---|---|
items | object[] | ✓ | Array of {id, parentId, index?} |
↳ id | string | ✓ | |
↳ parentId | string | ✓ | |
↳ index | number | ✗ |
Response
| Field | Type | Description |
|---|---|---|
results | string[] | Array of "ok" per item |
create
Section titled “create”Create frame-like containers
No parameters.
Discriminated by type. Available types:
General-purpose frame — shrinks to content by default, static when width+height given
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✗ | Node name |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
width | number | ✗ | Width in px (omit to shrink-to-content via HUG) |
height | number | ✗ | Height in px (omit to shrink-to-content via HUG) |
rotation | number | ✗ | Rotation in degrees (0-360) |
visible | boolean | ✗ | Show/hide (default true) |
locked | boolean | ✗ | Lock/unlock (default false) |
opacity | token | ✗ | Opacity (0-1) or variable name |
blendMode | "PASS_THROUGH" | "NORMAL" | "DARKEN" | "MULTIPLY" | "LINEAR_BURN" | "COLOR_BURN" | "LIGHTEN" | "SCREEN" | "LINEAR_DODGE" | "COLOR_DODGE" | "OVERLAY" | "SOFT_LIGHT" | "HARD_LIGHT" | "DIFFERENCE" | "EXCLUSION" | "HUE" | "SATURATION" | "COLOR" | "LUMINOSITY" | ✗ | |
effectStyleName | string | ✗ | Effect style name (e.g. 'Shadow/Card') for shadows, blurs |
fills | array | ✗ | Fill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills. |
fillColor | string | ✗ | Shorthand — sets a single solid fill (auto-binds to matching variable/style) |
fillStyleName | string | ✗ | Paint style name for fill |
fillVariableName | string | ✗ | Color variable by name e.g. 'bg/primary' |
imageUrl | string | ✗ | Image source — 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills. |
imageScaleMode | "FILL" | "FIT" | "CROP" | "TILE" | ✗ | How the image is scaled within the frame (default: FILL) |
strokes | array | ✗ | Stroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes. |
strokeColor | string | ✗ | Shorthand — sets a single solid stroke (auto-binds to matching variable/style) |
strokeStyleName | string | ✗ | Paint style name for stroke |
strokeVariableName | string | ✗ | Color variable by name for stroke |
strokeWeight | token | ✗ | All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight. |
strokeTopWeight | token | ✗ | |
strokeBottomWeight | token | ✗ | |
strokeLeftWeight | token | ✗ | |
strokeRightWeight | token | ✗ | |
strokeAlign | "INSIDE" | "OUTSIDE" | "CENTER" | ✗ | Stroke position (default: INSIDE) |
cornerRadius | token | ✗ | All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius. |
topLeftRadius | token | ✗ | |
topRightRadius | token | ✗ | |
bottomRightRadius | token | ✗ | |
bottomLeftRadius | token | ✗ | |
layoutMode | "NONE" | "HORIZONTAL" | "VERTICAL" | ✗ | Layout direction (default: auto — NONE when width+height set, otherwise inferred from layout props) |
layoutWrap | "NO_WRAP" | "WRAP" | ✗ | Wrap children to new rows (HORIZONTAL layout only — Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns. |
padding | token | ✗ | All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft. |
paddingTop | token | ✗ | |
paddingRight | token | ✗ | |
paddingBottom | token | ✗ | |
paddingLeft | token | ✗ | |
primaryAxisAlignItems | "MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN" | ✗ | |
counterAxisAlignItems | "MIN" | "MAX" | "CENTER" | "BASELINE" | ✗ | |
itemSpacing | token | ✗ | Spacing between children (number or variable name string, default: 0) |
counterAxisSpacing | token | ✗ | Gap between wrapped rows (requires layoutWrap: WRAP) |
strokesIncludedInLayout | boolean | ✗ | Include stroke width in layout measurements (default: false) |
overflowDirection | "NONE" | "HORIZONTAL" | "VERTICAL" | "BOTH" | ✗ | Scroll overflow in prototype (default: NONE) |
layoutPositioning | "AUTO" | "ABSOLUTE" | ✗ | ABSOLUTE = floating inside auto-layout parent |
layoutSizingHorizontal | "FIXED" | "HUG" | "FILL" | ✗ | |
layoutSizingVertical | "FIXED" | "HUG" | "FILL" | ✗ | |
minWidth | number | ✗ | Min width for responsive auto-layout |
maxWidth | number | ✗ | Max width for responsive auto-layout |
minHeight | number | ✗ | Min height for responsive auto-layout |
maxHeight | number | ✗ | Max height for responsive auto-layout |
annotations | object[] | ✗ | Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type. |
clipsContent | boolean | ✗ | |
children | object[] | ✗ | Inline child nodes — build nested trees in one call. Types: text: {type:"text", text, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Title", fontSize:20, layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties. |
auto_layout
Section titled “auto_layout”Auto-layout frame that arranges children automatically
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✗ | Node name |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
width | number | ✗ | Width in px (omit to shrink-to-content via HUG) |
height | number | ✗ | Height in px (omit to shrink-to-content via HUG) |
rotation | number | ✗ | Rotation in degrees (0-360) |
visible | boolean | ✗ | Show/hide (default true) |
locked | boolean | ✗ | Lock/unlock (default false) |
opacity | token | ✗ | Opacity (0-1) or variable name |
blendMode | "PASS_THROUGH" | "NORMAL" | "DARKEN" | "MULTIPLY" | "LINEAR_BURN" | "COLOR_BURN" | "LIGHTEN" | "SCREEN" | "LINEAR_DODGE" | "COLOR_DODGE" | "OVERLAY" | "SOFT_LIGHT" | "HARD_LIGHT" | "DIFFERENCE" | "EXCLUSION" | "HUE" | "SATURATION" | "COLOR" | "LUMINOSITY" | ✗ | |
effectStyleName | string | ✗ | Effect style name (e.g. 'Shadow/Card') for shadows, blurs |
fills | array | ✗ | Fill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills. |
fillColor | string | ✗ | Shorthand — sets a single solid fill (auto-binds to matching variable/style) |
fillStyleName | string | ✗ | Paint style name for fill |
fillVariableName | string | ✗ | Color variable by name e.g. 'bg/primary' |
imageUrl | string | ✗ | Image source — 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills. |
imageScaleMode | "FILL" | "FIT" | "CROP" | "TILE" | ✗ | How the image is scaled within the frame (default: FILL) |
strokes | array | ✗ | Stroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes. |
strokeColor | string | ✗ | Shorthand — sets a single solid stroke (auto-binds to matching variable/style) |
strokeStyleName | string | ✗ | Paint style name for stroke |
strokeVariableName | string | ✗ | Color variable by name for stroke |
strokeWeight | token | ✗ | All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight. |
strokeTopWeight | token | ✗ | |
strokeBottomWeight | token | ✗ | |
strokeLeftWeight | token | ✗ | |
strokeRightWeight | token | ✗ | |
strokeAlign | "INSIDE" | "OUTSIDE" | "CENTER" | ✗ | Stroke position (default: INSIDE) |
cornerRadius | token | ✗ | All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius. |
topLeftRadius | token | ✗ | |
topRightRadius | token | ✗ | |
bottomRightRadius | token | ✗ | |
bottomLeftRadius | token | ✗ | |
layoutMode | "HORIZONTAL" | "VERTICAL" | ✓ | Primary axis direction |
layoutWrap | "NO_WRAP" | "WRAP" | ✗ | Wrap children to new rows (HORIZONTAL layout only — Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns. |
padding | token | ✗ | All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft. |
paddingTop | token | ✗ | |
paddingRight | token | ✗ | |
paddingBottom | token | ✗ | |
paddingLeft | token | ✗ | |
primaryAxisAlignItems | "MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN" | ✗ | |
counterAxisAlignItems | "MIN" | "MAX" | "CENTER" | "BASELINE" | ✗ | |
itemSpacing | token | ✗ | Spacing between children (number or variable name string, default: 0) |
counterAxisSpacing | token | ✗ | Gap between wrapped rows (requires layoutWrap: WRAP) |
strokesIncludedInLayout | boolean | ✗ | Include stroke width in layout measurements (default: false) |
overflowDirection | "NONE" | "HORIZONTAL" | "VERTICAL" | "BOTH" | ✗ | Scroll overflow in prototype (default: NONE) |
layoutPositioning | "AUTO" | "ABSOLUTE" | ✗ | ABSOLUTE = floating inside auto-layout parent |
layoutSizingHorizontal | "FIXED" | "HUG" | "FILL" | ✗ | |
layoutSizingVertical | "FIXED" | "HUG" | "FILL" | ✗ | |
minWidth | number | ✗ | Min width for responsive auto-layout |
maxWidth | number | ✗ | Max width for responsive auto-layout |
minHeight | number | ✗ | Min height for responsive auto-layout |
maxHeight | number | ✗ | Max height for responsive auto-layout |
annotations | object[] | ✗ | Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type. |
clipsContent | boolean | ✗ | |
nodeIds | string[] | ✗ | Existing node IDs to wrap into auto-layout |
children | object[] | ✗ | Inline child nodes — build nested trees in one call. Types: text: {type:"text", text, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Title", fontSize:20, layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties. |
section
Section titled “section”Figma section (top-level organizer)
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | Section name |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
width | number | ✗ | Width (default: 500) |
height | number | ✗ | Height (default: 500) |
fills | array | ✗ | Fill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent |
fillColor | string | ✗ | Shorthand — sets a single solid fill (auto-binds to matching variable/style) |
fillStyleName | string | ✗ | Paint style name for fill |
fillVariableName | string | ✗ | Color variable by name e.g. 'bg/primary' |
imageUrl | string | ✗ | Image source — 'pexel:<id>', public URL, or local file path |
imageScaleMode | "FILL" | "FIT" | "CROP" | "TILE" | ✗ | How the image is scaled (default: FILL) |
rectangle
Section titled “rectangle”Rectangle shape node
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✗ | Layer name (default: 'Rectangle') |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
width | number | ✗ | Width in px (default: 100) |
height | number | ✗ | Height in px (default: 100) |
fills | array | ✗ | Fill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent |
fillColor | string | ✗ | Shorthand — sets a single solid fill (auto-binds to matching variable/style) |
fillStyleName | string | ✗ | Paint style name for fill |
fillVariableName | string | ✗ | Color variable by name e.g. 'bg/primary' |
imageUrl | string | ✗ | Image source — 'pexel:<id>', public URL, or local file path |
imageScaleMode | "FILL" | "FIT" | "CROP" | "TILE" | ✗ | How the image is scaled (default: FILL) |
strokes | array | ✗ | Stroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear |
strokeColor | string | ✗ | Shorthand — sets a single solid stroke (auto-binds to matching variable/style) |
strokeVariableName | string | ✗ | Color variable by name for stroke |
strokeWeight | token | ✗ | |
cornerRadius | token | ✗ | All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius. |
topLeftRadius | token | ✗ | |
topRightRadius | token | ✗ | |
bottomRightRadius | token | ✗ | |
bottomLeftRadius | token | ✗ | |
opacity | token | ✗ | |
layoutSizingHorizontal | "FIXED" | "FILL" | ✗ | Horizontal sizing in auto-layout parent |
layoutSizingVertical | "FIXED" | "FILL" | ✗ | Vertical sizing in auto-layout parent |
annotations | object[] | ✗ | Annotations — [{label?, labelMarkdown?, properties?, categoryId?}] |
ellipse
Section titled “ellipse”Ellipse/circle shape node
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✗ | Layer name (default: 'Ellipse') |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
width | number | ✗ | Width in px (default: 100) |
height | number | ✗ | Height in px (default: 100, same as width for circle) |
fills | array | ✗ | Fill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent |
fillColor | string | ✗ | Shorthand — sets a single solid fill (auto-binds to matching variable/style) |
fillStyleName | string | ✗ | Paint style name for fill |
fillVariableName | string | ✗ | Color variable by name e.g. 'bg/primary' |
imageUrl | string | ✗ | Image source — 'pexel:<id>', public URL, or local file path |
imageScaleMode | "FILL" | "FIT" | "CROP" | "TILE" | ✗ | How the image is scaled (default: FILL) |
strokes | array | ✗ | Stroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear |
strokeColor | string | ✗ | Shorthand — sets a single solid stroke (auto-binds to matching variable/style) |
strokeVariableName | string | ✗ | Color variable by name for stroke |
strokeWeight | token | ✗ | |
opacity | token | ✗ | |
layoutSizingHorizontal | "FIXED" | "FILL" | ✗ | Horizontal sizing in auto-layout parent |
layoutSizingVertical | "FIXED" | "FILL" | ✗ | Vertical sizing in auto-layout parent |
annotations | object[] | ✗ | Annotations — [{label?, labelMarkdown?, properties?, categoryId?}] |
Line shape node
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✗ | Layer name (default: 'Line') |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
length | number | ✗ | Line length in px (default: 100) |
rotation | number | ✗ | Rotation in degrees (default: 0 = horizontal) |
strokes | array | ✗ | Stroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear |
strokeColor | string | ✗ | Line color (default: black, auto-binds to matching variable/style) |
strokeVariableName | string | ✗ | Color variable by name for stroke |
strokeWeight | token | ✗ | Line thickness (default: 1) |
opacity | token | ✗ | |
layoutSizingHorizontal | "FIXED" | "FILL" | ✗ | Horizontal sizing in auto-layout parent (defaults to FILL in vertical auto-layout) |
annotations | object[] | ✗ | Annotations — [{label?, labelMarkdown?, properties?, categoryId?}] |
Group existing nodes together
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeIds | string[] | ✓ | Node IDs to group (min 1) |
name | string | ✗ | Group name |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
boolean_operation
Section titled “boolean_operation”Combine shapes with boolean operations (union, subtract, intersect, exclude)
| Parameter | Type | Required | Description |
|---|---|---|---|
operation | "UNION" | "SUBTRACT" | "INTERSECT" | "EXCLUDE" | ✓ | Boolean operation type |
nodeIds | string[] | ✓ | Node IDs to combine (min 2, first node is the base for SUBTRACT) |
name | string | ✗ | Result node name |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
Create node from SVG markup
| Parameter | Type | Required | Description |
|---|---|---|---|
fillStyleName | string | ✗ | Paint style to apply to vector fills |
fillVariableName | string | ✗ | Color variable by name for vector fills |
strokeStyleName | string | ✗ | Paint style to apply to vector strokes |
strokeVariableName | string | ✗ | Color variable by name for vector strokes |
svg | string | ✓ | SVG markup string |
name | string | ✗ | Layer name (default: 'SVG') |
parentId | string | ✗ | Parent node ID. Omit to place at current page root. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
Create a slot inside a component. Slots are placeholder containers that instance users fill with content. Defaults to VERTICAL auto-layout with FILL/HUG sizing — ready to receive children. Accepts all frame layout properties.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✗ | Node name |
parentId | string | ✗ | Parent node ID inside the owning component. Required unless componentId is provided. |
x | number | ✗ | X position (default: 0) |
y | number | ✗ | Y position (default: 0) |
width | number | ✗ | Width in px (omit to shrink-to-content via HUG) |
height | number | ✗ | Height in px (omit to shrink-to-content via HUG) |
rotation | number | ✗ | Rotation in degrees (0-360) |
visible | boolean | ✗ | Show/hide (default true) |
locked | boolean | ✗ | Lock/unlock (default false) |
opacity | token | ✗ | Opacity (0-1) or variable name |
blendMode | "PASS_THROUGH" | "NORMAL" | "DARKEN" | "MULTIPLY" | "LINEAR_BURN" | "COLOR_BURN" | "LIGHTEN" | "SCREEN" | "LINEAR_DODGE" | "COLOR_DODGE" | "OVERLAY" | "SOFT_LIGHT" | "HARD_LIGHT" | "DIFFERENCE" | "EXCLUSION" | "HUE" | "SATURATION" | "COLOR" | "LUMINOSITY" | ✗ | |
effectStyleName | string | ✗ | Effect style name (e.g. 'Shadow/Card') for shadows, blurs |
fills | array | ✗ | Fill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills. |
fillColor | string | ✗ | Shorthand — sets a single solid fill (auto-binds to matching variable/style) |
fillStyleName | string | ✗ | Paint style name for fill |
fillVariableName | string | ✗ | Color variable by name e.g. 'bg/primary' |
imageUrl | string | ✗ | Image source — 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills. |
imageScaleMode | "FILL" | "FIT" | "CROP" | "TILE" | ✗ | How the image is scaled within the frame (default: FILL) |
strokes | array | ✗ | Stroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes. |
strokeColor | string | ✗ | Shorthand — sets a single solid stroke (auto-binds to matching variable/style) |
strokeStyleName | string | ✗ | Paint style name for stroke |
strokeVariableName | string | ✗ | Color variable by name for stroke |
strokeWeight | token | ✗ | All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight. |
strokeTopWeight | token | ✗ | |
strokeBottomWeight | token | ✗ | |
strokeLeftWeight | token | ✗ | |
strokeRightWeight | token | ✗ | |
strokeAlign | "INSIDE" | "OUTSIDE" | "CENTER" | ✗ | Stroke position (default: INSIDE) |
cornerRadius | token | ✗ | All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius. |
topLeftRadius | token | ✗ | |
topRightRadius | token | ✗ | |
bottomRightRadius | token | ✗ | |
bottomLeftRadius | token | ✗ | |
layoutMode | "NONE" | "HORIZONTAL" | "VERTICAL" | ✗ | Layout direction (default: auto — NONE when width+height set, otherwise inferred from layout props) |
layoutWrap | "NO_WRAP" | "WRAP" | ✗ | Wrap children to new rows (HORIZONTAL layout only — Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns. |
padding | token | ✗ | All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft. |
paddingTop | token | ✗ | |
paddingRight | token | ✗ | |
paddingBottom | token | ✗ | |
paddingLeft | token | ✗ | |
primaryAxisAlignItems | "MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN" | ✗ | |
counterAxisAlignItems | "MIN" | "MAX" | "CENTER" | "BASELINE" | ✗ | |
itemSpacing | token | ✗ | Spacing between children (number or variable name string, default: 0) |
counterAxisSpacing | token | ✗ | Gap between wrapped rows (requires layoutWrap: WRAP) |
strokesIncludedInLayout | boolean | ✗ | Include stroke width in layout measurements (default: false) |
overflowDirection | "NONE" | "HORIZONTAL" | "VERTICAL" | "BOTH" | ✗ | Scroll overflow in prototype (default: NONE) |
layoutPositioning | "AUTO" | "ABSOLUTE" | ✗ | ABSOLUTE = floating inside auto-layout parent |
layoutSizingHorizontal | "FIXED" | "HUG" | "FILL" | ✗ | |
layoutSizingVertical | "FIXED" | "HUG" | "FILL" | ✗ | |
minWidth | number | ✗ | Min width for responsive auto-layout |
maxWidth | number | ✗ | Max width for responsive auto-layout |
minHeight | number | ✗ | Min height for responsive auto-layout |
maxHeight | number | ✗ | Max height for responsive auto-layout |
annotations | object[] | ✗ | Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type. |
componentId | string | ✗ | Owning component ID. Optional — auto-resolved from parentId by walking up ancestors. |
Response
| Field | Type | Description |
|---|---|---|
results | object[] | One entry per input item |
↳ id | string |
commit
Section titled “commit”Commit a staged node — unwraps from [STAGED] container into the original target location.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Staged node ID to commit |
Response
| Field | Type | Description |
|---|---|---|
results | object[] | One entry per input item |
↳ id | string |
export
Section titled “export”Export a node as PNG, JPG, SVG, SVG_STRING, or PDF
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Node ID to export |
format | "PNG" | "JPG" | "SVG" | "SVG_STRING" | "PDF" | ✗ | Export format (default: PNG). SVG_STRING returns raw SVG text. |
scale | number | ✗ | Export scale (default: 1, only for PNG/JPG) |
Response
Binary image data returned as MCP image content (SVG_STRING returns text)
| Field | Type | Description |
|---|---|---|
imageData | string | |
mimeType | string |