figma-mcp-rs
v0.1.0Figma/FigJam MCP server with read/write via plugin — no API token, no limits.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
add_page
Add a new page to the Figma document.
| Parameter | Type | Description |
|---|---|---|
index | number | null | Position index to insert the page (0 = first). Defaults to last position. |
name | string | null | Name for the new page (default 'Page') |
add_variable_mode
| Parameter | Type | Description |
|---|---|---|
collectionId * | string | Variable collection ID |
modeName * | string | Name for the new mode |
apply_style_to_node
Apply an existing local style (paint, text, effect, or grid) to a node, linking the node to that style.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Target node ID in colon format e.g. 4029:12345 |
styleId * | string | Style ID to apply (from get_styles) |
target | string | null | For paint styles only — apply to 'fill' (default) or 'stroke' |
auto_arrange
Auto-arrange objects on a FigJam board in grid, row, or column layout. FigJam only.
| Parameter | Type | Description |
|---|---|---|
columns | number | null | Grid columns (default auto based on sqrt of count) |
layout | string | null | Layout mode: "grid", "row", or "column" (default "grid") |
nodeIds | array | null | Node IDs to arrange (optional; if absent, arranges page children) |
spacing | number | null | Spacing between items (default 40) |
startX | number | null | Starting X position |
startY | number | null | Starting Y position |
batch_rename_nodes
Rename multiple nodes using find/replace, regex substitution, or prefix/suffix addition.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
find | string | null | String (or regex pattern when useRegex=true) to search for in the node name |
prefix | string | null | String to prepend to the node name |
regexFlags | string | null | Regex flags e.g. 'gi' (default 'g'). Only used when useRegex=true. |
replace | string | null | Replacement string. Required when find is provided. |
suffix | string | null | String to append to the node name |
useRegex | boolean | null | Treat find as a regular expression (default false) |
bind_variable_to_node
Bind a local variable to a node property so the property is driven by the variable's value. COLOR variables: use fillColor or strokeColor. BOOLEAN variables: use visible. FLOAT variables: use opacity, rotation, width, height, cornerRadius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, strokeWeight, itemSpacing, paddingTop, paddingRight, paddingBottom, paddingLeft.
| Parameter | Type | Description |
|---|---|---|
field * | string | Property to bind: fillColor | strokeColor | visible | opacity | rotation | width | height | cornerRadius | topLeftRadius | topRightRadius | bottomLeftRadius | bottomRightRadius | strokeWeight | itemSp… |
nodeId * | string | Target node ID in colon format e.g. 4029:12345 |
variableId * | string | Variable ID to bind (from get_variable_defs) |
clone_node
Clone an existing node, optionally repositioning it or placing it in a new parent.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Source node ID in colon format e.g. '4029:12345' |
parentId | string | null | Parent node ID for the clone. Defaults to same parent as source. |
x | number | null | X position of the clone |
y | number | null | Y position of the clone |
create_code_block
Create a code block on a FigJam board with syntax highlighting. FigJam only.
| Parameter | Type | Description |
|---|---|---|
code * | string | Code content (required) |
language | string | null | Programming language (default "PLAINTEXT") |
x | number | null | X position |
y | number | null | Y position |
create_component
Convert an existing FRAME node into a reusable COMPONENT. The frame is replaced in place by the new component.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | FRAME node ID to convert, in colon format e.g. '4029:12345' |
name | string | null | Optional name for the component. Defaults to the frame's current name. |
create_connector
Create a connector on the current FigJam page, optionally linked between two nodes. FigJam only.
| Parameter | Type | Description |
|---|---|---|
endNodeId | string | null | Optional node ID the connector ends at, colon format e.g. '4029:67890' |
startNodeId | string | null | Optional node ID the connector starts from, colon format e.g. '4029:12345' |
text | string | null | Optional text label for the connector |
create_effect_style
Create a new local effect style (drop shadow, inner shadow, or blur).
| Parameter | Type | Description |
|---|---|---|
name * | string | Style name e.g. 'Shadow/Card' |
color | string | null | Shadow color as hex e.g. #000000 (default #000000, shadows only) |
description | string | null | Optional style description |
offsetX | number | null | Shadow X offset in pixels (default 0, shadows only) |
offsetY | number | null | Shadow Y offset in pixels (default 4, shadows only) |
opacity | number | null | Shadow color opacity 0–1 (default 0.25, shadows only) |
radius | number | null | Blur radius in pixels (default 8 for shadows, 4 for blurs) |
spread | number | null | Shadow spread in pixels (default 0, shadows only) |
type | string | null | Effect type: DROP_SHADOW (default), INNER_SHADOW, LAYER_BLUR, or BACKGROUND_BLUR |
create_ellipse
Create a new ellipse (circle/oval) on the current page or inside a parent node.
| Parameter | Type | Description |
|---|---|---|
fillColor | string | null | Fill color as hex e.g. #3B82F6 |
height | number | null | Height in pixels (default 100) |
name | string | null | Ellipse name |
parentId | string | null | Parent node ID in colon format. Defaults to current page. |
width | number | null | Width in pixels (default 100) |
x | number | null | X position (default 0) |
y | number | null | Y position (default 0) |
create_frame
Create a new frame on the current page or inside a parent node.
| Parameter | Type | Description |
|---|---|---|
counterAxisAlignItems | string | null | Cross-axis alignment: MIN, CENTER, MAX, or BASELINE |
counterAxisSizingMode | string | null | Cross-axis sizing: FIXED or AUTO (hug) |
counterAxisSpacing | number | null | Gap between wrapped rows/columns (only when layoutWrap is WRAP) |
fillColor | string | null | Fill color as hex e.g. #FFFFFF |
height | number | null | Height in pixels (default 100) |
itemSpacing | number | null | Auto-layout gap between children |
layoutMode | string | null | Auto-layout direction: HORIZONTAL, VERTICAL, or NONE |
layoutWrap | string | null | Wrap behaviour: NO_WRAP or WRAP |
name | string | null | Frame name |
paddingBottom | number | null | Auto-layout bottom padding |
paddingLeft | number | null | Auto-layout left padding |
paddingRight | number | null | Auto-layout right padding |
paddingTop | number | null | Auto-layout top padding |
parentId | string | null | Parent node ID in colon format. Defaults to current page. |
primaryAxisAlignItems | string | null | Main-axis alignment: MIN, CENTER, MAX, or SPACE_BETWEEN |
primaryAxisSizingMode | string | null | Main-axis sizing: FIXED or AUTO (hug) |
width | number | null | Width in pixels (default 100) |
x | number | null | X position (default 0) |
y | number | null | Y position (default 0) |
create_grid_style
Create a new local layout grid style.
| Parameter | Type | Description |
|---|---|---|
name * | string | Style name e.g. 'Grid/Desktop' |
alignment | string | null | Alignment: STRETCH (default), CENTER, MIN, or MAX (COLUMNS/ROWS only) |
color | string | null | Grid line color as hex e.g. #FF0000 (GRID only, default #FF0000) |
count | number | null | Number of columns or rows (COLUMNS/ROWS only, default 12) |
description | string | null | Optional style description |
gutterSize | number | null | Gutter size in pixels (COLUMNS/ROWS only, default 16) |
offset | number | null | Margin/offset in pixels (COLUMNS/ROWS only, default 0) |
opacity | number | null | Grid line opacity 0–1 (GRID only, default 0.1) |
pattern | string | null | Grid pattern: GRID (default), COLUMNS, or ROWS |
sectionSize | number | null | Grid cell size in pixels (GRID only, default 8) |
create_paint_style
Create a new local paint style with a solid fill color.
| Parameter | Type | Description |
|---|---|---|
color * | string | Fill color as hex e.g. #FF5733 |
name * | string | Style name e.g. 'Brand/Primary' |
description | string | null | Optional style description |
create_rectangle
Create a new rectangle on the current page or inside a parent node.
| Parameter | Type | Description |
|---|---|---|
cornerRadius | number | null | Corner radius in pixels |
fillColor | string | null | Fill color as hex e.g. #FF5733 |
height | number | null | Height in pixels (default 100) |
name | string | null | Rectangle name |
parentId | string | null | Parent node ID in colon format. Defaults to current page. |
width | number | null | Width in pixels (default 100) |
x | number | null | X position (default 0) |
y | number | null | Y position (default 0) |
create_section
Create a Figma Section node on the current page. Sections are the modern way to organize frames and groups on a page.
| Parameter | Type | Description |
|---|---|---|
height | number | null | Height in pixels |
name | string | null | Section name (default 'Section') |
width | number | null | Width in pixels |
x | number | null | X position (default 0) |
y | number | null | Y position (default 0) |
create_shape_with_text
Create a shape with text on a FigJam board (rectangles, circles, diamonds, etc.). FigJam only.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text content (required) |
fillColor | string | null | Fill color as hex |
height | number | null | Height |
shapeType | string | null | Shape type (default "ROUNDED_RECTANGLE") |
width | number | null | Width |
x | number | null | X position |
y | number | null | Y position |
create_stickies
Create multiple sticky notes at once on a FigJam board, with optional grid auto-layout. FigJam only.
| Parameter | Type | Description |
|---|---|---|
items * | array | Array of stickies to create (required, max 200) |
columns | number | null | Number of columns in grid layout (default 5) |
spacing | number | null | Spacing between stickies (default 40) |
startX | number | null | Starting X position for grid (default 0) |
startY | number | null | Starting Y position for grid (default 0) |
create_sticky
Create a sticky note on the current FigJam page. FigJam only.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text content for the sticky note (required) |
fillColor | string | null | Fill color as hex string e.g. '#FFD54F' |
name | string | null | Optional name for the node |
x | number | null | X position on the canvas |
y | number | null | Y position on the canvas |
create_table
Create a table on a FigJam board with optional cell text content. FigJam only.
| Parameter | Type | Description |
|---|---|---|
columns * | number | Number of columns (required, 1-50) |
rows * | number | Number of rows (required, 1-50) |
cells | array | null | Cell contents (optional, ragged arrays OK) |
name | string | null | Table name |
x | number | null | X position |
y | number | null | Y position |
create_text
Create a new text node on the current page or inside a parent node. The font is loaded automatically before insertion. Returns the created node ID and bounds. Use set_text to update the content of an existing text node.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text content to display |
fillColor | string | null | Text color as hex e.g. #000000 (default black) |
fontFamily | string | null | Font family name e.g. 'Inter', 'Roboto', 'SF Pro Display' (default Inter). Must be a font installed in Figma. |
fontSize | number | null | Font size in pixels (default 14) |
fontStyle | string | null | Font style variant e.g. 'Regular', 'Bold', 'Italic', 'Medium', 'SemiBold' (default Regular). Must match an available style for the chosen fontFamily. |
name | string | null | Node name shown in the layers panel (defaults to the text content) |
parentId | string | null | Parent node ID in colon format. Defaults to current page. |
x | number | null | X position in pixels (default 0) |
y | number | null | Y position in pixels (default 0) |
create_text_style
Create a new local text style (typography preset). Returns the new style's ID. Apply it to nodes with apply_style_to_node. Use get_styles to list existing text styles.
| Parameter | Type | Description |
|---|---|---|
name * | string | Style name — use slash notation to organise into groups e.g. 'Heading/H1', 'Body/Regular' |
description | string | null | Optional human-readable description shown in the Figma style panel |
fontFamily | string | null | Font family name e.g. 'Inter', 'Roboto' (default Inter). Must be installed in Figma. |
fontSize | number | null | Font size in pixels (default 16) |
fontStyle | string | null | Font style variant e.g. 'Regular', 'Bold', 'Medium', 'SemiBold' (default Regular) |
letterSpacingUnit | string | null | Letter spacing unit: PIXELS (default) or PERCENT |
letterSpacingValue | number | null | Letter spacing value (unit set by letterSpacingUnit) |
lineHeightUnit | string | null | Line height unit: PIXELS (default) or PERCENT |
lineHeightValue | number | null | Line height value (unit set by lineHeightUnit) |
textDecoration | string | null | Text decoration: NONE (default), UNDERLINE, or STRIKETHROUGH |
create_variable
Create a new variable (design token) inside an existing collection. Returns the new variable's ID. Use get_variable_defs to find collection IDs, set_variable_value to set values per mode, and bind_variable_to_node to apply the variable to a node property.
| Parameter | Type | Description |
|---|---|---|
collectionId * | string | ID of the variable collection to add this variable to (from get_variable_defs) |
name * | string | Variable name — use slash notation to group e.g. 'Color/Primary', 'Spacing/MD' |
type * | string | Variable type: COLOR (hex color), FLOAT (numeric dimension/spacing), STRING (text), or BOOLEAN (true/false toggle) |
value | string | null | Initial value for the first mode. COLOR: hex e.g. #FF5733. FLOAT: number e.g. 16. STRING: text. BOOLEAN: true or false. |
create_variable_collection
| Parameter | Type | Description |
|---|---|---|
name * | string | Collection name |
initialModeName | string | null | Name for the initial mode (default 'Mode 1') |
delete_nodes
Delete one or more nodes. This cannot be undone via MCP — use with care.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs to delete in colon format e.g. ['4029:12345'] |
delete_page
Delete a page from the Figma document. Cannot delete the only remaining page.
| Parameter | Type | Description |
|---|---|---|
pageId | string | null | Page node ID in colon format e.g. '0:2' |
pageName | string | null | Exact page name to delete (alternative to pageId) |
delete_style
Delete a style (paint, text, effect, or grid) by its ID.
| Parameter | Type | Description |
|---|---|---|
styleId * | string | Style ID to delete |
delete_variable
Delete a single variable (provide variableId) or an entire collection and all its variables (provide collectionId). Provide exactly one of the two — not both.
| Parameter | Type | Description |
|---|---|---|
collectionId | string | null | Collection ID to delete (removes all variables in the collection) |
variableId | string | null | Variable ID to delete |
detach_instance
Detach one or more component instances, converting them to plain frames. The link to the main component is broken; all visual properties are preserved.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | INSTANCE node IDs in colon format e.g. ['4029:12345'] |
execute_code
Run arbitrary Figma Plugin API code inside the plugin sandbox and return its value. The code runs as an async function body — use await and end with a return. Use this only for operations the dedicated tools do not cover; prefer the specific tool when one exists. Runs in the user's open file and is undoable with Cmd/Ctrl+Z.
| Parameter | Type | Description |
|---|---|---|
code * | string | The code to execute. It runs as an async function body — use `await` and end with a `return`. Use this only for operations the dedicated tools do not cover; prefer the specific tool when one exists. |
timeoutMs | number | null | Optional timeout in milliseconds (1-25000, default 5000). Clipped to keep it under the bridge's 30s deadline. |
export_frames_to_pdf
Export multiple frames as a single multi-page PDF file. Each frame becomes one page in order. Ideal for pitch decks, proposals, and slide exports.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Ordered list of frame node IDs to export as PDF pages, colon format e.g. '4029:12345' |
outputPath * | string | File path to write the PDF to, must end in .pdf (relative to working directory or absolute) |
export_tokens
Export all design tokens (variables and paint styles) as JSON or CSS custom properties. Ideal for bridging Figma variables into your codebase.
| Parameter | Type | Description |
|---|---|---|
format | string | null | Output format: json (default) or css |
find_replace_text
Find and replace text content across all TEXT nodes in a subtree. Searches the entire current page if no nodeId is given.
| Parameter | Type | Description |
|---|---|---|
find * | string | Text string (or regex pattern when useRegex=true) to search for |
replace * | string | Replacement string (use empty string to delete matches) |
nodeId | string | null | Root node ID to scope the search. Defaults to the entire current page. |
regexFlags | string | null | Regex flags e.g. 'gi' (default 'g'). Only used when useRegex=true. |
useRegex | boolean | null | Treat find as a regular expression (default false) |
get_annotations
Get dev-mode annotations in the current document or scoped to a specific node. Returns annotation objects with label text, measurement type, and the ID of the annotated node. Omit nodeId to retrieve all annotations on the current page.
| Parameter | Type | Description |
|---|---|---|
nodeId | string | null | Optional — scope results to annotations on this node and its descendants, colon format e.g. '4029:12345' |
get_board_contents
Get all objects and connectors on the current FigJam page. Returns nodes with text content and connection data. FigJam only.
| Parameter | Type | Description |
|---|---|---|
includeConnections | boolean | null | Include connector information (default true) |
get_design_context
Get a depth-limited, token-efficient tree of the current selection or page. Use this instead of get_document when exploring large files. Supports detail levels (minimal/compact/full) and dedupe_components for pages heavy with repeated component instances.
| Parameter | Type | Description |
|---|---|---|
dedupe_components | boolean | null | When true, INSTANCE nodes are serialized compactly (mainComponentId + componentProperties + overrides array of differing text/nested content) and unique component definitions are collected once in a t… |
depth | number | null | How many levels deep to traverse (default 2) |
detail | string | null | Property verbosity: minimal (id/name/type/bounds only), compact (+fills/strokes/opacity), full (everything, default) |
get_document
Get the full node tree of the current page (not the whole file — only the active page). Returns all nodes recursively and can be very large. Prefer get_design_context for exploration or when token efficiency matters.
get_fonts
List all fonts used in the current page, sorted by usage frequency. Useful for understanding typography without scanning all text nodes.
get_local_components
Get all components defined in the current Figma file.
get_metadata
Get metadata about the current Figma document: file name, pages, current page
get_node
Get a single node by ID with full detail. Use get_nodes_info to fetch multiple nodes in one round-trip instead of calling this repeatedly. Node ID must be colon format e.g. '4029:12345', never hyphens.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node ID in colon format e.g. '4029:12345' |
get_nodes_info
Get full details for multiple nodes by ID in one round-trip. Prefer this over calling get_node repeatedly when you need several nodes.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | List of node IDs in colon format e.g. ['4029:12345', '4029:67890'] |
get_pages
List all pages in the document with their IDs and names. Lightweight alternative to get_document.
get_reactions
Get the prototype reactions defined on a node. Returns an array of reaction objects — each has a trigger (e.g. ON_CLICK, ON_HOVER, AFTER_TIMEOUT) and an actions array (navigate to node, open URL, go back, etc.). Use set_reactions to add or replace reactions, remove_reactions to delete them.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node ID in colon format e.g. '4029:12345' |
get_screenshot
Export a screenshot of one or more nodes as base64-encoded image data (held in memory). Use save_screenshots instead when you want to write images directly to disk without base64 in the response.
| Parameter | Type | Description |
|---|---|---|
format | string | null | Export format: PNG (default), SVG, JPG, or PDF |
nodeIds | array | null | Optional node IDs to export, colon format. If empty, exports current selection. |
scale | number | null | Export scale for raster formats (default 2) |
get_selection
Get the nodes currently selected in Figma. Returns an empty array if nothing is selected. Use get_design_context or get_node to retrieve deeper detail about a specific node by ID.
get_status
Check whether the Figma plugin bridge is connected and get setup instructions when it is not. Call this first if any tool fails with 'plugin not connected'. Does not touch the Figma document.
get_styles
Get all local styles in the document (paint, text, effect, and grid). Returns each style's ID, name, type, and properties. Use the style ID with apply_style_to_node or update_paint_style. For design tokens (variables), use get_variable_defs instead.
get_variable_defs
Get all local variable definitions: collections, modes, and values. Variables are Figma's design token system.
get_viewport
Get the current Figma viewport: scroll center, zoom level, and visible bounds.
group_nodes
Group two or more nodes into a GROUP. All nodes must share the same parent.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs to group (minimum 2), in colon format e.g. ['4029:12345', '4029:12346'] |
name | string | null | Optional name for the new group |
import_image
Import a base64-encoded image into Figma as a rectangle with an image fill. Use get_screenshot to capture images or provide your own base64 PNG/JPG.
| Parameter | Type | Description |
|---|---|---|
imageData * | string | Base64-encoded image data (PNG or JPG) |
height | number | null | Height in pixels (default 200) |
name | string | null | Node name |
parentId | string | null | Parent node ID in colon format. Defaults to current page. |
scaleMode | string | null | Image scale mode: FILL (default), FIT, CROP, or TILE |
width | number | null | Width in pixels (default 200) |
x | number | null | X position (default 0) |
y | number | null | Y position (default 0) |
lock_nodes
Lock one or more nodes to prevent accidental edits in Figma.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
move_nodes
Move one or more nodes to an absolute canvas position. The same x/y is applied to every node independently (not a relative offset from current position).
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
x | number | null | Target X position |
y | number | null | Target Y position |
remove_reactions
Remove prototype reactions from a node. Omit indices to remove all reactions. Provide a zero-based indices array to remove specific reactions (use get_reactions first to see current indices).
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node ID in colon format e.g. '4029:12345' |
indices | array | null | Zero-based indices of reactions to remove. Omit or pass [] to remove all. |
rename_node
Rename a single node by ID. Returns the updated node with its new name. Use batch_rename_nodes to rename multiple nodes at once or to apply find/replace patterns across many nodes.
| Parameter | Type | Description |
|---|---|---|
name * | string | New name for the node. Figma supports slash-separated path notation e.g. 'Icons/Arrow/Left' to organise nodes in component panels. |
nodeId * | string | Node ID in colon format e.g. '4029:12345' |
rename_page
Rename an existing page in the Figma document.
| Parameter | Type | Description |
|---|---|---|
newName * | string | New name for the page |
pageId | string | null | Page node ID in colon format e.g. '0:2' |
pageName | string | null | Current page name to find (alternative to pageId) |
reorder_nodes
Change the z-order (layer stack position) of one or more nodes.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
order * | string | Order operation: bringToFront, sendToBack, bringForward, or sendBackward |
reparent_nodes
Move one or more nodes to a different parent frame, group, or section.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs to move in colon format e.g. ['4029:12345'] |
parentId * | string | Target parent node ID in colon format e.g. '4029:99' |
resize_nodes
Resize one or more nodes. The same width/height is applied to every node in the list independently. Provide width, height, or both.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
height | number | null | New height in pixels |
width | number | null | New width in pixels |
rotate_nodes
Rotate one or more nodes to an absolute angle in degrees.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
rotation * | number | Rotation angle in degrees (positive = counter-clockwise in Figma) |
save_screenshots
Export screenshots for multiple nodes and write them to the local filesystem. Returns file metadata (path, size, dimensions) — no base64 in the response. Use get_screenshot instead when you need the image data in memory.
| Parameter | Type | Description |
|---|---|---|
items * | array | List of {nodeId, outputPath, format?, scale?} objects |
format | string | null | Default export format: PNG (default), SVG, JPG, or PDF |
scale | number | null | Default export scale for raster formats (default 2) |
scan_nodes_by_types
Find all nodes of specific types in a subtree, regardless of name. Use search_nodes instead when you need to filter by name.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Root node ID to scan from, colon format e.g. '4029:12345' |
types * | array | Node types to find e.g. ['FRAME', 'COMPONENT', 'INSTANCE'] |
scan_text_nodes
Scan all TEXT nodes in a subtree and return their content. Shorthand for scan_nodes_by_types with ['TEXT'] — use when you only need text copy from a component or frame.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Root node ID to scan from, colon format e.g. '4029:12345' |
search_nodes
Search for nodes by name substring and/or type within a subtree. Use this when you know (part of) the node name. Use scan_nodes_by_types when you want all nodes of a type regardless of name.
| Parameter | Type | Description |
|---|---|---|
query * | string | Name substring to match (case-insensitive) |
limit | number | null | Maximum results to return (default: 50) |
nodeId | string | null | Scope search to this subtree (default: current page), colon format e.g. '4029:12345' |
types | array | null | Filter by Figma node type e.g. ['TEXT', 'FRAME', 'COMPONENT'] |
set_auto_layout
Set or update auto-layout (flex) properties on an existing frame.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Frame node ID in colon format e.g. '4029:12345' |
counterAxisAlignItems | string | null | Cross-axis alignment: MIN, CENTER, MAX, or BASELINE |
counterAxisSizingMode | string | null | Cross-axis sizing: FIXED or AUTO (hug) |
counterAxisSpacing | number | null | Gap between wrapped rows/columns (only when layoutWrap is WRAP) |
itemSpacing | number | null | Gap between children |
layoutMode | string | null | Auto-layout direction: HORIZONTAL, VERTICAL, or NONE |
layoutWrap | string | null | Wrap behaviour: NO_WRAP or WRAP |
paddingBottom | number | null | Bottom padding |
paddingLeft | number | null | Left padding |
paddingRight | number | null | Right padding |
paddingTop | number | null | Top padding |
primaryAxisAlignItems | string | null | Main-axis alignment: MIN, CENTER, MAX, or SPACE_BETWEEN |
primaryAxisSizingMode | string | null | Main-axis sizing: FIXED or AUTO (hug) |
set_blend_mode
Set the blend mode of one or more nodes (e.g. MULTIPLY, SCREEN, OVERLAY).
| Parameter | Type | Description |
|---|---|---|
blendMode * | string | Blend mode: NORMAL, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, COLOR_BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, EXCLUSION, HUE, SATURATION, COLOR, LUMINOSITY, PASS_THROUGH |
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
set_constraints
Set layout constraints (pinning behaviour) on one or more nodes relative to their parent.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
horizontal | string | null | Horizontal constraint: MIN (left), MAX (right), CENTER, STRETCH, or SCALE |
vertical | string | null | Vertical constraint: MIN (top), MAX (bottom), CENTER, STRETCH, or SCALE |
set_corner_radius
Set corner radius on one or more nodes. Provide a uniform cornerRadius or individual per-corner values.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
bottomLeftRadius | number | null | Bottom-left corner radius |
bottomRightRadius | number | null | Bottom-right corner radius |
cornerRadius | number | null | Uniform corner radius applied to all corners |
topLeftRadius | number | null | Top-left corner radius |
topRightRadius | number | null | Top-right corner radius |
set_effects
Apply one or more effects (drop shadow, inner shadow, layer blur, background blur) directly to a node. Replaces all existing effects. Pass an empty array to clear all effects.
| Parameter | Type | Description |
|---|---|---|
effects * | array | Array of effect objects. Each has: type (DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR), radius, color (hex, shadows only), opacity (0–1, shadows only), offsetX, offsetY (shadows only),… |
nodeId * | string | Target node ID in colon format e.g. 4029:12345 |
set_fills
Set the fill color on a single node (takes one nodeId, not an array). Use mode='append' to stack a new fill on top of existing fills instead of replacing them.
| Parameter | Type | Description |
|---|---|---|
color * | string | Fill color as hex: #RRGGBB e.g. #FF5733 or #RRGGBBAA e.g. #FF573380 for 50% alpha |
nodeId * | string | Node ID in colon format e.g. '4029:12345' |
mode | string | null | 'replace' (default) overwrites all existing fills; 'append' stacks this fill on top of existing ones |
opacity | number | null | Fill opacity 0–1 (default 1). Combines multiplicatively with any alpha in the color hex. |
set_opacity
Set the opacity of one or more nodes (0 = fully transparent, 1 = fully opaque).
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
opacity * | number | Opacity value between 0 and 1 |
set_reactions
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node ID in colon format e.g. '4029:12345' |
reactions * | array | Array of reaction objects. Each has a 'trigger' and an 'actions' array (plural) of Action objects. |
mode | string | null | "replace" (default) overwrites all existing reactions; "append" adds to them |
set_strokes
Set the stroke color and weight on a single node (takes one nodeId, not an array). Use mode='append' to stack a new stroke on top of existing strokes instead of replacing them.
| Parameter | Type | Description |
|---|---|---|
color * | string | Stroke color as hex e.g. #000000 |
nodeId * | string | Node ID in colon format e.g. '4029:12345' |
mode | string | null | 'replace' (default) overwrites all strokes; 'append' stacks on top of existing strokes |
strokeWeight | number | null | Stroke weight in pixels (default 1) |
set_text
Update the text content of an existing TEXT node.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | TEXT node ID in colon format e.g. '4029:12345' |
text * | string | New text content |
set_variable_value
Set a variable's value for a specific mode.
| Parameter | Type | Description |
|---|---|---|
modeId * | string | Mode ID within the collection |
value * | string | Value to set. COLOR: hex e.g. #FF5733. FLOAT: number e.g. 16. STRING: text. BOOLEAN: true or false. |
variableId * | string | Variable ID |
set_visible
Show or hide one or more nodes by setting their visibility.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
visible * | boolean | true to show the node, false to hide it |
swap_component
Swap the main component of an existing INSTANCE node, replacing it with a different component while keeping position and size.
| Parameter | Type | Description |
|---|---|---|
componentId * | string | Target COMPONENT node ID in colon format (from get_local_components) |
nodeId * | string | INSTANCE node ID in colon format e.g. 4029:12345 |
ungroup_nodes
Ungroup one or more GROUP nodes, moving their children to the parent and removing the group.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | GROUP node IDs in colon format e.g. ['4029:12345'] |
unlock_nodes
Unlock one or more nodes, allowing them to be edited again.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs in colon format e.g. ['4029:12345'] |
update_paint_style
Update an existing paint style's name, color, or description. Only paint styles support in-place updates — to modify text, effect, or grid styles, use delete_style and recreate them.
| Parameter | Type | Description |
|---|---|---|
styleId * | string | Paint style ID |
color | string | null | New fill color as hex e.g. #FF5733 |
description | string | null | New style description |
name | string | null | New style name |
use_figma
Run JavaScript against the Figma Plugin API inside the file. Use this for anything the named tools don't cover: FigJam tables/shapes/code blocks/labels, Slides, component variants and properties, vector networks, styled text ranges, variable scopes, library imports, bulk edits in one round-trip. Code runs as the body of `async () => { ... }`: top-level `await` works, and only the value you `return` comes back (console.log is discarded, so return IDs, counts, or names — never node objects, the response must be JSON-serializable). Sandbox rules that cause most failures: colors are 0–1 floa…
| Parameter | Type | Description |
|---|---|---|
code * | string | JavaScript executed as the body of `async () => { ... }` inside the Figma plugin sandbox. Top-level `await` is allowed. `return` the data you need — console.log is discarded and only the returned va… |