Skip to content

Instances

Create and manage component instances.

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.
// Instances are linked copies of components. Changes to the component propagate to all instances.
// Overrides: instance-level changes (text, fills, visibility) that differ from the component. Shown in overrides array.
// variantProperties: when creating from a component set, pick which variant e.g. {"Style":"Secondary","Size":"Large"}.
// ---
// Property keys: read returns clean names ("Label"), write requires the #suffix ("Label#1:0"). Call instances.get(id) to discover exact keys before update.
// swap: change which component an instance points to while preserving compatible overrides.
// detach: permanently converts an instance to a regular frame, breaking the component link.
// reset_overrides: reverts all instance overrides to match the main component.
// Workflow (local components): components.list → instances.create with componentId + properties (one call).
// Workflow (external/published libraries): library(method:"components", query:"...") → instances.create with componentName + properties. The MCP resolves componentName → key and imports via figma.importComponentByKeyAsync — the raw key never enters agent context.
// Instances support frame-level overrides: layoutSizingHorizontal/Vertical (FIXED, FILL, HUG), opacity, width/height, min/max.
// Use layoutSizingHorizontal: "FILL" to make instances stretch in auto-layout parents.

11 methods available.

readinherited

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

ParameterTypeRequiredDescription
querystringName search query (case-insensitive substring match)
typesstring[]Filter by node types (e.g. ["FRAME", "TEXT"])
parentIdstringSearch 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.
offsetnumberSkip N items for pagination (default 0) (default: 0)
limitnumberMax 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

Delete nodes

ParameterTypeRequiredDescription
idstringSingle 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
idstringNode ID
namestringRename the clone (set before appending to parent — required when cloning a variant into its component set to avoid duplicate names)
parentIdstringParent node ID. Omit to place at current page root.
xnumberX position (default: 0)
ynumberY position (default: 0)
itemsobject[]Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.
idstringNode ID to clone
namestringRename the clone
parentIdstringTarget parent
xnumber
ynumber
depthnumberResponse 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
readinherited

Run lint on a node — returns severity-ranked findings

ParameterTypeRequiredDescription
idstringNode ID to audit
rulesstring[]Rules to check. Default: ["all"]. Categories: "component", "composition", "token", "naming", "wcag".
maxDepthnumberMax tree depth (default: 10)
maxFindingsnumberMax 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.
skipInstancesbooleanSkip 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

Get instance detail with component properties and overrides

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

Response

FieldTypeDescription
resultsarraySerialized node(s) with componentProperties, overrides
_truncatedboolean

Create component instances

ParameterTypeRequiredDescription
itemsobject[]Array of {componentId, variantProperties?, x?, y?, parentId?, layoutSizingHorizontal?, ...}
visiblebooleanShow/hide (default true)
lockedbooleanLock/unlock (default false)
opacitytokenOpacity (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"
effectStyleNamestringEffect style name (e.g. 'Shadow/Card') for shadows, blurs
layoutSizingHorizontal"FIXED" | "HUG" | "FILL"
layoutSizingVertical"FIXED" | "HUG" | "FILL"
layoutPositioning"AUTO" | "ABSOLUTE"ABSOLUTE = floating inside auto-layout parent
minWidthnumberMin width for responsive auto-layout
maxWidthnumberMax width for responsive auto-layout
minHeightnumberMin height for responsive auto-layout
maxHeightnumberMax height for responsive auto-layout
componentIdstringLocal component or component set ID. Pass this OR componentKey.
componentKeystringPublished library component key — imports from a team library via importComponentByKeyAsync. Discover keys via library(method:"components", ...); the library tool auto-resolves names → keys so you normally pass componentName instead.
componentNamestringName of a component previously discovered via the library tool. Resolved to a componentKey MCP-side — the agent never handles the raw key. Preferred over componentKey for context hygiene.
sizing"contextual""contextual": infer FILL/HUG from parent layout (e.g. FILL horizontally in a VERTICAL auto-layout parent). Omit to inherit sizing from the component definition.
variantPropertiesobjectPick variant e.g. {"Style":"Secondary"}
propertiesobjectSet component properties inline e.g. {"Label":"Click me", "ShowIcon":true}. Same as instances.update properties.
namestringInstance layer name
xnumber
ynumber
widthnumberOverride width (resize)
heightnumberOverride height (resize)
explicitModeobjectPin variable mode at creation — use { collectionName, modeName } (preferred) or { collectionId, modeId }. Useful for library components with Light/Dark modes.
parentIdstringParent node ID. Omit to place at current page root.
depthnumberResponse 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

Set instance properties

ParameterTypeRequiredDescription
itemsobject[]Array of {id, properties: {"Label#1:0":"text"}, fillColor?: ...}
fillsarrayFill paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
fillColorstringShorthand — sets a single solid fill (auto-binds to matching variable/style)
fillStyleNamestringPaint style name for fill
fillVariableNamestringColor variable by name e.g. 'bg/primary'
strokesarrayStroke paints array — e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
strokeColorstringShorthand — sets a single solid stroke (auto-binds to matching variable/style)
strokeStyleNamestringPaint style name for stroke
strokeVariableNamestringColor variable by name for stroke
strokeWeighttokenAll sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
strokeTopWeighttoken
strokeBottomWeighttoken
strokeLeftWeighttoken
strokeRightWeighttoken
strokeAlign"INSIDE" | "OUTSIDE" | "CENTER"Stroke position (default: INSIDE)
cornerRadiustokenAll corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
topLeftRadiustoken
topRightRadiustoken
bottomRightRadiustoken
bottomLeftRadiustoken
visiblebooleanShow/hide (default true)
lockedbooleanLock/unlock (default false)
opacitytokenOpacity (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"
effectStyleNamestringEffect 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.
paddingtokenAll 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"
itemSpacingtokenSpacing between children (number or variable name string, default: 0)
counterAxisSpacingtokenGap between wrapped rows (requires layoutWrap: WRAP)
strokesIncludedInLayoutbooleanInclude stroke width in layout measurements (default: false)
layoutSizingHorizontal"FIXED" | "HUG" | "FILL"
layoutSizingVertical"FIXED" | "HUG" | "FILL"
layoutPositioning"AUTO" | "ABSOLUTE"ABSOLUTE = floating inside auto-layout parent
minWidthnumberMin width for responsive auto-layout
maxWidthnumberMax width for responsive auto-layout
minHeightnumberMin height for responsive auto-layout
maxHeightnumberMax height for responsive auto-layout
fontSizenumberFont size
fontFamilystringFont family
fontStylestringFont variant e.g. "Bold", "Italic" — overrides fontWeight
fontWeightnumber100-900. Ignored when fontStyle is set.
lineHeightanynumber | {value, unit: "PIXELS"|"PERCENT"|"AUTO"}
letterSpacinganynumber | {value, unit: "PIXELS"|"PERCENT"}
textCase"ORIGINAL" | "UPPER" | "LOWER" | "TITLE" | "SMALL_CAPS" | "SMALL_CAPS_FORCED"
textDecoration"NONE" | "UNDERLINE" | "STRIKETHROUGH"
fontColorstringShorthand — sets text color (auto-binds to matching variable/style)
fontColorVariableNamestringBind color variable by name e.g. 'text/primary'
fontColorStyleNamestringApply paint style — overrides fontColor
textStyleIdstringApply text style by ID — overrides fontSize/fontWeight
textStyleNamestringText style by name (case-insensitive)
textAlignHorizontal"LEFT" | "CENTER" | "RIGHT" | "JUSTIFIED"
textAlignVertical"TOP" | "CENTER" | "BOTTOM"
textAutoResize"NONE" | "WIDTH_AND_HEIGHT" | "HEIGHT" | "TRUNCATE"
idstringInstance node ID
propertiesobjectComponent property key→value map
componentPropertiesobjectAlias for properties (matches instances.get response shape)
namestringRename node
rotationnumberDegrees (0-360)
xnumber
ynumber
widthnumber
heightnumber
clearFillbooleanRemove all fills
effectsobject[]Effect array (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR)
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
explicitModeobjectPin variable mode — use { collectionName, modeName } (preferred) or { collectionId, modeId }
exportSettingsobject[]Export settings

Response

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

Swap instance component (preserves overrides)

ParameterTypeRequiredDescription
itemsobject[]Array of {id, componentId}
idstringInstance node ID
componentIdstringNew component or component set ID

Response

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

Detach instances from their component (converts to frame)

ParameterTypeRequiredDescription
itemsobject[]Array of {id}
idstringInstance node ID

Response

FieldTypeDescription
resultsobject[]One entry per input item
idstring

Reset all overrides on instances to match their main component

ParameterTypeRequiredDescription
itemsobject[]Array of {id}
idstringInstance node ID

Response

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