跳转到内容

Frames

创建和管理框架、形状、自动布局容器、分区和 SVG 节点。

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 }.
// clipsContent: clip children to the node bounds where supported (frames/components/instances). Set false for overflow-visible layouts.
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[]; // readback Paint[]; authoring supports SOLID + gradients via gradientTransform + gradientStops
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. Paint[] authoring supports SOLID + gradients only; IMAGE/VIDEO/PATTERN are readback-only metadata.
// 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: prefer fillVariableName/fillStyleName. Use fills:[{type:"SOLID", color:"#hex"}] or gradient Paint[] (GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND) with gradientTransform + gradientStops only for one-off values; [] for transparent. Shorthand: fillColor:"#3B82F6" (auto-binds single solids).
// Also: fillVariableName:"bg/surface", fillStyleName:"Surface/Primary". Do not use CSS gradients, REST gradientHandlePositions, or top-level gradient boundVariables.
// Image fill: use imageUrl/images for image authoring. imageUrl accepts "pexel:<id>", a public URL, or a local file path. SVGs become vector nodes; raster images become IMAGE fills. IMAGE/VIDEO/PATTERN may appear in readback metadata only; do not pass those objects in Paint[]. imageScaleMode: FILL (default), FIT, CROP, TILE.
// Stroke: prefer strokeVariableName/strokeStyleName. Use strokes:[{type:"SOLID", color:"#hex"}] or gradient Paint[] (GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND) with gradientTransform + gradientStops only for one-off values; [] to clear. Shorthand: strokeColor:"#000", strokeVariableName:"border/default".
// Token fields (cornerRadius, opacity, itemSpacing, padding, strokeWeight): pass number for value, string for variable name/ID.
// Examples assume design tokens/styles already exist. Prefer token names (fillVariableName, strokeVariableName, padding:"space/16", cornerRadius:"radius/8") over raw values in production designs.
// ---
// 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.
// Shared types:
// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2×3 matrix)
// 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"
// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}
// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.
// NodeStub: {id: string, name: string, type: string}

11 methods available.

readinherited

Get serialized node data

ParameterTypeRequiredDescription
idstring✓Node ID
fieldsstring[]✗Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.
depthnumber✗Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.
verboseboolean✗Include all properties (bounding box, constraints, text style details). Default false — returns slim, actionable output.

Response

Serialized node tree. Shape depends on depth parameter.

FieldTypeDescription
resultsobject[]Serialized node trees
_truncatedbooleanTrue when node budget exceeded
_noticestringHuman-readable truncation notice
readinherited

Search for nodes (returns stubs only — use get with depth for full properties)

ParameterTypeRequiredDescription
querystring✗Name search query (case-insensitive substring match)
typesstring[]✗Filter by node types (e.g. ["FRAME", "TEXT"])
parentIdstring✗Search only within this subtree
fieldsstring[]✗Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.
offsetnumber✗Skip N items for pagination (default 0) (default: 0)
limitnumber✗Max items per page (default 100) (default: 100)

Response

Paginated node search results (uses results not items)

FieldTypeDescription
totalCountnumberTotal matching nodes
returnednumberNodes in this page
offsetnumber
limitnumber
resultsobject[]Matching node stubs
↳ idstring
↳ namestring
↳ typestring
↳ parentIdstring
↳ parentNamestring
↳ boundsobject
↳ xnumber
↳ ynumber
↳ widthnumber
↳ heightnumber
editinherited

Patch node properties

ParameterTypeRequiredDescription
itemsobject[]✓Array of {id, ...fields} to patch
↳ fillsobject[]✗Fill Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
↳ fillColorstring✗Shorthand — sets a single solid fill (auto-binds to matching variable/style)
↳ fillStyleNamestring✗Paint style name for fill
↳ fillVariableNamestring✗Color variable by name e.g. 'bg/surface'
↳ strokesobject[]✗Stroke Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
↳ strokeColorstring✗Shorthand — sets a single solid stroke (auto-binds to matching variable/style)
↳ strokeStyleNamestring✗Paint style name for stroke
↳ strokeVariableNamestring✗Color variable by name for stroke
↳ strokeWeighttoken✗All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
↳ strokeTopWeighttoken✗
↳ strokeBottomWeighttoken✗
↳ strokeLeftWeighttoken✗
↳ strokeRightWeighttoken✗
↳ strokeAlign"INSIDE" | "OUTSIDE" | "CENTER"✗Stroke position (default: INSIDE)
↳ cornerRadiustoken✗All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
↳ topLeftRadiustoken✗
↳ topRightRadiustoken✗
↳ bottomRightRadiustoken✗
↳ bottomLeftRadiustoken✗
↳ visibleboolean✗Show/hide (default true)
↳ lockedboolean✗Lock/unlock (default false)
↳ opacitytoken✗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"✗
↳ effectStyleNamestring✗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.
↳ paddingtoken✗All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
↳ paddingToptoken✗
↳ paddingRighttoken✗
↳ paddingBottomtoken✗
↳ paddingLefttoken✗
↳ primaryAxisAlignItems"MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN"✗
↳ counterAxisAlignItems"MIN" | "MAX" | "CENTER" | "BASELINE"✗
↳ itemSpacingtoken✗Spacing between children (number or variable name string, default: 0)
↳ counterAxisSpacingtoken✗Gap between wrapped rows (requires layoutWrap: WRAP)
↳ strokesIncludedInLayoutboolean✗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
↳ minWidthnumber✗Min width for responsive auto-layout
↳ maxWidthnumber✗Max width for responsive auto-layout
↳ minHeightnumber✗Min height for responsive auto-layout
↳ maxHeightnumber✗Max height for responsive auto-layout
↳ fontSizenumber✗Font size
↳ fontFamilystring✗Font family
↳ fontStylestring✗Font variant e.g. "Bold", "Italic" — overrides fontWeight
↳ fontWeightnumber✗100-900. Ignored when fontStyle is set.
↳ lineHeightany✗number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"}
↳ letterSpacingany✗number | {value, unit: "PIXELS"|"PERCENT"}
↳ textCase"ORIGINAL" | "UPPER" | "LOWER" | "TITLE" | "SMALL_CAPS" | "SMALL_CAPS_FORCED"✗
↳ textDecoration"NONE" | "UNDERLINE" | "STRIKETHROUGH"✗
↳ fontColorstring✗Shorthand — sets text color (auto-binds to matching variable/style)
↳ fontColorVariableNamestring✗Bind color variable by name e.g. 'text/primary'
↳ fontColorStyleNamestring✗Apply paint style — overrides fontColor
↳ textStyleIdstring✗Apply text style by ID — overrides fontSize/fontWeight
↳ textStyleNamestring✗Text style by name (case-insensitive)
↳ textAlignHorizontal"LEFT" | "CENTER" | "RIGHT" | "JUSTIFIED"✗
↳ textAlignVertical"TOP" | "CENTER" | "BOTTOM"✗
↳ textAutoResize"NONE" | "WIDTH_AND_HEIGHT" | "HEIGHT" | "TRUNCATE"✗
↳ idstring✓
↳ namestring✗Rename node
↳ rotationnumber✗Degrees (0-360)
↳ xnumber✗
↳ ynumber✗
↳ widthnumber✗
↳ heightnumber✗
↳ clearFillboolean✗Remove all fills
↳ imageUrlstring✗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)
↳ effectsobject[]✗Effect array (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR)
↳ overflowDirection"NONE" | "HORIZONTAL" | "VERTICAL" | "BOTH"✗Scroll overflow in prototype (default: NONE)
↳ constraintsobject✗
↳ horizontal"MIN" | "CENTER" | "MAX" | "STRETCH" | "SCALE"✗
↳ vertical"MIN" | "CENTER" | "MAX" | "STRETCH" | "SCALE"✗
↳ bindingsobject[]✗Bind variables to properties. field path examples: 'fills/0/color', 'strokes/0/color', 'opacity', 'width', 'cornerRadius', 'itemSpacing'.
↳ fieldstring✓
↳ variableNamestring✗
↳ variableIdstring✗
↳ explicitModeobject✗Pin variable mode — use { collectionName, modeName } (preferred) or { collectionId, modeId }
↳ exportSettingsobject[]✗Export settings
↳ annotationsobject[]✗Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type.
↳ clipsContentboolean✗Clip children to bounds where supported (frames/components/instances).

Response

FieldTypeDescription
resultsany[]Array of "ok" or {error} per item
editinherited

Delete nodes

ParameterTypeRequiredDescription
idstring✗Single node ID
itemsobject[]✗Batch: [{id}, ...]
↳ idstring✗

Response

FieldTypeDescription
resultsstring[]Array of "ok" per item
createinherited

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.

ParameterTypeRequiredDescription
idstring✗Node ID
namestring✗Rename the clone (set before appending to parent — required when cloning a variant into its component set to avoid duplicate names)
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
itemsobject[]✗Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.
↳ idstring✓Node ID to clone
↳ namestring✗Rename the clone
↳ parentIdstring✗Target parent
↳ xnumber✗
↳ ynumber✗
depthnumber✗Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.

Response

FieldTypeDescription
resultsobject[]One entry per input item
↳ idstring
editinherited

Proportionally rescale a node subtree using Figma’s visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing.

Example

{endpoint}(method:"scale", id:"1:23", factor:0.5)
ParameterTypeRequiredDescription
idstring✗Node ID to scale
factornumber✗Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%. Scales children, text, strokes, effects, and layout geometry from the node's top-left. On auto-layout or HUG/FILL nodes, Figma may resolve responsive sizing to fixed width/height.
itemsobject[]✗Batch: [{id, factor}, ...]. Alternative to single-item params.
↳ idstring✓Node ID to scale
↳ factornumber✓Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%.

Response

FieldTypeDescription
resultsstring[]Array of "ok" per item
readinherited

Run lint on a node — returns severity-ranked findings

ParameterTypeRequiredDescription
idstring✓Node ID to audit
rulesstring[]✗Rules to check. Default: ["all"]. Categories: "component", "composition", "token", "naming", "wcag".
maxDepthnumber✗Max tree depth (default: 10)
maxFindingsnumber✗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.
skipInstancesboolean✗Skip instance internals — findings inside instances are owned by the component (default: true)

Response

FieldTypeDescription
nodeIdstring
nodeNamestring
categoriesarraySorted by severity (error > unsafe > heuristic > style)
editinherited

Move nodes into a new parent

ParameterTypeRequiredDescription
itemsobject[]✓Array of {id, parentId, index?}
↳ idstring✓
↳ parentIdstring✓
↳ indexnumber✗

Response

FieldTypeDescription
resultsstring[]Array of "ok" per item

Create frame-like containers

Example

frames(method:"create", type:"rectangle", items:[{name:"Gradient Box", fills:[{type:"GRADIENT_LINEAR", gradientTransform:[[1,0,0],[0,1,0]], gradientStops:[{position:0,color:"#FF6B6B"},{position:1,color:"#FFD93D"}]}]}])

Type-specific fields go inside items[]; do not pass them at the top level.

ParameterTypeRequiredDescription
type"frame" | "auto_layout" | "section" | "rectangle" | "ellipse" | "line" | "group" | "boolean_operation" | "svg" | "slot"✓Selects which item shape to use
itemsobject[]✓One or more type-specific item objects. Put fields from the selected type table inside each item; do not pass them at top level.

Discriminated by type. Available types:

Each table below describes one object inside items[] for that type.

General-purpose frame — shrinks to content by default, static when width+height given

frames(method:"create", type:"frame", items:[{name:"Dashboard Shell", x:0, y:0, width:1440, height:900, fillVariableName:"bg/canvas", children:[{type:"frame", name:"Content Area", x:80, y:80, width:640, height:360, layoutMode:"VERTICAL", padding:"space/24", itemSpacing:"space/12", fillVariableName:"bg/surface", cornerRadius:"radius/12", children:[{type:"text", name:"Dashboard overview", text:"Dashboard overview", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}]}])
ParameterTypeRequiredDescription
namestring✗Node name
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
widthnumber✗Width in px (omit to shrink-to-content via HUG)
heightnumber✗Height in px (omit to shrink-to-content via HUG)
rotationnumber✗Rotation in degrees (0-360)
visibleboolean✗Show/hide (default true)
lockedboolean✗Lock/unlock (default false)
opacitytoken✗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"✗
effectStyleNamestring✗Effect style name (e.g. 'Shadow/Card') for shadows, blurs
fillsobject[]✗Fill Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
fillColorstring✗Shorthand — sets a single solid fill (auto-binds to matching variable/style)
fillStyleNamestring✗Paint style name for fill
fillVariableNamestring✗Color variable by name e.g. 'bg/surface'
imageUrlstring✗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)
strokesobject[]✗Stroke Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
strokeColorstring✗Shorthand — sets a single solid stroke (auto-binds to matching variable/style)
strokeStyleNamestring✗Paint style name for stroke
strokeVariableNamestring✗Color variable by name for stroke
strokeWeighttoken✗All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
strokeTopWeighttoken✗
strokeBottomWeighttoken✗
strokeLeftWeighttoken✗
strokeRightWeighttoken✗
strokeAlign"INSIDE" | "OUTSIDE" | "CENTER"✗Stroke position (default: INSIDE)
cornerRadiustoken✗All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
topLeftRadiustoken✗
topRightRadiustoken✗
bottomRightRadiustoken✗
bottomLeftRadiustoken✗
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.
paddingtoken✗All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
paddingToptoken✗
paddingRighttoken✗
paddingBottomtoken✗
paddingLefttoken✗
primaryAxisAlignItems"MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN"✗
counterAxisAlignItems"MIN" | "MAX" | "CENTER" | "BASELINE"✗
itemSpacingtoken✗Spacing between children (number or variable name string, default: 0)
counterAxisSpacingtoken✗Gap between wrapped rows (requires layoutWrap: WRAP)
strokesIncludedInLayoutboolean✗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"✗
minWidthnumber✗Min width for responsive auto-layout
maxWidthnumber✗Max width for responsive auto-layout
minHeightnumber✗Min height for responsive auto-layout
maxHeightnumber✗Max height for responsive auto-layout
annotationsobject[]✗Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
clipsContentboolean✗
childrenobject[]✗Inline child nodes — build nested trees in one call. Types: text: {type:"text", text, textStyleName?, fontColorVariableName?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillVariableName?, itemSpacing?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. rectangle / ellipse / line: same params as the corresponding frames(method:"create", type:"rectangle"|"ellipse"|"line") branch. All params from text/frame endpoints are supported on their respective types. Inline fills/strokes accept Paint[] authoring input: SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. Do not use CSS gradients, REST gradientHandlePositions, or IMAGE/VIDEO/PATTERN in Paint[] authoring. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"ellipse", name:"Dot", width:6, height:6, fillVariableName:"status/active"}, {type:"text", name:"Title", text:"Title", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:"space/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 frame that arranges children automatically

frames(method:"create", type:"auto_layout", items:[{name:"Settings Card", width:360, height:180, layoutMode:"VERTICAL", padding:"space/24", itemSpacing:"space/12", fillVariableName:"bg/surface", strokeVariableName:"border/subtle", strokeWeight:"stroke/1", cornerRadius:"radius/12", children:[{type:"text", name:"Team settings", text:"Team settings", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"text", name:"Manage workspace preferences.", text:"Manage workspace preferences.", textStyleName:"Body/Regular", fontColorVariableName:"text/secondary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}])
ParameterTypeRequiredDescription
namestring✗Node name
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
widthnumber✗Width in px (omit to shrink-to-content via HUG)
heightnumber✗Height in px (omit to shrink-to-content via HUG)
rotationnumber✗Rotation in degrees (0-360)
visibleboolean✗Show/hide (default true)
lockedboolean✗Lock/unlock (default false)
opacitytoken✗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"✗
effectStyleNamestring✗Effect style name (e.g. 'Shadow/Card') for shadows, blurs
fillsobject[]✗Fill Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
fillColorstring✗Shorthand — sets a single solid fill (auto-binds to matching variable/style)
fillStyleNamestring✗Paint style name for fill
fillVariableNamestring✗Color variable by name e.g. 'bg/surface'
imageUrlstring✗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)
strokesobject[]✗Stroke Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
strokeColorstring✗Shorthand — sets a single solid stroke (auto-binds to matching variable/style)
strokeStyleNamestring✗Paint style name for stroke
strokeVariableNamestring✗Color variable by name for stroke
strokeWeighttoken✗All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
strokeTopWeighttoken✗
strokeBottomWeighttoken✗
strokeLeftWeighttoken✗
strokeRightWeighttoken✗
strokeAlign"INSIDE" | "OUTSIDE" | "CENTER"✗Stroke position (default: INSIDE)
cornerRadiustoken✗All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
topLeftRadiustoken✗
topRightRadiustoken✗
bottomRightRadiustoken✗
bottomLeftRadiustoken✗
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.
paddingtoken✗All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
paddingToptoken✗
paddingRighttoken✗
paddingBottomtoken✗
paddingLefttoken✗
primaryAxisAlignItems"MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN"✗
counterAxisAlignItems"MIN" | "MAX" | "CENTER" | "BASELINE"✗
itemSpacingtoken✗Spacing between children (number or variable name string, default: 0)
counterAxisSpacingtoken✗Gap between wrapped rows (requires layoutWrap: WRAP)
strokesIncludedInLayoutboolean✗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"✗
minWidthnumber✗Min width for responsive auto-layout
maxWidthnumber✗Max width for responsive auto-layout
minHeightnumber✗Min height for responsive auto-layout
maxHeightnumber✗Max height for responsive auto-layout
annotationsobject[]✗Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
clipsContentboolean✗
nodeIdsstring[]✗Existing node IDs to wrap into auto-layout
childrenobject[]✗Inline child nodes — build nested trees in one call. Types: text: {type:"text", text, textStyleName?, fontColorVariableName?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillVariableName?, itemSpacing?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. rectangle / ellipse / line: same params as the corresponding frames(method:"create", type:"rectangle"|"ellipse"|"line") branch. All params from text/frame endpoints are supported on their respective types. Inline fills/strokes accept Paint[] authoring input: SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. Do not use CSS gradients, REST gradientHandlePositions, or IMAGE/VIDEO/PATTERN in Paint[] authoring. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"ellipse", name:"Dot", width:6, height:6, fillVariableName:"status/active"}, {type:"text", name:"Title", text:"Title", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:"space/8", children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties.

Figma section (top-level organizer)

frames(method:"create", type:"section", items:[{name:"Components", x:0, y:0, width:1200, height:800, fillVariableName:"bg/canvas"}])
ParameterTypeRequiredDescription
namestring✓Section name
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
widthnumber✗Width (default: 500)
heightnumber✗Height (default: 500)
fillsobject[]✗Fill Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only
fillColorstring✗Shorthand — sets a single solid fill (auto-binds to matching variable/style)
fillStyleNamestring✗Paint style name for fill
fillVariableNamestring✗Color variable by name e.g. 'bg/surface'
imageUrlstring✗Image source — 'pexel:<id>', public URL, or local file path
imageScaleMode"FILL" | "FIT" | "CROP" | "TILE"✗How the image is scaled (default: FILL)

Rectangle shape node

frames(method:"create", type:"rectangle", items:[{name:"Avatar Placeholder", width:64, height:64, cornerRadius:"radius/16", fillVariableName:"bg/muted"}])
ParameterTypeRequiredDescription
namestring✗Layer name (default: 'Rectangle')
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
widthnumber✗Width in px (default: 100)
heightnumber✗Height in px (default: 100)
fillsobject[]✗Fill Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only
fillColorstring✗Shorthand — sets a single solid fill (auto-binds to matching variable/style)
fillStyleNamestring✗Paint style name for fill
fillVariableNamestring✗Color variable by name e.g. 'bg/surface'
imageUrlstring✗Image source — 'pexel:<id>', public URL, or local file path
imageScaleMode"FILL" | "FIT" | "CROP" | "TILE"✗How the image is scaled (default: FILL)
strokesobject[]✗Stroke Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only
strokeColorstring✗Shorthand — sets a single solid stroke (auto-binds to matching variable/style)
strokeVariableNamestring✗Color variable by name for stroke
strokeWeighttoken✗
cornerRadiustoken✗All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
topLeftRadiustoken✗
topRightRadiustoken✗
bottomRightRadiustoken✗
bottomLeftRadiustoken✗
opacitytoken✗
layoutSizingHorizontal"FIXED" | "FILL"✗Horizontal sizing in auto-layout parent
layoutSizingVertical"FIXED" | "FILL"✗Vertical sizing in auto-layout parent
annotationsobject[]✗Annotations — [{label?, labelMarkdown?, properties?, categoryId?}]

Ellipse/circle shape node

frames(method:"create", type:"ellipse", items:[{name:"Status Dot", width:12, height:12, fillVariableName:"status/success"}])
ParameterTypeRequiredDescription
namestring✗Layer name (default: 'Ellipse')
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
widthnumber✗Width in px (default: 100)
heightnumber✗Height in px (default: 100, same as width for circle)
fillsobject[]✗Fill Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only
fillColorstring✗Shorthand — sets a single solid fill (auto-binds to matching variable/style)
fillStyleNamestring✗Paint style name for fill
fillVariableNamestring✗Color variable by name e.g. 'bg/surface'
imageUrlstring✗Image source — 'pexel:<id>', public URL, or local file path
imageScaleMode"FILL" | "FIT" | "CROP" | "TILE"✗How the image is scaled (default: FILL)
strokesobject[]✗Stroke Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only
strokeColorstring✗Shorthand — sets a single solid stroke (auto-binds to matching variable/style)
strokeVariableNamestring✗Color variable by name for stroke
strokeWeighttoken✗
opacitytoken✗
layoutSizingHorizontal"FIXED" | "FILL"✗Horizontal sizing in auto-layout parent
layoutSizingVertical"FIXED" | "FILL"✗Vertical sizing in auto-layout parent
annotationsobject[]✗Annotations — [{label?, labelMarkdown?, properties?, categoryId?}]

Line shape node

frames(method:"create", type:"line", items:[{name:"Divider", length:320, strokeVariableName:"border/subtle", strokeWeight:"stroke/1"}])
ParameterTypeRequiredDescription
namestring✗Layer name (default: 'Line')
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
lengthnumber✗Line length in px (default: 100)
rotationnumber✗Rotation in degrees (default: 0 = horizontal)
strokesobject[]✗Stroke Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only
strokeColorstring✗Line color (default: black, auto-binds to matching variable/style)
strokeVariableNamestring✗Color variable by name for stroke
strokeWeighttoken✗Line thickness (default: 1)
opacitytoken✗
layoutSizingHorizontal"FIXED" | "FILL"✗Horizontal sizing in auto-layout parent (defaults to FILL in vertical auto-layout)
annotationsobject[]✗Annotations — [{label?, labelMarkdown?, properties?, categoryId?}]

Group existing nodes together

frames(method:"create", type:"group", items:[{nodeIds:["1:2","1:3"], name:"Icon Group"}])
ParameterTypeRequiredDescription
nodeIdsstring[]✓Node IDs to group (min 1)
namestring✗Group name
parentIdstring✗Parent node ID. Omit to place at current page root.

Combine shapes with boolean operations (union, subtract, intersect, exclude)

frames(method:"create", type:"boolean_operation", items:[{operation:"UNION", nodeIds:["1:2","1:3"], name:"Combined Shape", fillVariableName:"bg/accent"}])
ParameterTypeRequiredDescription
fillStyleNamestring✗Paint style to apply to vector fills
fillVariableNamestring✗Color variable by name for vector fills
strokeStyleNamestring✗Paint style to apply to vector strokes
strokeVariableNamestring✗Color variable by name for vector strokes
operation"UNION" | "SUBTRACT" | "INTERSECT" | "EXCLUDE"✓Boolean operation type
nodeIdsstring[]✓Node IDs to combine (min 2, first node is the base for SUBTRACT)
namestring✗Result node name
parentIdstring✗Parent node ID. Omit to place at current page root.

Create node from SVG markup

frames(method:"create", type:"svg", items:[{name:"Logo Mark", svg:"<svg width=\"24\" height=\"24\"><path d=\"M4 4h16v16H4z\" fill=\"currentColor\"/></svg>", fillVariableName:"icon/primary"}])
ParameterTypeRequiredDescription
fillStyleNamestring✗Paint style to apply to vector fills
fillVariableNamestring✗Color variable by name for vector fills
strokeStyleNamestring✗Paint style to apply to vector strokes
strokeVariableNamestring✗Color variable by name for vector strokes
svgstring✓SVG markup string
namestring✗Layer name (default: 'SVG')
parentIdstring✗Parent node ID. Omit to place at current page root.
xnumber✗X position (default: 0)
ynumber✗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.

frames(method:"create", type:"slot", items:[{componentId:"1:23", name:"Content Slot", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}])
ParameterTypeRequiredDescription
namestring✗Node name
parentIdstring✗Parent node ID inside the owning component. Required unless componentId is provided.
xnumber✗X position (default: 0)
ynumber✗Y position (default: 0)
widthnumber✗Width in px (omit to shrink-to-content via HUG)
heightnumber✗Height in px (omit to shrink-to-content via HUG)
rotationnumber✗Rotation in degrees (0-360)
visibleboolean✗Show/hide (default true)
lockedboolean✗Lock/unlock (default false)
opacitytoken✗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"✗
effectStyleNamestring✗Effect style name (e.g. 'Shadow/Card') for shadows, blurs
fillsobject[]✗Fill Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
fillColorstring✗Shorthand — sets a single solid fill (auto-binds to matching variable/style)
fillStyleNamestring✗Paint style name for fill
fillVariableNamestring✗Color variable by name e.g. 'bg/surface'
imageUrlstring✗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)
strokesobject[]✗Stroke Paint[] authoring — accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
strokeColorstring✗Shorthand — sets a single solid stroke (auto-binds to matching variable/style)
strokeStyleNamestring✗Paint style name for stroke
strokeVariableNamestring✗Color variable by name for stroke
strokeWeighttoken✗All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
strokeTopWeighttoken✗
strokeBottomWeighttoken✗
strokeLeftWeighttoken✗
strokeRightWeighttoken✗
strokeAlign"INSIDE" | "OUTSIDE" | "CENTER"✗Stroke position (default: INSIDE)
cornerRadiustoken✗All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
topLeftRadiustoken✗
topRightRadiustoken✗
bottomRightRadiustoken✗
bottomLeftRadiustoken✗
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.
paddingtoken✗All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
paddingToptoken✗
paddingRighttoken✗
paddingBottomtoken✗
paddingLefttoken✗
primaryAxisAlignItems"MIN" | "MAX" | "CENTER" | "SPACE_BETWEEN"✗
counterAxisAlignItems"MIN" | "MAX" | "CENTER" | "BASELINE"✗
itemSpacingtoken✗Spacing between children (number or variable name string, default: 0)
counterAxisSpacingtoken✗Gap between wrapped rows (requires layoutWrap: WRAP)
strokesIncludedInLayoutboolean✗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"✗
minWidthnumber✗Min width for responsive auto-layout
maxWidthnumber✗Max width for responsive auto-layout
minHeightnumber✗Min height for responsive auto-layout
maxHeightnumber✗Max height for responsive auto-layout
annotationsobject[]✗Set annotations — [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
componentIdstring✗Owning component ID. Optional — auto-resolved from parentId by walking up ancestors.

Response

FieldTypeDescription
resultsobject[]One entry per input item
↳ idstring

Commit a staged node — unwraps from [STAGED] container into the original target location.

Example

frames(method:"commit", id:"1:234")
ParameterTypeRequiredDescription
idstring✓Staged node ID to commit

Response

FieldTypeDescription
resultsobject[]One entry per input item
↳ idstring

Export a node as PNG, JPG, SVG, SVG_STRING, or PDF

ParameterTypeRequiredDescription
idstring✓Node ID to export
format"PNG" | "JPG" | "SVG" | "SVG_STRING" | "PDF"✗Export format (default: PNG). SVG_STRING returns raw SVG text.
scalenumber✗Export scale (default: 1, only for PNG/JPG)

Response

Binary image data returned as MCP image content (SVG_STRING returns text)

FieldTypeDescription
imageDatastring
mimeTypestring