mcp

v0.8.1
@figwright/mcp Checked 2 days ago Published 9 days ago

Free, two-way Figma MCP server.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

ping

Health check. Returns server info plus, when a plugin is connected, end-to-end info from the Figma sandbox. On a follower it also reports the leader’s version and build, and warns (versionSkew / buildSkew) when a stale older server still owns the plugin. sessions.all names each connected file as of its last activity, so a file whose tab has not been in front since it connected shows fileName: null — use list_files, which asks each plugin directly, when you need the names (and use_file to claim one).

get_selection

Return the current selection on the active Figma page: { pageId, pageName, nodes }, where each node is a full flat serialization — geometry, fills/strokes/effects, text properties, style/variable ids, mainComponent — without children. The zero-argument "what is the user looking at" call: use it to identify the selected node ids (and page), then walk deeper with get_design_context or get_node. An empty nodes array means nothing is selected.

get_document

Return the full node tree (recursive children) of the active Figma page, with base geometry, rotation, opacity, cornerRadius, and fills enrichment.

get_node

Return one node by id with its full recursive subtree at maximum fidelity — every serialized field (geometry, paints, effects, auto-layout, text with per-run segments, style/variable ids, mainComponent), no depth limit, no deduplication. Best for inspecting a single component or a node you are about to modify; for exploring or grounding anything large, prefer get_design_context (depth-limited, deduped, tokens resolved to names). Returns { node }, null when the id matches nothing.

ParameterTypeDescription
nodeId *stringFigma node id, e.g. "1:42"; a pasted Figma URL also works

get_nodes_info

Return multiple Figma nodes by id. Output preserves input order; missing ids slot null.

ParameterTypeDescription
nodeIds *arrayFigma node ids to fetch

get_vector

Read a vector’s geometry — what set_vector takes back: vectorPaths (SVG path data per subpath, measured from the layer’s top-left) and vectorNetwork (vertices, the segments joining them with their Bézier tangents, the regions that fill, and per-vertex caps, joins and corner radii), plus handleMirroring. For a VECTOR or text on a path (TEXT_PATH, read-only); a rectangle, ellipse, polygon, star or line has no editable path — flatten_nodes it into a VECTOR first. Not part of get_node / get_design_context, which stay small; codegen exports vector art rather than rebuilding it from its poi…

ParameterTypeDescription
nodeId *stringA VECTOR or TEXT_PATH node id

get_metadata

Return file metadata: fileName, current page, all page references, and which editor the file is open in (editorType / mode) — "dev" is read-only and "figjam" has no components, variables or styles — and colorProfile, the space its colours are stored in (SRGB / DISPLAY_P3 / LEGACY): in a DISPLAY_P3 file every r/g/b is P3, so a colour written from code takes space: "SRGB".

get_pages

Return every page in the active Figma file as { id, name, flows }. flows lists the prototype flows Presentation view offers on that page, as { nodeId, name } in order: nodeId is the flow's starting frame, and the first flow is the one Presentation view opens by default. An empty flows means the page has none a plugin can see (a flow whose frame is hidden, grouped or nested is invisible until that frame is visible and top-level again). Change flows with update_flows.

search_nodes

Search the node tree by case-insensitive name substring and/or exact node type. At least one of name or type is required. Scope to a subtree with root (a node id); defaults to the current page. Returns a flat array of matching nodes.

ParameterTypeDescription
namestringCase-insensitive substring matched against node names
rootstringNode id to scope the search; omit for the current page
typestringExact node type to match, e.g. "TEXT", "FRAME"

scan_text_nodes

Return every TEXT node within a subtree, each with its characters / fontSize / fontName — text set along a path (TEXT_PATH) included, and every FigJam sticky, shape with text, table cell and connector, with the words it holds (characters only; set_text rewrites them). Scope with root (a node id); defaults to the current page.

ParameterTypeDescription
rootstringNode id to scope the scan; omit for the current page

scan_nodes_by_types

Return a flat list of every node whose type is in `types`, searched recursively through a subtree scoped by `root` (a node id) or the current page by default. Use this to collect nodes by kind (e.g. all TEXT or COMPONENT nodes); to search by name or characters use search_nodes, and for a styled tree snapshot use get_design_context. Returns a flat array of matching nodes.

ParameterTypeDescription
types *arrayNode types to match, e.g. ["FRAME", "COMPONENT"]
rootstringNode id to scope the scan; omit for the current page

get_styles

Return the document's local styles grouped as { paints, texts, effects, grids }. Paint styles carry their paints; text styles carry fontName / fontSize / lineHeight / letterSpacing / textWrapStyle; effect styles carry their effects; grid styles carry their layout grids. Any value the designer bound to a variable carries a `boundVariables` map ({ field: variableId }) on the object that owns it — the individual paint, gradient stop, effect or layout grid, and the text style itself for typography. A bound value is a reference, not a literal: emit the token, not the resolved colour/number sittin…

ParameterTypeDescription
documentationbooleanAlso return each style's documentation link (only where it has one)

get_variable_defs

Return the document's local variables as { collections, variables }. Each collection lists its modes and defaultModeId; each variable lists its resolvedType and valuesByMode (primitives, RGBA colors, { type: "VARIABLE_ALIAS", id } references to other variables, a composed color { color, opacity } pairing a color with a separate opacity where either half may be an alias, or — for an EASING variable — an easing curve { type, easingFunctionCubicBezier?, easingFunctionSpring? }). A variable also carries scopes when the designer narrowed where Figma offers it (e.g. ["CORNER_RADIUS"]) — author…

ParameterTypeDescription
documentationbooleanAlso return each variable's description and publishing flag (only where set)

get_local_components

Return the components and component sets within a node subtree (or the current selection) as { components, componentSets }. Scans a subtree, not the whole document — pass nodeId, or select the frames to scan. A document root is not supported; use get_pages and scan each page by nodeId. Components carry their variantProperties (when part of a set); component sets carry their variantGroupProperties (available values per axis) and the ids of their variant components. A set Figma flags with errors (two variants with the same values, or variants whose properties differ) carries componentSetError…

ParameterTypeDescription
documentationbooleanAlso return descriptionMarkdown (when it has formatting) and documentationLinks for each
nodeIdstringRoot node id to scan within; omit to use the current selection

get_component_api

Return a component's full property API — the prop contract behind its instances. Pass a COMPONENT, COMPONENT_SET, or INSTANCE id (an instance resolves to its main component / set). Returns { id, name, type, properties } where properties maps each property name to { type (VARIANT|BOOLEAN|TEXT|INSTANCE_SWAP|SLOT), defaultValue, variantOptions?, preferredValues?, description? }. Property names come back verbatim for set_instance_properties: VARIANT by bare name (e.g. "Size"), BOOLEAN/TEXT/INSTANCE_SWAP suffixed with #id (e.g. "Label#2:0"). Unlike get_local_components (a subtree inventory), this…

ParameterTypeDescription
nodeId *stringA COMPONENT, COMPONENT_SET, or INSTANCE node id to read the property API of
documentationbooleanAlso return the resolved component's or set's description and documentation link

get_viewport

Return the current page viewport as { center, zoom, bounds } — the on-screen center point, zoom level (1.0 = 100%), and visible bounds rect.

get_fonts

Return every font used on the current page as { fonts: [{ fontName, count }] }, sorted by usage frequency (descending). Mixed-font text contributes one count per styled segment. fontName carries variationSettings for a variable font — two rows sharing a family + style but differing there are different weights, not duplicates. A sibling variationAxes { family: ["wght", "slnt", ...] } lists the OpenType axes each variable family exposes: those are the tags the write tools accept in fontName.variationSettings. A family missing from it is static.

get_annotations

Return Dev Mode annotations as { annotations: [{ nodeId, nodeName, annotations }], categories }. With nodeId, returns that node's annotations; without it, scans the current page for all annotated nodes. A note carries label and labelMarkdown (the same text, plain and formatted); categoryId and properties (the node fields pinned to it) when set, and an annotation may be properties alone. categories lists every category in the file ({ id, label, color, isPreset }), so a categoryId resolves to its label; an id not listed names a category deleted since. With measurements: true it also lists the pa…

ParameterTypeDescription
measurementsbooleanAlso return the page's (or the node's) Dev Mode measurements
nodeIdstringNode id to read annotations from; omit to scan the current page

get_reactions

Return the prototype reactions on a node as { nodeId, reactions: [{ trigger, actions }] }. Each reaction pairs an interaction trigger (click, hover, key press, timeout…) with its actions — navigate to a node, open an overlay, open a URL, back/close, set a variable or variable mode, control media, or a conditional block. Every field Figma holds is returned, including each action's transition and easing, so the output can be handed back to set_reactions unchanged to reproduce the reactions exactly.

ParameterTypeDescription
nodeId *stringFigma node id to read reactions from

get_motion_styles

List the file's available Figma Motion animation-style presets — the templates you apply with apply_animation_style. Returns { styles: [{ styleId, name, description?, props? }] }; the styleId is what apply_animation_style takes and props lists a preset’s tunable keys. Motion is a beta feature: this read works wherever the plugin API exposes it; applying presets needs the Figma Design editor.

get_node_motion

Read one node's Figma Motion (animation) state: applied animation styles, all keyframe animations, manual keyframe tracks, and the timelines it belongs to. Call it before editing to discover styleIds / timelineIds and existing keyframes; for every animated layer under a frame use get_motion_context. Returns { nodeId, motion: { animationStyles, animations, manualKeyframeTracks, timelines } }, raw as Figma returns it, with motion: null when the node supports no Motion. Also returns playheadPosition — the editor's Motion playhead in seconds, present only with an active timeline. Use it as a key…

ParameterTypeDescription
nodeId *stringFigma node id to read Motion state from

get_motion_context

List every Figma Motion (animation) source under a node: the node and its whole subtree, hidden layers and instance children included, never deduped (each instance under its own instance-qualified id). Call it once per root you implement — only coverage.status "complete" with no nodes means nothing there animates; a missing motion summary in get_design_context does not. Returns { rootNodeId, coverage, diagnostics?, nodes: [{ nodeId, parentId, name, type, motion }] } for each node with an applied animation style or a keyframe; motion is get_node_motion’s raw read, except that manualKeyframe…

ParameterTypeDescription
nodeId *stringFrame or layer id whose subtree to inventory (a top-level frame covers its timeline)

list_files

Return every Figma file that currently has the Figwright plugin open, as { files: [{ sessionId, fileName, currentPage, pluginVersion, routed, bound, duplicateName?, error? }] }. More than one entry means more than one file is reachable, and calls follow whichever one the user last touched (routed: true) — which changes under you when they switch tabs. Claim one with use_file so this agent stays in it. bound marks the file this agent has claimed. duplicateName marks entries sharing a name (Figma allows it; "x (Copy)" is the usual way), for which use_file needs the sessionId rather than the na…

use_file

Claim one open Figma file for this agent, so its tool calls stop following whichever file the user last touched. Call this when list_files or ping shows more than one file connected — without it two agents working on two files both track the foreground tab, and the one that is not in front silently reads and writes the wrong file. Pass fileName (refused when two open files share it) or sessionId (always unambiguous; take it from list_files). release: true drops the claim and goes back to following the foreground file. The claim lasts for this server process only, so it never affects another…

ParameterTypeDescription
fileNamestringName of the open file to claim; refused if two open files share it
releasebooleanDrop the claim and go back to following the foreground file
sessionIdstringExact plugin session to claim, from list_files — never ambiguous

get_design_context

Get a depth-limited, token-efficient node tree — the main design-grounding read; prefer it over get_document / get_node for anything large. Starts from nodeId (a pasted Figma URL also works), else the current selection; errors when neither is available. detail: minimal (id/name/type) / compact (+ geometry) / full (+ styling, layout, text and design-system tokens resolved to names plus a deduped globalVars style table). Defaults to full with dedupeComponents true — the code-generation view; pass detail: compact explicitly for a cheap structure scan. An over-budget full result degrades grace…

ParameterTypeDescription
dedupeComponentsbooleanCollapse repeated instances of the same main component (default true)
depthnumberMax child levels to include; omit or 0 for unlimited
detailstringHow much per-node data: minimal / compact / full (default)
nodeIdstringRoot node id (a pasted Figma URL also works); omit to use the selection

get_screenshot

Export nodes as images the model can see, one image block per node: { images: [{ nodeId, format, base64, width?, height?, scale?, recovered?, empty? }] }. format is PNG (default) / JPG / SVG. scale applies to raster formats; when omitted, each node is auto-fitted to a legible size (long edge into ~512–2576px: oversized frames scale down, tiny icons scale up ≤4x) — pass an explicit scale to force one. An explicit scale is capped so the long edge stays within 2576px, the most a vision model resolves: past that the model sees the identical pixels, so the extra bytes buy no detail — use sa…

ParameterTypeDescription
nodeIds *arrayFigma node ids to export
formatstringExport format: PNG (default) / JPG / SVG
scalenumberRaster scale factor (PNG/JPG); omit to auto-fit each node to a legible size

save_screenshots

Export nodes and write them to disk under outDir: { saved: [{ nodeId, format, path, recovered?, empty? }] }. format is PNG (default) / JPG / SVG; scale applies to raster formats (default 1). path is null for missing or non-exportable nodes. Nodes that are fully clipped or off-canvas (e.g. a carousel's edge items) are auto-recovered at their intrinsic bounds and flagged recovered:true. empty:true means the node genuinely renders nothing even unclipped (hidden / no content) so the file is blank. Files are named after a sanitized node id.

ParameterTypeDescription
nodeIds *arrayFigma node ids to export
outDir *stringDirectory to write files into (created if missing)
formatstringExport format: PNG (default) / JPG / SVG
scalenumberRaster scale factor (PNG/JPG), default 1

save_image_fills

Extract the ORIGINAL image bytes behind each node's IMAGE fills and write them to disk under outDir — the source asset exactly as uploaded (no mask, clip, crop, scale, or effects applied), unlike save_screenshots / get_screenshot which re-render the composited node. Returns { nodes: [{ nodeId, images: [{ index, imageHash, format, path, width?, height?, scaleMode? }], mixed? }] }. index is the fill position in node.fills; width/height are the image intrinsic size; scaleMode is how the fill is displayed (FILL / FIT / CROP / TILE); format is sniffed from the bytes (PNG / JPG / GIF / WEBP, or BI…

ParameterTypeDescription
nodeIds *arrayFigma node ids whose IMAGE fills to extract
outDir *stringDirectory to write the original image files into (created if missing)

export_pdf

Export a node (or the current page) to a single-page vector PDF file on disk. Figma's plugin API renders one PDF page per node and cannot paginate a page into one-frame-per-page or merge multiple nodes into a multi-page file. Pass a frame / section / component id for a vector PDF of that node; omit nodeId for the current page (large pages can be slow). For raster output (PNG/JPG) use save_screenshots instead. Returns { nodeId, path, empty? }; path is null if the target is missing or not exportable, and empty:true means it rendered a blank PDF.

ParameterTypeDescription
outPath *stringFile path to write the .pdf to (parent dirs created if missing)
nodeIdstringNode to export to a one-page PDF (a frame / section / component); omit for the current page

export_video

Export an animated Figma top-level frame to an MP4 / WebM / GIF file on disk. Pass any node in the frame (or the frame itself) — its enclosing top-level frame is encoded across the animation's duration. Requires the Figma Design editor and a frame with animated content (Smart Animate / Motion keyframes); a static frame, a nested frame, or FigJam / Dev Mode yields path:null with a reason (and, when reason is `failed`, Figma’s own message in error). Encoding is a heavy render — call it on its own, not concurrently with other tool calls, or the render can fail. Returns { nodeId, format, pat…

ParameterTypeDescription
format *stringMP4 / WebM (video) or GIF (looping)
nodeId *stringA node in the animated frame to export; its enclosing top-level frame (a frame placed directly on a page) is what gets encoded — pass the frame itself or any descendant
outPath *stringFile path to write the video to (parent dirs created if missing)
constraintOutput size: a SCALE multiplier (0.5/0.75/1/1.5/2/3/4) or a fixed WIDTH/HEIGHT in px
fpsnumberFrames per second (MP4/WebM: 12/24/30/60; GIF: 8/12/15/24/30). Defaults per format.
loopCountintegerGIF only: number of loops; 0 = loop forever
qualitystringMP4/WebM quality; ignored for GIF

analyze_project

Detect the local project profile (framework, language, styling system, component file extensions, svg handling) by reading manifests and config — the foundation scan_components / component_map switch on. Optional standalone probe: those tools run detection internally and return the same profile, so call this only to inspect detection in isolation (no Figma, no file scan). Runs on the server filesystem. rootDir defaults to the server cwd. Detects Tailwind v3 (config file) and v4 (CSS-first @import/@theme) and reports tailwindVersion, and UnoCSS (uno.config.* / a @unocss package) as styling.sy…

ParameterTypeDescription
rootDirstringProject root to analyze; defaults to the server cwd

scan_components

Scan the local project for existing UI components so they can be reused instead of regenerated. Runs on the server filesystem, not in Figma. Identifies components by AST signature (exported, PascalCase, function-ish) rather than by folder layout, so any structure works. React (.tsx/.jsx) is parsed for name + props; Vue/Svelte derive the name from the file and parse props from the <script> block (defineProps / export let / $props). extensions defaults to the detected profile's; rootDir defaults to the server cwd. Returns { components, profile }.

ParameterTypeDescription
extensionsarrayComponent file extensions to scan; defaults to the detected profile
rootDirstringProject root to scan; defaults to the server cwd

component_map

Map the Figma component instances in a selection/subtree to existing local code components, so they can be reused instead of regenerated. Joins the grounded Figma component names (and their variant axes) against an AST scan of the project; an explicit docs/figma-component-map.md row (FigmaName | code/path) overrides the fuzzy match — this file is the durable record a verified mapping is written back to, so the next run reuses it instead of re-guessing. A row whose target no longer resolves (deleted/renamed) is reported in staleOverrides and degrades to the fuzzy result rather than a phantom…

ParameterTypeDescription
nodeIdstringRoot node id; omit to use the selection or current page
rootDirstringProject root to scan; defaults to the server cwd
thresholdnumberConfidence at/above which a match counts as a reliable reuse (default 0.7)

token_map

Map the document's Figma variables — and its shared paint styles (single solid color styles, the design-token mechanism of pre-variables files; such rows carry source: 'style') — to the project's design tokens, so generated code references existing tokens instead of hard-coded values. Joins the grounded Figma names + values against the project's design tokens — parsed from its CSS (Tailwind v4 @theme or :root custom properties), on a Tailwind v3 or UnoCSS project from the theme scales in its JS/TS config (whose tokens have no var() form: reference them by candidate.ref, the utility base)…

ParameterTypeDescription
rootDirstringProject root; defaults to the server cwd
thresholdnumberConfidence at/above which a match counts as reliable (default 0.7)
tokenSourcestringPath (relative to rootDir) to the file holding the tokens — a CSS file, a .scss file, or a Tailwind / UnoCSS config (.js/.cjs/.mjs/.ts), read according to its name; overrides detection

icon_map

Map the Figma icon nodes in a selection/subtree to the project's existing `.svg` files, so codegen reuses the designer-curated asset instead of re-exporting a duplicate. Joins the grounded Figma icon names against the repo svg files (gitignore-aware scan), name-based and near-exact (a wrong icon is a silent visual bug, so unsure matches fall through to a fresh export rather than mis-reuse). Each match reports the file path, the color contract read from the file (currentColor / fixed / multi-color), and how to recolor it in this project (currentColor → text-{token}, gated on the svg mode sinc…

ParameterTypeDescription
nodeIdstringRoot node id; omit to use the selection or current page
rootDirstringProject root to scan; defaults to the server cwd
thresholdnumberConfidence at/above which a match counts as a reliable reuse (default 0.7)

design_diff

Diff a Figma node against a saved baseline of itself, so after a design changes you edit only the affected code instead of regenerating. First call on a node saves a baseline (its get_design_context, full detail) under .figwright/snapshots/ and returns status 'baseline-created'; a later call returns status 'diff' with the per-node, per-property changes (added / removed / changed nodes; fills, layout/padding, text, token bindings — resolved to readable values, not opaque ids) or 'no-changes'. Pass update:true to accept the current design as the new baseline (re-snapshot). nodeId defaults to t…

ParameterTypeDescription
nodeIdstringNode to snapshot / diff (a pasted Figma URL also works); omit to use the selection
rootDirstringProject root; defaults to the server cwd
updatebooleanAfter diffing, overwrite the baseline with the current design (accept the changes)

set_fills

Set a node's fills. SOLID: { type:'SOLID', color:{r,g,b} } (0–1). Gradient: { type:'GRADIENT_LINEAR'|…, gradientStops:[{position,color:{r,g,b,a}}], gradientTransform } (round-trips get_node output). A SOLID paint may carry boundVariables ({ color: variableId }) and a gradient stop its own — the paint then tracks that variable instead of the literal. Channels are in the document's colour space; a colour taken from code adds space: 'SRGB' so a Display P3 file shows it as the code does. PATTERN tiles another layer across the fill: { type:'PATTERN', sourceNodeId, tileType, scalingFactor, spa…

ParameterTypeDescription
fills *arrayPaints to apply
nodeId *stringFigma node id to repaint

set_text

Replace the entire text content of a TEXT node, of text on a path (TEXT_PATH), or of a FigJam STICKY, SHAPE_WITH_TEXT, TABLE_CELL or CONNECTOR — whose words live in a sublayer no tool can address, so pass the container's own id; the plugin loads the node's current fonts first. Styled runs the old and new text share whole at the start or end keep their styling, so a typo fix leaves a bold word or a link alone; the rewritten span takes the style of the text it replaces. For formatting (font, size, color, spacing) use set_text_properties, and to substitute text across many nodes use find_replac…

ParameterTypeDescription
characters *stringNew text content
nodeId *stringTEXT / TEXT_PATH node id, or a FigJam STICKY / SHAPE_WITH_TEXT / TABLE_CELL / CONNECTOR id

set_text_properties

Set a TEXT node's (or text on a path's) typography and layout/overflow properties. Typography: fontName ({ family, style?, variationSettings? } — variationSettings carries a variable font's axis values, e.g. { wght: 650 }), fontSize, lineHeight, letterSpacing, textCase, textDecoration, paragraphSpacing / paragraphIndent (px between / indenting the paragraphs the text splits into at "\n" — the write half of the same fields get_design_context reads), textWrapStyle (BALANCE evens the line lengths of a heading, PRETTY avoids an orphan last word — the same three values as CSS text-wrap) — t…

ParameterTypeDescription
nodeId *stringTEXT node id
fontNameobjectFont: { family, style?, variationSettings? }
fontSizenumberFont size in px
heightnumberText box height in px; fixes the box (textAutoResize NONE)
letterSpacingobjectLetter spacing: { unit: "PIXELS" | "PERCENT", value }
lineHeightLine height: { unit: "AUTO" } or { unit: "PIXELS" | "PERCENT", value }
maxLinesnumber | nullMax lines before truncation; null = unlimited
paragraphIndentnumberFirst-line indent of each paragraph in px
paragraphSpacingnumberSpace between paragraphs in px (paragraphs split at "\n")
textAlignHorizontalstringHorizontal alignment of the lines within the text box (CSS text-align)
textAlignVerticalstringVertical alignment of the text within a box taller than its content
textAutoResizestringHow the text box resizes to its content
textCasestring
textDecorationstring
textTruncationstringENDING truncates with an ellipsis
textWrapStylestringHow each paragraph balances its line breaks; maps 1:1 to CSS text-wrap
widthnumberText box width in px; the text wraps at it (auto-width text becomes auto height)

set_text_range

Style character ranges of an existing TEXT node — the write-side mirror of a read segment, for inline rich text (a link inside a sentence, a bold word, a coloured span, a bulleted list, a smaller /mo after a price). Each range gives start/end (char offsets into the node's characters) plus any subset of run properties: fontName / fontSize / fills / textDecoration / textCase / lineHeight / letterSpacing / hyperlink / listOptions / indentation / textWrapStyle, and design-system bindings textStyleId / fillStyleId / boundVariables. Ranges apply in order (a later range overrides an earlier one on…

ParameterTypeDescription
nodeId *stringTEXT node id whose ranges to style
ranges *arrayCharacter ranges + the run properties to apply to each

create_frame

Create a frame — the primary container for UI and the only node that hosts auto-layout — optionally sized/positioned and appended to a parent (default: current page). Pass fills, strokes, cornerRadius, autoLayout and layoutSizing* to style and lay it out in this same call (each means what it does on its set_* tool) instead of a chain of follow-ups. With autoLayout, a width or height you pass stays FIXED on its axis unless the layoutSizing* of that axis says otherwise (Figma would otherwise hug it) — a width alone fixes the width and lets the height hug; omit a side, or pass HUG, to hug t…

set_opacity

Set a node's layer opacity from 0 (transparent) to 1 (opaque); this multiplies with any fill or stroke alpha. Opacity 0 still renders, exports, and hit-tests — to exclude a node from rendering use set_visible(false), and to remove it use delete_nodes. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringFigma node id
opacity *numberOpacity 0–1

set_visible

Show or hide a node by toggling its `visible` flag. A hidden node stays in the layer tree but is excluded from rendering and exports, and its descendants are hidden with it; the change is fully reversible. To remove a node use delete_nodes; to dim one while keeping it visible and exported use set_opacity. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringFigma node id
visible *booleantrue to show, false to hide

rename_node

Rename a single canvas node's layer name; does not affect a component's name elsewhere or its instances. To rename a document page use rename_page; to rename many nodes by pattern use batch_rename_nodes; a prototype flow's name is not its frame's name, so rename a flow with update_flows. Returns { ok, nodeId }.

ParameterTypeDescription
name *stringNew layer name
nodeId *stringFigma node id

delete_nodes

Permanently delete nodes by id; missing or non-removable nodes are skipped. To hide nodes reversibly instead of deleting them, use set_visible(false). Returns { ok, affected } — the ids actually removed.

ParameterTypeDescription
nodeIds *arrayNode ids to delete

create_text

Create a new TEXT node with the given characters (default font loaded automatically), optionally sized/positioned and appended to a parent (default: current page). To change the text of an existing node use set_text. Typography (fontName, fontSize, lineHeight, textAlignHorizontal, …) takes the same fields as set_text_properties, and fills the text colour (as set_fills), all in this call — set the real font here, a new node is Inter. A new text is auto width: pass width to wrap it at a set width with its height following the text (a paragraph, a line centred across a column), and width + he…

ParameterTypeDescription
characters *stringText content
fillsarrayFills to apply on creation (as set_fills)
fontNameobjectFont: { family, style?, variationSettings? }
fontSizenumberFont size in px
heightnumberText box height in px; fixes the box (textAutoResize NONE)
layoutSizingHorizontalstringHorizontal sizing (as set_layout_props); FILL needs an auto-layout parent
layoutSizingVerticalstringVertical sizing (as set_layout_props); FILL needs an auto-layout parent
letterSpacingobjectLetter spacing: { unit: "PIXELS" | "PERCENT", value }
lineHeightLine height: { unit: "AUTO" } or { unit: "PIXELS" | "PERCENT", value }
maxLinesnumber | nullMax lines before truncation; null = unlimited
paragraphIndentnumberFirst-line indent of each paragraph in px
paragraphSpacingnumberSpace between paragraphs in px (paragraphs split at "\n")
parentIdstringContainer node id; omit for current page
textAlignHorizontalstringHorizontal alignment of the lines within the text box (CSS text-align)
textAlignVerticalstringVertical alignment of the text within a box taller than its content
textAutoResizestringHow the text box resizes to its content
textCasestring
textDecorationstring
textTruncationstringENDING truncates with an ellipsis
textWrapStylestringHow each paragraph balances its line breaks; maps 1:1 to CSS text-wrap
widthnumberText box width in px; the text wraps at it (auto-width text becomes auto height)
xnumberX position in the parent
ynumberY position in the parent

create_rectangle

Create a rectangle, optionally sized/positioned and appended to a parent (default: current page). Useful for solid shapes, dividers, and color blocks; for a container that holds other layers use create_frame; for a bitmap, import_image places one, or set_image_fill puts it into this rectangle (a rounded thumbnail, an avatar). fills, strokes, cornerRadius and layoutSizing* style it in the same call. Returns { ok, nodeId, name, type }.

set_corner_radius

Set a node's corner radius and/or corner smoothing. Pass radius for a uniform radius, and/or per-corner topLeftRadius / topRightRadius / bottomRightRadius / bottomLeftRadius (for nodes that support individual corners, e.g. a card rounded only on top, a tab or a chat bubble). A per-corner value overrides radius for that corner. cornerSmoothing is 0–1 (0 = circular, 0.6 = squircle); it can be set without changing any radius. At least one radius or cornerSmoothing is required. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringFigma node id
bottomLeftRadiusnumberBottom-left corner radius in px
bottomRightRadiusnumberBottom-right corner radius in px
cornerSmoothingnumberCorner smoothing, 0–1
radiusnumberUniform corner radius in px
topLeftRadiusnumberTop-left corner radius in px
topRightRadiusnumberTop-right corner radius in px

set_strokes

Set a node's strokes (SOLID, gradient or PATTERN paints, same shape as set_fills) plus optional strokeWeight, strokeAlign (INSIDE / OUTSIDE / CENTER), dashPattern (dashes), and per-side weights (strokeTopWeight / strokeRightWeight / strokeBottomWeight / strokeLeftWeight — for nodes that support individual stroke weights, e.g. a border-bottom-only divider). A per-side weight overrides strokeWeight for that side. strokeCap shapes the ends of an open path or line — ROUND for a pen line, an ARROW / TRIANGLE / DIAMOND / CIRCLE cap for an arrowhead or a connector end — on every open end, so an…

ParameterTypeDescription
nodeId *stringFigma node id
strokes *arrayStroke paints
dashPatternarrayDash/gap lengths in px, e.g. [4, 2]; [] for a solid stroke
strokeAlignstringStroke position relative to the geometry
strokeBottomWeightnumberBottom side weight in px
strokeCapstringThe ends of an open path or line: a line cap, or an arrowhead
strokeJoinstringHow corners are drawn
strokeLeftWeightnumberLeft side weight in px
strokeMiterLimitnumberHow long a MITER corner may get, as a multiple of the stroke weight, before it is bevelled
strokeRightWeightnumberRight side weight in px
strokeTopWeightnumberTop side weight in px
strokeWeightnumberUniform stroke thickness in px

move_nodes

Translate nodes by (dx, dy). Nodes without a position are skipped. Returns { ok, affected }.

ParameterTypeDescription
nodeIds *arrayNode ids to move
dxnumberHorizontal delta (default 0)
dynumberVertical delta (default 0)

align_nodes

Align nodes to their parent's bounds or to each other, and/or space them evenly — Figma's align / distribute toolbar. horizontal: MIN = left edge, CENTER, MAX = right edge; vertical: MIN = top, CENTER, MAX = bottom; either may be omitted to leave that axis alone. relativeTo PARENT (default) aligns each node within its own parent frame — the way to "centre this in its container" without computing x/y; SELECTION aligns the nodes to the bounding box they form together (line up a row on a shared top, or on a shared centre). distribute HORIZONTAL / VERTICAL keeps the outermost two nodes where t…

ParameterTypeDescription
nodeIds *arrayNodes to align / distribute
distributestringEqualise the gaps between nodes along this axis; needs 3+ nodes
horizontalstringHorizontal alignment: MIN (left), CENTER or MAX (right)
relativeTostringPARENT (default): each node within its own parent's bounds. SELECTION: to the bounding box of all the given nodes
verticalstringVertical alignment: MIN (top), CENTER or MAX (bottom)

create_shape

Create a LINE, POLYGON or STAR, optionally sized/positioned and appended to a parent (default: current page). A LINE is a length: `width` is its length (default 100, with the black 1px stroke Figma gives it) and it has no height — pass strokes / strokeWeight here to style it (caps via set_strokes) and tilt it with rotate_nodes. A POLYGON takes `pointCount` (sides, 3–60, default 3) and a STAR takes `pointCount` (points, 3–60, default 5) and `innerRadius` (the inner ring as a share of the outer, above 0 and up to 1 — 1 is a regular polygon of twice the points; default 0.38). For rectangl…

boolean_nodes

Combine shapes into one editable boolean group: UNION merges them, SUBTRACT cuts the upper layers out of the lowest one (a ring from a circle and a smaller circle; the order is the layer stacking, not the order of nodeIds), INTERSECT keeps only the overlap, EXCLUDE keeps everything except the overlap. Like Figma’s own Boolean command, the result takes the fill and effects (or the fill / effect style) of the topmost operand — of the lowest for SUBTRACT — and no stroke; set_strokes on the result if it needs one. The operands stay inside the result as its children, so it can still be unpick…

ParameterTypeDescription
nodeIds *arrayShapes to combine (2 or more, one parent)
operation *string
namestringName for the resulting layer

flatten_nodes

Flatten nodes into a single vector layer (Figma’s Flatten): shapes, text and boolean groups are outlined and merged into one path whose points can be edited. Irreversible for the content — text stops being text and a boolean group stops being unpickable — so use it when the artwork is final, e.g. to export an icon as a single path. The nodes must share a parent, and the result takes their place there. Not allowed inside a batch. Returns { ok, nodeId, name, type }.

ParameterTypeDescription
nodeIds *arrayNodes to flatten (one parent)
namestringName for the resulting vector

repeat_nodes

Wrap layers in a repeat group (Figma Draw), which draws their content several times and stays live — edit the content and every copy follows: a row or grid of dots, the ticks round a dial, petals round a centre, a dashed border made of shapes. LINEAR draws count copies in total, each offset further along axis. RADIAL turns each copy a further 360°/count clockwise about a point straight below the content, so the content’s centre travels a circle offset px across — offset is that circle’s diameter. A second modifier repeats everything the first one drew: two LINEAR ones on different axe…

ParameterTypeDescription
modifiers *array1 or 2 modifiers; the second repeats everything the first drew
nodeIds *arrayLayers to repeat (one parent)
namestringName for the repeat group

set_repeat

Replace how a repeat group (TRANSFORM_GROUP — from repeat_nodes, or drawn in Figma Draw) repeats its content. LINEAR draws count copies in total, each offset further along axis. RADIAL turns each copy a further 360°/count clockwise about a point straight below the content, so the content’s centre travels a circle offset px across — offset is that circle’s diameter. A second modifier repeats everything the first one drew: two LINEAR ones on different axes make a grid. get_node reads the current modifiers in this same shape. [] keeps the group and draws the content once. A repeat group…

ParameterTypeDescription
modifiers *array0–2 modifiers; the second repeats everything the first drew
nodeId *stringThe repeat group (TRANSFORM_GROUP)

create_text_path

Set text along a path (Figma Draw): turn a shape, line or vector into text that follows its outline — lettering round a badge or seal, a caption along a curve. The source is consumed (its fill and stroke go; the text is black unless fills says otherwise) and the result takes its place: same parent, stack position and spot on the canvas, under a NEW node id, returned. The path starts where its first segment does and runs clockwise: a rectangle at its top-left corner (4 segments, 8 when its corners are rounded), an ellipse at its rightmost point (4), a polygon or star at its top point (one per…

ParameterTypeDescription
characters *stringThe text
nodeId *stringThe shape, line or vector to set the text along
fillsarrayText fills (as set_fills)
fontNameobjectFont: { family, style?, variationSettings? }
fontSizenumberFont size in px (default 12)
namestringLayer name (default: the text)
startPositionnumberHow far along that segment it starts, 0–1 (default 0)
startSegmentintegerIndex of the path segment the text starts on (default 0)
textAlignHorizontalstringWhere the text sits relative to its start (JUSTIFIED spreads it over the path)
textAlignVerticalstringWhich side of the path the letters sit on

set_text_path

Move where text on a path (TEXT_PATH) starts: a segment of its path and 0–1 along it — the same textPathStartData get_node reports. The segments are numbered as create_text_path describes; an index past the last is refused (Figma would silently ignore it). Edit the text itself with set_text / set_text_properties / set_text_range. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringThe text on a path
startPositionnumberHow far along that segment, 0–1
startSegmentintegerPath segment the text starts on

set_transform_3d

Turn a node in 3D (beta in Figma's API) — rotate it about X / Y / Z, push it toward or away from the viewer — and give a frame, component or instance the 3D scene its children share. transform3d: { translateZ px, rotateX / rotateY / rotateZ degrees, backfaceVisible, visible } applied as CSS translateZ → rotateX → rotateY → rotateZ about transformOrigin, in the node's own (already turned) axes; { type:'NONE' } removes it, and with it the node's 3D keyframe tracks. transformOrigin: { x, y } each { unit: PERCENT | PIXELS, value } — the point it turns about (default the centre); it dra…

ParameterTypeDescription
nodeId *stringNode to turn, or frame / component / instance to hold the scene
scene3dThe scene, or null to clear it
transform3dobject
transformOriginobject

set_complex_stroke

Give a node's stroke a Figma Draw look — a brush, a hand-drawn wobble or a width that varies along it — on any node with a stroke (paths, shapes, frames, text). complexStrokeProperties: { type:'BRUSH', brushType:'STRETCH', brushName, direction } drags one textured stroke along the path; { type:'BRUSH', brushType:'SCATTER', brushName, gap, wiggle, sizeJitter, angularJitter, rotation } stamps the brush along it; { type:'DYNAMIC', frequency, wiggle, smoothen } wobbles it; { type:'BASIC' } goes back to a plain stroke. Fields left out take the brush's own defaults. variableWidthStrokeProperties…

ParameterTypeDescription
nodeId *stringNode whose stroke to restyle
complexStrokePropertiesobject
variableWidthStrokePropertiesobject

create_vector

Draw a vector — one editable VECTOR layer, no wrapper frame — from its geometry: vectorPaths (SVG path data in any syntax — an icon’s d attribute as is, arcs and relative commands included) or vectorNetwork (Figma’s own form, which can branch and carries per-vertex arrowheads and corner radii). Give exactly one. x / y place the drawing’s origin in the parent, so a point at (10, 4) lands at (x + 10, y + 4); Figma then fits the layer’s box to the drawing, which is where get_vector measures from afterwards. An open path needs strokes to be seen (pass strokes / strokeWeight here); a…

set_vector

Redraw an existing VECTOR’s geometry: vectorPaths (SVG path data) or vectorNetwork (vertices, segments with Bézier tangents, regions) — exactly one, in the shape get_vector reads, so read, edit the points, write back (paths in any SVG syntax; what reads back is Figma’s own form — absolute commands, its own subpath order). Coordinates are in the layer’s current space: the drawing stays where they put it and Figma refits the layer’s box around it, so drawing left of 0 moves the layer left (and an auto-layout parent re-flows to the new size). Fills, strokes, effects, a brush or dynam…

ParameterTypeDescription
nodeId *stringThe VECTOR to redraw
vectorNetworkobjectVertices joined by segments — unlike SVG paths, a vertex may join three or more segments (a branching drawing). Each segment may curve through Bézier tangents.
vectorPathsarrayPath data with its winding rule; one entry may hold several subpaths (each M starts one)

outline_stroke

Outline a node’s stroke — Figma’s Outline Stroke: a new VECTOR (a GROUP of glyph outlines for text) whose filled shape is exactly what the stroke draws — a brush, a hand-drawn wobble, a taper and dashes included — so it can be recoloured, combined with boolean_nodes, edited point by point (get_vector / set_vector) or exported as plain vector art. It is filled with the stroke’s paints and keeps the node’s opacity, blend mode and effects; the node’s own fills are not part of it. It lands directly above the node, at the same spot — above the instance, boolean or repeat group hol…

ParameterTypeDescription
nodeId *stringA node with a visible stroke
namestringName for the outline

set_position

Set a node's exact position (x / y), relative to its parent — for a top-level node these are canvas coordinates; for an absolutely-positioned child they are relative to its auto-layout parent. Use this to place an overlay / badge / pinned element at a known spot, or to position a top-level frame on the canvas; to nudge by a delta instead use move_nodes. A node that sits in-flow inside an auto-layout frame is positioned by the layout — set layoutPositioning ABSOLUTE (set_layout_props) first to place it freely. Either coordinate may be omitted to leave it unchanged. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringNode id to position
xnumberX position relative to the parent
ynumberY position relative to the parent

resize_nodes

Resize nodes to the given width × height (width at least 0.01 px). A LINE takes the width as its length and keeps height 0 — pass 0, or any height is reported in adjusted; every other node needs a height of at least 0.01 px, checked before any node is resized. This fixes the size, so an auto-layout FILL / HUG axis becomes FIXED and a TEXT node a fixed box its wrapped lines can overflow, which shows no maxLines line clamp — to wrap text at a width use set_text_properties width instead, which lets its height follow. Non-resizable nodes are skipped. A layer inside an instance keeps the size…

ParameterTypeDescription
height *numberAt least 0.01 px; a LINE keeps height 0 whatever is passed (0 is exact for a line)
nodeIds *arrayNode ids to resize
width *number

set_auto_layout

Configure a frame's auto layout. layoutMode NONE disables it; HORIZONTAL/VERTICAL enable flex (padding / itemSpacing / alignment / wrap, plus counterAxisSpacing / counterAxisAlignContent for the wrapped cross axis — the CSS row-gap (column-gap when VERTICAL) / align-content — and itemReverseZIndex / strokesIncludedInLayout for paint order and stroke-in-layout); GRID enables CSS-Grid-style layout (padding / gridRowCount / gridColumnCount / gridRowGap / gridColumnGap, plus gridItemsPositioning / gridAutoTracks for children that flow into cells by order and rows that grow with them). Setting…

ParameterTypeDescription
layoutMode *string
nodeId *string
counterAxisAlignContentstringHow wrapped tracks distribute along the cross axis: AUTO packs them at counterAxisSpacing, SPACE_BETWEEN spreads them (align-content). Requires layoutWrap WRAP
counterAxisAlignItemsstring
counterAxisSpacingnumberCross-axis gap between wrapped tracks (px): rows of a HORIZONTAL wrap (CSS row-gap), columns of a VERTICAL one (CSS column-gap). Requires layoutWrap WRAP (settable in the same call); ignored under cou…
gridAutoTracksstringNONE (the default) keeps gridRowCount; ROWS adds and removes rows as children come and go (CSS grid-auto-rows), and Figma then owns the row count, so gridRowCount is refused unless this call sets NONE…
gridColumnCountinteger
gridColumnGapnumber
gridItemsPositioningstringHow children take cells: MANUAL (the default) pins each child to its own cell; ROW_AUTO_FLOW places them by layer order, left to right then top to bottom (CSS grid-auto-flow: row) — a list rendered…
gridRowCountinteger
gridRowGapnumber
itemReverseZIndexbooleanPaint later siblings UNDER earlier ones (reversed canvas order) — the stacked-avatars / overlapping-cards pattern, usually with negative itemSpacing. HORIZONTAL/VERTICAL only
itemSpacingnumber
layoutWrapstring
paddingBottomnumber
paddingLeftnumber
paddingRightnumber
paddingTopnumber
primaryAxisAlignItemsstringMain-axis distribution (CSS justify-content). MIN / CENTER / MAX pack the children; the SPACE_* values spread them — SPACE_BETWEEN puts the extra space only between children (first and last flush wi…
strokesIncludedInLayoutbooleanMake strokes take up layout space (gaps/padding grow by the stroke weight); Figma defaults to excluding them. HORIZONTAL/VERTICAL only

set_layout_props

Set a node's sizing, child properties and content clipping. clipsContent controls whether a frame-like container clips its children; it also works without auto-layout. layoutSizingHorizontal / layoutSizingVertical (HUG = shrink to fit children, FILL = stretch to fill the auto-layout parent, FIXED = keep the current size) are the preferred way to size a frame to its content (HUG) or make a child fill its container (FILL) — reach for these instead of guessing pixel sizes with resize_nodes. layoutAlign (STRETCH = fill the counter axis, INHERIT = default) and layoutGrow (1 = fill the primary axi…

ParameterTypeDescription
nodeId *stringNode id — a frame-like container, or an auto-layout child
clipsContentbooleanClip children to the container bounds
layoutAlignstringSTRETCH fills the counter axis; INHERIT follows the parent
layoutGrownumber1 = grow to fill the primary axis, 0 = hug content
layoutPositioningstringABSOLUTE takes the node out of the auto-layout flow
layoutSizingHorizontalstringHorizontal sizing: HUG fits content, FILL fills the parent, FIXED keeps width
layoutSizingVerticalstringVertical sizing: HUG fits content, FILL fills the parent, FIXED keeps height
maxHeightMaximum height in px (null clears the bound)
maxWidthMaximum width in px (null clears the bound)
minHeightMinimum height in px (null clears the bound)
minWidthMinimum width in px (null clears the bound)

set_layout_grids

Set a frame's own layout grids — the responsive column/row scaffold laid over it (the 12-column grid, the 8pt baseline), distinct from auto-layout (set_auto_layout arranges children). Each grid is COLUMNS / ROWS (count + gutterSize + alignment, e.g. a 12-col grid) or GRID (uniform squares via sectionSize, a baseline). Replaces the frame's grids with the array given; pass [] to clear them — a grid's color (its overlay in the editor) included: send the color get_node reports to keep it, or leave it out for Figma's default red. Only frames (and components/instances) carry layout grids. Return…

ParameterTypeDescription
grids *arrayLayout grids to set; [] clears all grids on the frame
nodeId *stringFrame (or component/instance) node id

set_blend_mode

Set how a node composites with the layers beneath it (NORMAL, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, etc.). PASS_THROUGH is only meaningful on groups/frames (lets children blend with content outside the group). Affects compositing only, not the node's own fills — use set_fills or set_opacity for those. Returns { ok, nodeId }.

ParameterTypeDescription
blendMode *stringFigma blend mode literal, e.g. "MULTIPLY"
nodeId *stringNode to set the blend mode on

set_mask

Set whether a node is a mask — a mask clips its later siblings to its own shape. Pass isMask true/false, and optionally maskType (ALPHA / LUMINANCE / GEOMETRY) when enabling. Returns { ok, nodeId }.

ParameterTypeDescription
isMask *booleanWhether the node masks its later siblings
nodeId *stringFigma node id
maskTypestringHow the mask clips (only applied when enabling)

set_arc

Turn an ellipse into a pie slice / gauge or a ring / donut by setting its arc data. startingAngle / endingAngle are in radians and carve out the visible wedge (a full circle is 0 → 2π ≈ 6.28319; a half is π ≈ 3.14159); innerRadius is 0–1 of the radius (0 = a solid disc, > 0 = a ring with a hole, e.g. 0.6 for a donut or progress ring). Only ellipses have arc data. Pass any subset — omitted fields keep their current value. At least one is required. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringFigma node id (must be an ellipse)
endingAnglenumberArc end angle in radians
innerRadiusnumberInner radius 0–1 of the outer radius (0 = solid disc, > 0 = ring / donut)
startingAnglenumberArc start angle in radians

set_constraints

Set how a node responds when its parent frame is resized, via horizontal and vertical constraints: MIN pins to the left/top, MAX to the right/bottom, CENTER keeps it centered, STRETCH pins both edges (grows with the parent), and SCALE resizes proportionally. Constraints apply to children of a plain frame and to ABSOLUTE children of an auto-layout frame; an in-flow auto-layout child is positioned by the layout and ignores them. Returns { ok, nodeId }.

ParameterTypeDescription
horizontal *stringHorizontal behavior when the parent resizes
nodeId *stringNode to constrain
vertical *stringVertical behavior when the parent resizes

rotate_nodes

Set absolute rotation (degrees) on nodes. Nodes without rotation are skipped. Returns { ok, affected }.

ParameterTypeDescription
nodeIds *arrayNode ids to rotate
rotation *numberRotation in degrees

flip_nodes

Mirror nodes in place — Figma’s Flip horizontal / Flip vertical: HORIZONTAL swaps left and right on the canvas, VERTICAL top and bottom, each node about its own centre, so it stays where it was. A flipped node reads back flipped: true with its cssTransform. Flipping twice restores it. Returns { ok, affected }.

ParameterTypeDescription
axis *stringWhich way to mirror
nodeIds *arrayNode ids to flip

lock_nodes

Lock nodes so they can't be selected or edited on the canvas (e.g. backgrounds); locking a parent also locks its descendants. Locked nodes still render and export — this only affects canvas interaction and is reversed by unlock_nodes. Returns { ok, affected } with the ids actually locked.

ParameterTypeDescription
nodeIds *arrayNode ids to lock

unlock_nodes

Unlock nodes so they can be selected and edited on the canvas again — the inverse of lock_nodes. Ids that no longer exist are skipped. Returns { ok, affected } with the ids actually unlocked.

ParameterTypeDescription
nodeIds *arrayNode ids to unlock

clone_node

Duplicate a node — including its full subtree — and place the copy as a sibling right after the original under the same parent. Cloning a component instance keeps it an instance; to make a fresh instance of a component use create_instance instead. Cloning a prototype flow's starting frame also clones the flow, under the same name, right after the original (rename or remove it with update_flows). Returns { ok, nodeId, name, type } for the copy.

ParameterTypeDescription
nodeId *stringNode id to clone

set_effects

Set a node's effects. Shadows (DROP_SHADOW / INNER_SHADOW) need color + offset; blurs need radius. A drop shadow is written with showShadowBehindNode false unless it says true — what a CSS box-shadow draws. Returns { ok, nodeId }.

ParameterTypeDescription
effects *arrayEffects to apply
nodeId *stringFigma node id to apply effects to

create_paint_style

Create a reusable local paint (color) style from SOLID or gradient paints (same shape as set_fills); use slashes in the name for folder grouping. Apply it to nodes with apply_style_to_node, or edit it later with update_paint_style. Optionally with a documentation link. Returns { ok, styleId, name, adjusted? } — adjusted says when the link was stored differently from what was sent.

ParameterTypeDescription
name *stringStyle name, e.g. "Brand/Primary"
paints *arrayPaints
descriptionstringOptional style description
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it

create_text_style

Create a reusable local text style (a typography token) that can be applied to TEXT nodes with apply_style_to_node. The font is loaded before assignment. lineHeight unit is AUTO / PIXELS / PERCENT (AUTO omits value); letterSpacing unit is PIXELS / PERCENT; textWrapStyle is the wrap balancing (CSS text-wrap) every bound node inherits. For one-off formatting of a single node use set_text_properties instead. Optionally with a documentation link. Returns { ok, styleId, name, adjusted? } — adjusted says when the link was stored differently from what was sent.

ParameterTypeDescription
name *stringStyle name, e.g. "Heading/H1"
boundVariablesobjectTypography bindings as { field: variableId }: fontSize / lineHeight / letterSpacing / paragraphSpacing / paragraphIndent take a FLOAT variable, fontFamily / fontStyle a STRING one, fontWeight a FLOAT.…
descriptionstring
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it
fontNameobjectFont: { family, style?, variationSettings? }
fontSizenumber
letterSpacingobject
lineHeightobject
textWrapStylestringLine-break balancing every node bound to this style inherits; maps 1:1 to CSS text-wrap

create_effect_style

Create a local effect style. Shadows (DROP_SHADOW / INNER_SHADOW) need color + offset; blurs (LAYER_BLUR / BACKGROUND_BLUR) need radius. Optionally with a documentation link. Returns { ok, styleId, name, adjusted? } — adjusted says when the link was stored differently from what was sent.

ParameterTypeDescription
effects *array
name *stringStyle name, e.g. "Elevation/Card"
descriptionstring
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it

create_grid_style

Create a reusable local layout-grid style for aligning content. Each grid pattern is GRID (uniform squares via sectionSize) or ROWS / COLUMNS (count + gutterSize + alignment). Apply it to frames with apply_style_to_node, or edit it later with update_grid_style. Optionally with a documentation link. Returns { ok, styleId, name, adjusted? } — adjusted names a grid color Figma would refuse (left out, so the style is still created) or a documentation link stored differently from what was sent.

ParameterTypeDescription
grids *array
name *stringStyle name, e.g. "Layout/8pt"
descriptionstring
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it

update_paint_style

Update an existing paint style by id. Any of name / paints / description may be omitted to leave unchanged. Because paints replace wholesale, a paint written back WITHOUT its boundVariables clears the variable it was bound to — re-send the binding, or change the variable itself instead. documentationLinks may be given too ([] removes the link). A call that fails part-way leaves the style as it was. Returns { ok, styleId, name, adjusted? } — adjusted says when the link was stored differently from what was sent.

ParameterTypeDescription
styleId *stringPaint style id to update
descriptionstring
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it
namestring
paintsarrayNew paints (SOLID or gradient)

update_text_style

Update an existing text style (typography token) by id. Any of name / fontName / fontSize / lineHeight / letterSpacing / textWrapStyle / description may be omitted to leave unchanged. A new font is loaded before assignment. lineHeight unit is AUTO / PIXELS / PERCENT (AUTO omits value); letterSpacing unit is PIXELS / PERCENT. Use this to keep a shared style in sync with code instead of creating a duplicate. documentationLinks may be given too ([] removes the link). A call that fails part-way leaves the style as it was. Returns { ok, styleId, name, adjusted? } — adjusted says when the link was…

ParameterTypeDescription
styleId *stringText style id to update
boundVariablesobjectTypography bindings as { field: variableId }: fontSize / lineHeight / letterSpacing / paragraphSpacing / paragraphIndent take a FLOAT variable, fontFamily / fontStyle a STRING one, fontWeight a FLOAT.…
descriptionstring
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it
fontNameobjectFont: { family, style?, variationSettings? }
fontSizenumber
letterSpacingobject
lineHeightobject
namestring
textWrapStylestringLine-break balancing every node bound to this style inherits; maps 1:1 to CSS text-wrap

update_effect_style

Update an existing effect style by id. Any of name / effects / description may be omitted to leave unchanged; effects, when given, replaces the whole list. Shadows (DROP_SHADOW / INNER_SHADOW) need color + offset; blurs (LAYER_BLUR / BACKGROUND_BLUR) need radius. Use this to keep a shared style in sync with code instead of creating a duplicate. Because effects replace wholesale, an effect written back WITHOUT its boundVariables clears the variables it was bound to — re-send them, or change the variable itself instead. documentationLinks may be given too ([] removes the link). A call that fai…

ParameterTypeDescription
styleId *stringEffect style id to update
descriptionstring
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it
effectsarrayNew effects (replaces all)
namestring

update_grid_style

Update an existing layout-grid style by id, in place — frames using it follow, and its id stays, so they stay linked (deleting and recreating it would detach every one). Any of name / grids / description / documentationLinks may be omitted to leave unchanged; grids, when given, replaces the whole list — send each grid's color as get_styles reports it to keep it. A grid written back WITHOUT its boundVariables clears the variables it was bound to. A call that fails part-way leaves the style as it was. Returns { ok, styleId, name, adjusted? } — adjusted names a grid color Figma would refuse…

ParameterTypeDescription
styleId *stringGrid style id to update
descriptionstring
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it
gridsarrayNew grids (replaces all)
namestring

apply_style_to_node

Bind a shared style to a node. `field` selects which slot the style applies to: fill / stroke / effect / grid / text. Use a style id already available in this file (including get_node or get_design_context styleIds); for a library style, call import_style with its key in the target file and apply the returned styleId, not the key or a source-file id. Returns { ok, nodeId }.

ParameterTypeDescription
field *string
nodeId *stringNode to apply the style to
styleId *stringStyle id to bind

import_style

Import a published library paint, text, effect or grid style by its key into the current file. Returns { ok, styleId, name }; use the returned styleId with apply_style_to_node. A key is not a style id, and an id from the source library is not a target-file reference. Get the key from get_styles in the source file. Does not apply the style or edit any node. Unpublished or inaccessible styles are refused by Figma. Import before a batch; library imports cannot be rolled back.

ParameterTypeDescription
styleKey *stringPublished style key, not a style id

delete_style

Delete a local style (paint / text / effect / grid) by id. Returns { ok, styleId, name }.

ParameterTypeDescription
styleId *stringStyle id to delete

create_variable_collection

Create a variable collection. Figma auto-creates a default mode. A collection made here starts HIDDEN from publishing — unlike one made in the Figma UI — so its variables are left out of the library when the file is published; pass hiddenFromPublishing: false for a collection meant to be shared. Returns { ok, collectionId, defaultModeId, name, hiddenFromPublishing }.

ParameterTypeDescription
name *stringCollection name, e.g. "Theme"
hiddenFromPublishingbooleanfalse publishes the collection with the library; omit for Figma's default (hidden)

update_variable_collection

Rename a variable collection and/or its modes, or change whether it is published with the library. Any of name / modes / hiddenFromPublishing may be omitted to leave it unchanged. No id changes, so every binding and every mode value survives — this is how a mis-named collection gets fixed, because deleting and recreating one mints a new id and takes its variables and modes with it. Mode ids come from get_variable_defs. Every mode id is checked before anything is written, so one bad id leaves the collection untouched rather than half-renamed. Returns { ok, collectionId, name, modes, hiddenFro…

ParameterTypeDescription
collectionId *stringVariable collection id
hiddenFromPublishingbooleantrue leaves the collection out of the published library, false publishes it
modesarrayModes to rename; modes left out of the array keep their current names
namestringNew collection name, e.g. "Color"

add_variable_mode

Add a mode (e.g. "Dark") to a variable collection. Returns { ok, modeId, name }. Mode count is gated by the file's Figma plan (Starter allows 1 per collection) — when the plan blocks a new mode this fails with guidance: fall back to a paired collection (e.g. "Color/Dark") holding the same variable names with that theme's values.

ParameterTypeDescription
collectionId *stringVariable collection id
name *stringMode name, e.g. "Dark"

create_variable

Create a variable in a collection with resolvedType BOOLEAN / FLOAT / STRING / COLOR / EASING / TIMING. Set per-mode values with set_variable_value, then attach it with bind_variable_to_node or bind_variable_to_paint — or, for EASING (a Motion curve) and TIMING (seconds), as a { type: "VARIABLE_ALIAS", id } in a Motion easing or a preset's delay / duration. Optionally pass scopes to narrow where Figma offers the variable in its picker (a radius token scoped to CORNER_RADIUS stops being suggested for width or gap; [] offers it nowhere, the usual way to keep a primitive that semantic tokens al…

ParameterTypeDescription
collectionId *stringVariable collection id
name *stringVariable name, e.g. "color/primary"
resolvedType *stringVariable data type
descriptionstringThe variable's description, as plain text
hiddenFromPublishingbooleantrue leaves the variable out of the published library
scopesarrayWhere Figma offers this variable in its picker, e.g. ["CORNER_RADIUS"] or ["FRAME_FILL","SHAPE_FILL"]; [] for nowhere (not BOOLEAN). Omit for all scopes. Not available for EASING / TIMING.

set_variable_value

Set a variable's value for one mode (modeId comes from the variable's collection). value must match the variable resolvedType: a boolean, a number (FLOAT), a string, a color { r, g, b, a } (0–1, in the document's colour space unless `space` names another — pass "SRGB" for a colour taken from code), an alias { type: "VARIABLE_ALIAS", id } pointing at another variable, or a composed color { color, opacity } that pairs a color with a separate opacity — each half either a concrete value or an alias, with at least one of the two an alias. An EASING variable takes a Motion easing, a TIMING var…

ParameterTypeDescription
modeId *stringMode id (from the collection)
value *boolean | number | string | { r,g,b,a, space? } | { type:"VARIABLE_ALIAS", id } | { color, opacity } composed color | { type: easing }
variableId *stringVariable id

bind_variable_to_node

Bind a variable to a node field (e.g. width, height, characters, itemSpacing, topLeftRadius, or cornerRadius to bind all four corners at once), or unbind by passing variableId: null. The variable's resolvedType must match the field's type. To bind a fill or stroke color use bind_variable_to_paint instead; get local variable ids from get_variable_defs. For a library variable, call import_variable with its key in the target file and bind the returned variableId (not the key or a source-file id). Returns { ok, nodeId }.

ParameterTypeDescription
field *stringBindable field name, e.g. "width"
nodeId *stringNode to bind on
variableId *string | nullVariable id to bind, or null to remove the binding on this field

bind_variable_to_paint

Bind a COLOR variable to a SOLID fill or stroke paint (the design-token way to colour a node) — or unbind by passing variableId: null. Figma stores fill/stroke colour bindings on the paint, not the node, so this is separate from bind_variable_to_node (which covers scalar fields like width / padding / radius). target is fills (default) or strokes; index selects which paint (default 0). The paint at that index must be SOLID. Binding replaces the paint's opacity with the variable's alpha, so a 50% fill bound to an opaque variable ends up opaque; for a translucent token, bind a variable whose va…

ParameterTypeDescription
nodeId *stringNode whose fill/stroke paint to bind
variableId *string | nullCOLOR variable id to bind, or null to remove the binding
indexintegerIndex of the paint within the list (default 0)
targetstringWhich paint list to bind on (default fills)

import_variable

Import a published library variable by its key into the current file. Returns { ok, variableId, name }; use the returned variableId with bind_variable_to_node, bind_variable_to_paint or other variable bindings. A key is not a variable id, and an id from the source library is not a target-file reference. Get the key from get_variable_defs in the source file. Does not bind or edit any node. Unpublished or inaccessible variables are refused by Figma. Import before a batch; library imports cannot be rolled back.

ParameterTypeDescription
variableKey *stringPublished variable key, not a variable id

set_node_variable_mode

Switch a node to one of a variable collection's modes — the Dark (or another theme, brand or language) variant of a frame, a component, a layer inside an instance, or a whole page — so every variable bound in its subtree takes that mode's value. This changes which mode a node renders in; to add or remove modes on the collection itself use add_variable_mode / delete_variable_mode. collectionId and modeId come from get_variable_defs. modeId null clears the setting so the node inherits its parent's mode again. Returns { ok, nodeId, collectionId, collectionName, modeId, modeName }.

ParameterTypeDescription
collectionId *stringVariable collection id, from get_variable_defs
modeId *string | nullA mode id of that collection; null clears it so the node inherits its parent's
nodeId *stringNode to switch: any layer, or a page

rename_variable

Rename a variable (e.g. "color/primary" → "color/brand"); use slashes in the name for folder grouping in the Variables panel. The variable id is unchanged, so existing bindings keep working. update_variable also renames, and sets the description, scopes and publishing. Returns { ok, variableId, name }.

ParameterTypeDescription
name *stringNew variable name, e.g. "color/brand"
variableId *stringVariable id

update_variable

Update a variable in place — its name, description, scopes (where Figma's picker offers it) and whether it is published with the library. Its id, its values and every binding to it stay. Any field may be omitted to leave it unchanged. Scopes replace the whole list: a COLOR variable takes ALL_SCOPES / ALL_FILLS / FRAME_FILL / SHAPE_FILL / TEXT_FILL / STROKE_COLOR / EFFECT_COLOR; FLOAT takes ALL_SCOPES, TEXT_CONTENT, CORNER_RADIUS, WIDTH_HEIGHT, GAP, STROKE_FLOAT, EFFECT_FLOAT, OPACITY, COLOR_OPACITY and the FONT_ / LINE_HEIGHT / LETTER_SPACING / PARAGRAPH_ scopes; STRING takes ALL_SCOPES / TE…

ParameterTypeDescription
variableId *stringVariable id
descriptionstringThe description, as plain text; "" clears it
hiddenFromPublishingbooleantrue leaves the variable out of the published library
namestringNew name, e.g. "color/brand" (slashes group it into folders)
scopesarrayWhere Figma offers the variable, replacing the current list

set_annotations

Replace a node's Dev Mode annotations — the notes a designer leaves for whoever builds it (read them with get_annotations). The list REPLACES the existing one, so send the ones to keep too, exactly as get_annotations returns them, and [] removes them all. Each annotation has label (plain text) or labelMarkdown (keeps bold, links, lists) — a get_annotations entry carries both and writes back as is — and optionally categoryId (from get_annotations categories, or create_annotation_category) and properties: node fields pinned to the note, which Figma accepts only where the node has them set…

ParameterTypeDescription
annotations *arrayThe whole list, replacing the current one
nodeId *stringThe node to annotate

create_annotation_category

Add an annotation category to the file — what set_annotations files a note under (Figma starts every file with Development, Interaction, Accessibility and Content). Labels need not be unique, so check get_annotations categories first. Works in Dev Mode too. Returns { ok, categoryId, label, color, isPreset }.

ParameterTypeDescription
color *stringThe category's colour in Dev Mode
label *stringThe category name, e.g. "Analytics"

update_annotation_category

Rename or recolour an annotation category; either field may be omitted, and a field already holding its value is not written. Renaming or recolouring one of Figma's four presets (Development, Interaction, Accessibility, Content) makes it a custom category for good — isPreset goes false and nothing sets it back. Works in Dev Mode too. Returns { ok, categoryId, label, color, isPreset }.

ParameterTypeDescription
categoryId *stringThe category, by id (from get_annotations categories)
colorstringThe category's colour in Dev Mode
labelstringNew name

delete_annotation_category

Delete an annotation category. The annotations filed under it keep its id, which then names no category — re-file them with set_annotations first if they should keep one. Works in Dev Mode too. Returns { ok, categoryId, label }.

ParameterTypeDescription
categoryId *stringThe category, by id (from get_annotations categories)

add_measurement

Draw a Dev Mode measurement: a dimension line from one node edge to another (TOP / RIGHT / BOTTOM / LEFT), or across one node between two opposite sides — how a designer calls out a spacing or a size for whoever builds it. Both sides must be on one axis (LEFT/RIGHT or TOP/BOTTOM), and both nodes on one page: it goes on that page without switching the user to it. A group, section or page cannot be measured — measure its children. freeText is shown on the line, kept exactly as sent. Read them back with get_annotations { measurements: true }. Returns { ok, measurementId, pageId, start, end, o…

ParameterTypeDescription
endNodeId *stringThe node the line ends at (the same node to measure across it)
endSide *stringThe edge of the end node
startNodeId *stringThe node the line starts at
startSide *stringThe edge of the start node
freeTextstringText shown on the measurement
offsetWhere the line sits; omit for the middle ({ type: "INNER", relative: 0 })

update_measurement

Move a measurement's line (offset) or change its text (freeText; "" clears it); either may be omitted. Its ends cannot change — delete it and add another. Finds it on any page. Returns { ok, measurementId, pageId, start, end, offset, freeText? } — the measurement as Figma holds it; Figma keeps no distance on it, it draws it from the nodes.

ParameterTypeDescription
measurementId *stringThe measurement, by id (from get_annotations)
freeTextstringText shown on the measurement
offsetWhere the line sits; omit for the middle ({ type: "INNER", relative: 0 })

delete_measurement

Delete a measurement, on whichever page it is. Returns { ok, measurementId, pageId }.

ParameterTypeDescription
measurementId *stringThe measurement, by id (from get_annotations)

set_variable_code_syntax

Declare a variable's code-side token name per platform (codeSyntax) — the write half of the codeSyntax that get_design_context / get_variable_defs surface to codegen as the authoritative name (e.g. WEB: "--color-primary"). Per platform (WEB / ANDROID / iOS): a non-empty string sets the declaration, null removes it, an omitted platform is untouched. When authoring design-system variables from existing code tokens, declare the source token name here so future codegen resolves to the exact token instead of deriving a name. Returns { ok, variableId, name, codeSyntax } with the declarations now i…

ParameterTypeDescription
codeSyntax *objectPer-platform declarations: string sets, null removes, omitted is untouched
variableId *stringVariable id

delete_variable

Delete a single variable by id; any node or paint bound to it reverts to its raw value. To delete an entire collection and all its variables use delete_variable_collection. Returns { ok, variableId, name }.

ParameterTypeDescription
variableId *stringVariable id to delete

delete_variable_mode

Remove a mode from a variable collection, freeing the slot it holds — mode count is gated by the file's Figma plan (Starter allows 1 per collection), so a mode added by mistake otherwise occupies that budget for good. Every variable's value for this mode goes with it. Not reversible: adding a mode back mints a new mode id, and the values that hung on the old id do not come with it — which is also why this tool cannot be used inside batch. Removing the collection's default mode is allowed (Figma moves the default to a mode that remains); the last remaining mode cannot be removed. Mode ids c…

ParameterTypeDescription
collectionId *stringVariable collection id
modeId *stringMode id to remove, from get_variable_defs

delete_variable_collection

Delete a variable collection by id, removing the collection and every variable and mode in it; bindings to those variables revert to their raw values. To delete a single variable instead, use delete_variable. Returns { ok, collectionId, name }.

ParameterTypeDescription
collectionId *stringVariable collection id to delete

group_nodes

Group nodes under their shared parent. nodeIds must be a non-empty list. Returns { ok, nodeId, name, type } for the new group.

ParameterTypeDescription
nodeIds *arrayNode ids to group
namestringOptional name for the new group

ungroup_nodes

Ungroup GROUP nodes by id — and repeat groups (TRANSFORM_GROUP, from repeat_nodes or Figma Draw), which drops the repeat and leaves the original content in place; other nodes are skipped. Returns { ok, affected } — the ids of the children promoted out of the groups.

ParameterTypeDescription
nodeIds *arrayGroup node ids to ungroup

reparent_nodes

Move nodes into a different parent, optionally inserting at `index` (default: appended last). On-screen positions may shift because coordinates become relative to the new parent; nodes that no longer exist are skipped. To reorder within the current parent use reorder_nodes; to wrap nodes in a new frame/group use group_nodes. Returns { ok, affected }.

ParameterTypeDescription
newParentId *stringId of the parent to move them into
nodeIds *arrayNode ids to move
indexnumberOptional insertion index within the new parent

reorder_nodes

Reorder nodes within their current parent by inserting each at `index` (0 = bottom of the z-order). Detached nodes are skipped. Returns { ok, affected }.

ParameterTypeDescription
index *numberTarget index within the parent
nodeIds *arrayNode ids to reorder

find_replace_text

Replace a substring across all TEXT nodes under a scope (text set along a path is not searched — scan_text_nodes lists those, and set_text edits one). Without root the whole current page is searched; matching is case-insensitive unless caseSensitive is true. Only the matched text changes: every other run keeps its styling, and each replacement takes the style of the text it replaces. Fonts are loaded before each edit. Returns { ok, affected } — the text node ids changed.

ParameterTypeDescription
find *stringSubstring to find (non-empty)
replace *stringReplacement string
caseSensitivebooleanMatch case (default false)
rootstringOptional node id to scope the search (default: page)

batch_rename_nodes

Rename many nodes at once from a [{ nodeId, name }] list. Missing nodes are skipped. Returns { ok, affected }.

ParameterTypeDescription
renames *arrayPer-node rename instructions

add_page

Create a new page (optionally named). Returns { ok, nodeId, name, type }.

ParameterTypeDescription
namestringOptional page name

delete_page

Delete a page by id. The current page and the last remaining page cannot be deleted. Returns { ok, nodeId }.

ParameterTypeDescription
pageId *stringPage id to delete

rename_page

Rename a Figma page (a top-level page/tab in the document) by id. Affects only the page name; its node id and contents are unchanged. To rename a layer/node on the canvas use rename_node instead, and a prototype flow with update_flows. Returns { ok, nodeId }.

ParameterTypeDescription
name *stringNew page name
pageId *stringPage id to rename

navigate_to_page

Switch the active page. Subsequent selection / read tools operate on this page. Returns { ok, nodeId }.

ParameterTypeDescription
pageId *stringPage id to navigate to

set_reactions

Replace all of a node's prototype reactions — this overwrites existing reactions rather than appending. Each reaction pairs a trigger (e.g. { type: 'ON_CLICK' }, or ON_KEY_DOWN with device + keyCodes) with an actions array: NODE carries destinationId, navigation (NAVIGATE / SWAP / OVERLAY / SCROLL_TO / CHANGE_TO) and transition; URL, BACK, CLOSE, SET_VARIABLE, SET_VARIABLE_MODE, UPDATE_MEDIA_RUNTIME and CONDITIONAL carry their own fields. An OVERLAY action takes overlayRelativePosition ({ x, y }) to offset the overlay, which Figma applies only when the destination frame's overlay position is…

ParameterTypeDescription
nodeId *stringNode to set reactions on
reactions *arrayReactions to apply (replaces existing)

remove_reactions

Clear every prototype reaction from a node (equivalent to set_reactions with an empty array). Use this to strip interactivity; to replace reactions with new ones use set_reactions. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringNode to clear reactions from

update_flows

Rename, add, remove or reorder a page's prototype flows — the named starting points Presentation view lists (get_pages shows each page's flows). A flow's name is its own: it is not the frame name (rename_node) or the page name (rename_page). Flows are addressed by their starting frame's nodeId, never by name, since several flows may share one. Only the flows named are touched; every other flow keeps its name and place. flows renames a flow in place, or makes a frame a new flow appended at the end; remove stops a frame being a flow (the frame and its reactions stay); order moves flows to the…

ParameterTypeDescription
pageId *stringPage whose flows to change, from get_pages
flowsarrayFlows to rename, or frames to make new flows
orderarrayStarting frames to move to the front, in this order; the first becomes the default flow
removearrayStarting frames whose flow to remove; the frames themselves are kept

swap_component

Swap an instance's main component. Provide componentKey (published component, imported via the API) or componentId (a local COMPONENT node). Returns { ok, nodeId } (the instance id).

ParameterTypeDescription
instanceId *stringInstance node id to swap
componentIdstringLocal component node id
componentKeystringPublished component key

set_instance_properties

Set an instance's component properties (variant / boolean / text / instance-swap). Keys are the property names from get_component_api, used verbatim: VARIANT by bare name (e.g. "Size": "Large"), BOOLEAN/TEXT/INSTANCE_SWAP suffixed with #id (e.g. "Label#2:0": "Sign in", "Disabled#1:2": true). An INSTANCE_SWAP value is the target component node id. Unspecified properties keep their value; SLOT properties are not settable. Returns { ok, nodeId }.

ParameterTypeDescription
instanceId *stringInstance node id to update
properties *objectMap of property name (verbatim from get_component_api) → value

add_component_property

Declare a component property on a component (or its variant set): BOOLEAN (show/hide a layer), TEXT (editable text), or INSTANCE_SWAP (swappable nested instance). The property starts inert — attach it to a layer with bind_component_property (BOOLEAN→visible, TEXT→characters, INSTANCE_SWAP→mainComponent) for it to do anything. defaultValue must match the type (boolean / string / the default component's node id — not its key); preferredValues (INSTANCE_SWAP only, by component key) pre-populates the swap menu. VARIANT properties come from combine_as_variants, not here. Returns { ok, com…

ParameterTypeDescription
componentId *stringComponent or component-set id (a variant resolves to its set)
defaultValue *boolean | stringDefault: boolean (BOOLEAN), string (TEXT), or the component's node id (INSTANCE_SWAP, e.g. "12:34" — a component key is refused; a library component's id is the mainComponent id of an instance of it…
name *stringProperty name, e.g. "Show Icon"
type *stringProperty type
preferredValuesarrayINSTANCE_SWAP only: components/sets offered in the swap menu

bind_component_property

Attach a declared component property (from add_component_property) to a sublayer field so it drives that layer: field "visible" for a BOOLEAN, "characters" for a TEXT (the node must be a TEXT node), "mainComponent" for an INSTANCE_SWAP (the node must be an INSTANCE). The same property can be bound to several layers (call once per layer). Pass propertyId: null to remove the binding on that field. The property's type must match the field and it must exist on the containing component. Returns { ok, nodeId }.

ParameterTypeDescription
field *stringWhich layer field the property drives
nodeId *stringSublayer inside the component to bind on
propertyId *string | nullProperty id (name#id) to bind, or null to unbind this field

edit_component_property

Change an existing component property: rename it, change its defaultValue, or (INSTANCE_SWAP only) change its preferredValues. Supply at least one. Renaming returns a new propertyId (the #id suffix is kept but the name part changes), so use the returned propertyId for later calls; existing bindings keep working. Get current property ids from get_component_api. Returns { ok, componentId, propertyId, name }.

ParameterTypeDescription
componentId *stringComponent or component-set id that owns the property
propertyId *stringProperty id to edit (name#id, from get_component_api / add)
defaultValueboolean | stringNew default matching the property type: boolean / string / the component's node id (INSTANCE_SWAP — a component key is refused; a library component's id is the mainComponent id of an instance of it)
namestringNew property name
preferredValuesarrayINSTANCE_SWAP only: replacement swap-menu components/sets

delete_component_property

Remove a BOOLEAN / TEXT / INSTANCE_SWAP property from a component and every sublayer reference to it. VARIANT properties are the variant-set structure — delete their variants instead; this refuses a VARIANT. Get current property ids from get_component_api. Returns { ok, componentId, propertyId, name }.

ParameterTypeDescription
componentId *stringComponent or component-set id that owns the property
propertyId *stringProperty id to delete (name#id, from get_component_api)

detach_instance

Detach a component instance into a plain frame, permanently breaking its link to the main component; the frame keeps its current appearance and its layers become directly editable. To switch an instance to a different component instead of detaching, use swap_component. Returns { ok, nodeId, name, type } for the resulting frame.

ParameterTypeDescription
instanceId *stringInstance node id to detach

import_image

Import a raster image (PNG / JPG / GIF) and place it as a rectangle with an IMAGE fill. Provide exactly one of path (a local file the server reads), data (base64-encoded image bytes) or url. Prefer path for a file on this machine: the bytes never pass through the conversation, and a large base64 data argument can exceed the transport message limit. url is fetched by Figma, not by this machine, so it must be publicly reachable. Figma accepts at most 4096px in width and height whichever source is used, so downscale a camera-resolution photo before importing it. The rectangle defaults to the imag…

ParameterTypeDescription
datastringBase64-encoded image bytes (PNG / JPG / GIF)
heightnumberOverride height (default: image height)
namestringOptional name for the new rectangle
parentIdstringParent node id (default: current page)
pathstringLocal image file to import (PNG / JPEG / GIF), read by the MCP server; relative paths resolve against its working directory
scaleModestring
urlstringImage URL to fetch instead of data
widthnumberOverride width (default: image width)
xnumber
ynumber

set_image_fill

Put a raster image (PNG / JPG / GIF) into an existing node's fills — a photo into a card cover, an avatar into a circle — keeping the node's size, position, corners, effects and constraints. import_image instead creates a new rectangle. Provide exactly one of path (a local file the server reads; preferred, the bytes never pass through the conversation), data (base64) or url (fetched by Figma, so it must be publicly reachable). Figma accepts at most 4096px in width and height. Without index, the topmost IMAGE fill gets the new image and keeps its crop, filters and scale mode, like Figma's R…

ParameterTypeDescription
nodeId *stringNode whose fills take the image (frame, shape or text)
datastringBase64-encoded image bytes (PNG / JPG / GIF)
indexintegerFill to replace, 0 = bottom (default: the topmost IMAGE fill, else add on top)
pathstringLocal image file (PNG / JPEG / GIF), read by the MCP server; relative paths resolve against its working directory
scaleModestring
urlstringImage URL to fetch instead of data

import_svg

Import an SVG and place it as editable vector nodes (a FRAME of VECTOR paths) via createNodeFromSvg — use this for vector logos, brand marks, and icons. Provide the SVG's raw markup string (read it from the project asset, or inline it). The frame defaults to the SVG intrinsic size unless width/height are given. For raster photos (PNG / JPG) use import_image, or set_image_fill to fill an existing layer, instead; when a matching icon component already exists, create_instance it rather than re-pasting the SVG. Returns { ok, nodeId, name, type }.

ParameterTypeDescription
svg *stringRaw SVG markup, e.g. "<svg …>…</svg>"
heightnumberOverride height (default: SVG intrinsic height)
namestringOptional name for the new node
parentIdstringParent node id (default: current page)
widthnumberOverride width (default: SVG intrinsic width)
xnumber
ynumber

create_ellipse

Create an ellipse (a circle when width equals height), optionally sized/named/positioned under a parent (default: current page). To turn it into a pie, arc, or ring afterwards use set_arc. fills, strokes and layoutSizing* style it in the same call. Returns { ok, nodeId, name, type }.

create_component

Create a reusable main component. Pass fromNodeId to convert an existing node into a component (e.g. a frame of vectors from import_svg, or a built layout) — it keeps the node's position and parent unless parentId is given; omit fromNodeId to create an empty component to build into. Then create_instance the result to reuse it. Optionally sized / named / positioned and placed under a parent (default: current page). Returns { ok, nodeId, name, type }.

ParameterTypeDescription
fromNodeIdstringConvert this existing node into a component (default: create an empty component)
heightnumberHeight in px; alone, the width stays at 100 (or that of the node converted)
namestring
parentIdstringParent node id (default: current page)
widthnumberWidth in px; alone, the height stays at 100 (or that of the node converted)
xnumber
ynumber

create_section

Create a section: a canvas-level container for grouping and labelling regions of a page (e.g. flows or screen sets). Sections sit on a page or nest inside another section, but not inside a frame; for a UI container or auto-layout use create_frame instead. Returns { ok, nodeId, name, type }.

ParameterTypeDescription
heightnumberHeight in px; alone, the width stays at 496
namestringSection name
parentIdstringParent page or section id (default: current page)
widthnumberWidth in px; alone, the height stays at 496
xnumberX position in the parent
ynumberY position in the parent

create_connector

Join two FigJam nodes with a connector (the arrow or line of a flowchart), or draw one between free points. connectorStart / connectorEnd each take { endpointNodeId, magnet? } to attach to a side of a node (magnet TOP / BOTTOM / LEFT / RIGHT / CENTER, default 'AUTO': the nearest), { endpointNodeId, position } to attach at a point on it — px from its top-left, so its right-middle is { x: width, y: height / 2 } — or { position } to float, in px in the parent's coordinates. An attached end follows its node when it moves, and removing the node removes the connector with it. Without parentId it…

ParameterTypeDescription
connectorEnd *objectOne connector end: { endpointNodeId, magnet? } attached to a side of a node, { endpointNodeId, position } attached at a point on it, or { position } floating
connectorStart *objectOne connector end: { endpointNodeId, magnet? } attached to a side of a node, { endpointNodeId, position } attached at a point on it, or { position } floating
connectorEndStrokeCapstringArrowhead at the end (default 'ARROW_LINES')
connectorLineTypestringPath shape (default 'ELBOWED': right-angle bends)
connectorStartStrokeCapstringArrowhead at the start (default 'NONE')
namestringLayer name
parentIdstringParent node id. Omit it and Figma places the connector as FigJam does: in the section or frame its two nodes share, else on the page
strokeWeightnumberLine thickness in px
strokesarrayLine color(s); same shape as set_strokes
textstringLabel on the connector, written in FigJam’s caption face

create_instance

Instantiate a component. Provide componentId (a local COMPONENT node) or componentKey (a published component imported via the API). Optionally name / position / parent the instance. Returns { ok, nodeId, name, type } for the new instance.

ParameterTypeDescription
componentIdstringLocal component node id to instantiate
componentKeystringPublished component key to instantiate
namestringOptional name for the new instance
parentIdstringContainer node id; omit for current page
xnumber
ynumber

combine_as_variants

Combine two or more existing COMPONENT nodes into a single COMPONENT_SET (a variant set). Name each component with Figma variant syntax (e.g. "Size=Small", "Size=Large") beforehand so the set derives its properties. The components are reparented into the new set under parentId (default: the first component's current parent). Returns { ok, nodeId, name, type }.

ParameterTypeDescription
nodeIds *arrayComponent node ids to combine (all must be COMPONENT nodes; at least 2)
namestringOptional name for the resulting component set
parentIdstringParent to place the set under (default: the first component's parent)

set_component_documentation

Set a component's or component set's documentation: the description Figma shows for it and its documentation link. Omit any of description / descriptionMarkdown / documentationLinks to leave it unchanged; supply at least one. description is plain text; descriptionMarkdown keeps formatting (**bold**, [link](url), lists) and paragraphs. To rewrite a description you read, read it with get_local_components documentation: true and send back descriptionMarkdown when it has one: a description typed in Figma reads back with each paragraph break as three newlines, and plain text sent that way shows an…

ParameterTypeDescription
nodeId *stringCOMPONENT or COMPONENT_SET node id
descriptionstringPlain-text description; "" clears it. Replaces any formatting
descriptionMarkdownstringThe description as markdown, keeping formatting; "" clears it
documentationLinksarrayThe documentation link — at most one (Figma's limit); [] removes it
replaceFormattingbooleanLet a plain description replace one that has formatting, a link or paragraph breaks

apply_animation_style

Apply a Figma Motion animation-style preset to a node (get styleIds from get_motion_styles). config tunes it: duration (seconds), timelineOffset (seconds — the lever for staggered entrances: give each node index * step), and preset-specific props. Returns { ok, nodeId, appliedStyleId } — keep appliedStyleId to remove exactly this instance later. To stagger a whole row in one atomic, undoable call, drive N apply_animation_style ops through `batch` with increasing timelineOffset. Motion is a Figma-Design-only beta feature.

ParameterTypeDescription
nodeId *stringFigma node id to animate
styleId *stringA styleId from get_motion_styles
configobjectOptional tuning: duration, timelineOffset (for stagger), preset props

remove_animation_style

Remove an applied Figma Motion animation style from a node. Pass animationStyleId (the appliedStyleId returned by apply_animation_style, or read from get_node_motion) to remove one; omit it to remove all applied styles on the node. Returns { ok, nodeId }.

ParameterTypeDescription
nodeId *stringFigma node id to remove animation style(s) from
animationStyleIdstringThe applied-style instance id to remove; omit to remove all on the node

apply_manual_keyframe_track

Set a hand-authored Figma Motion keyframe track on a node for one field — e.g. TRANSLATION_X, OPACITY, ROTATION, SCALE_XY, or an indexed fills / strokes / effects item. `field` selects what to animate; `track` carries an optional baseValue plus keyframes (each with timelinePosition in seconds, a typed value, and optional easing). Replaces any existing track on that field. TRANSFORM_3D_ROTATION_X / Y / Z (degrees), TRANSFORM_3D_TRANSLATION_Z (px) and SCENE_3D_PERSPECTIVE (px, never negative; frames, components and instances only) animate set_transform_3d's fields: a 3D track's baseValue IS th…

remove_manual_keyframe_track

Remove the manual Figma Motion keyframe track for a given field on a node. `field` selects the same target as apply_manual_keyframe_track (a node PROPERTY or an indexed fills/strokes/effects item). Returns { ok, nodeId }.

ParameterTypeDescription
field *Which field a keyframe track drives: a node PROPERTY or an INDEXED_ITEM in fills/strokes/effects
nodeId *stringFigma node id to clear a keyframe track from

set_timeline_duration

Set the duration (in seconds, must be > 0) of a Figma Motion timeline. Get the timelineId from get_node_motion (a node's `timelines`). Returns { ok, nodeId }.

ParameterTypeDescription
duration *numberNew timeline duration in seconds (> 0)
nodeId *stringA node on the timeline (used to resolve the Motion API)
timelineId *stringTimeline id from get_node_motion

batch

Apply multiple write ops atomically (all-or-nothing with rollback). ops is an ordered list of { tool, params } where tool is any write that can be undone exactly — property, text, layout, style, variable, component, structure and create writes (e.g. set_fills, set_text, set_auto_layout, reparent_nodes, create_frame). Ops that delete something (delete_*, ungroup_nodes, detach_instance, remove_animation_style) are refused, since what they delete cannot come back under its id. An op can use what an earlier op in the same batch created: in an id argument, "$N" is op N's id (0-based) — so a who…

ParameterTypeDescription
ops *arrayOrdered write ops applied atomically