Layerbridge

v0.3.0
io.github.muradyf/layerbridge Checked 3 days ago Published 2 months ago

Read, edit and export the Figma file open in a local plugin.

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

get_local_components

List the file's own components and component sets with id, key, description, page and property definitions. Scans every page unless pageId is given.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
includeVariantsbooleanAlso list each variant inside a set (default false)
pageIdstringOnly this page (faster on big files)

create_component

Turn an existing layer into a main component.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
descriptionstring
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
namestring

combine_as_variants

Combine two or more components into a component set (variants).

ParameterTypeDescription
nodeIds *array
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
namestring
parentIdFigma node ID, e.g. '4029:12345'

create_instance

Place an instance of a local component (componentId) or a published library component (componentKey).

ParameterTypeDescription
componentIdstringFigma node ID, e.g. '4029:12345'
componentKeystringKey of a published library component
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
parentIdFigma node ID, e.g. '4029:12345'
xnumber
ynumber

swap_component

Swap an instance to another component, keeping overrides where Figma can.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
componentIdFigma node ID, e.g. '4029:12345'
componentKeystring
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

detach_instance

Detach instances into plain frames.

ParameterTypeDescription
nodeIds *array
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

set_instance_properties

Set an instance's component properties (variant values, boolean toggles, text, instance swaps). Keys can be plain names ('Label') or Figma's suffixed keys ('Label#12:0').

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
properties *object
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

add_component_property

Add a component property to a component or component set.

ParameterTypeDescription
defaultValue *string | boolean
name *string
nodeId *stringFigma node ID, e.g. '4029:12345'
propertyType *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

create_paint_style

Create a local colour style from one hex colour or a stack of solid paints.

ParameterTypeDescription
name *string
descriptionstring
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
hexstring
opacitynumber
paintsarray

create_text_style

Create a local text style. The font must be available to Figma.

ParameterTypeDescription
fontFamily *string
fontSize *number
name *string
descriptionstring
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
fontStylestringe.g. Regular, Medium, Bold (default Regular)
letterSpacingnumberPixels
lineHeightnumberPixels

create_effect_style

Create a local effect style (shadows / blurs). Shadow colours may be hex.

ParameterTypeDescription
effects *array
name *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

create_grid_style

Create a local layout-grid style using Figma's LayoutGrid objects.

ParameterTypeDescription
layoutGrids *array
name *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

update_style

Update a local style's name, description, colour, type settings, effects or grids.

ParameterTypeDescription
styleId *string
descriptionstring
effectsarray
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
fontFamilystring
fontSizenumber
fontStylestring
hexstring
layoutGridsarray
letterSpacingnumber
lineHeightnumber
namestring
opacitynumber

delete_style

Delete a local style. Requires confirm: true.

ParameterTypeDescription
confirm *booleanMust be true — this cannot be undone from here
styleId *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

apply_style

Apply a style to a layer as its fill, stroke, text, effect or grid style.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
styleId *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
targetstring

create_variable_collection

Create a local variable collection.

ParameterTypeDescription
name *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

add_variable_mode

Add a mode (e.g. Dark) to a variable collection.

ParameterTypeDescription
collectionId *string
name *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

rename_variable_mode

Rename a mode in a variable collection.

ParameterTypeDescription
collectionId *string
modeId *string
name *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

create_variable

Create a variable in a collection, optionally with values per mode. Values: hex for COLOR, number for FLOAT, boolean, string, or { alias: variableId }. Modes may be named by id or name.

ParameterTypeDescription
collectionId *string
name *string
variableType *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
valuesobject

set_variable_value

Set a variable's value for one mode (mode id or name).

ParameterTypeDescription
modeId *string
variableId *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
value

delete_variable

Delete a variable. Requires confirm: true.

ParameterTypeDescription
confirm *booleanMust be true — this cannot be undone from here
variableId *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

delete_variable_collection

Delete a variable collection and everything in it. Requires confirm: true.

ParameterTypeDescription
collectionId *string
confirm *booleanMust be true — this cannot be undone from here
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

bind_variable

Bind a variable to a layer property (width, height, itemSpacing, paddingLeft, cornerRadius, opacity, visible, characters…) or to a fill/stroke colour (field 'fill' or 'stroke'). Omit variableId to unbind.

ParameterTypeDescription
field *string
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
paintIndexinteger
variableIdstring

get_reactions

Read a layer's prototype interactions (triggers and actions).

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

set_reactions

Replace or append a layer's prototype interactions, using Figma's Reaction objects.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
reactions *array
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
modestring

remove_reactions

Remove all of a layer's interactions, or the one at index.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
indexinteger

get_annotations

Read Dev Mode annotations in a subtree (default: current page), with the file's annotation categories.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
nodeIdstringFigma node ID, e.g. '4029:12345'

set_annotations

Replace or append a layer's annotations ({ label | labelMarkdown, properties?, categoryId? }). Works in Dev Mode too.

ParameterTypeDescription
annotations *array
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
modestring

get_fonts

Fonts used in a subtree (default: current page) with how many text layers use each; optionally the fonts available to Figma.

ParameterTypeDescription
familystringFilter available fonts by family
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
includeAvailableboolean
nodeIdstringFigma node ID, e.g. '4029:12345'

create_section

Create a section, either at a given box or wrapped around existing layers (nodeIds).

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
heightnumber
namestring
nodeIdsarray
paddingnumber
widthnumber
xnumber
ynumber

set_constraints

Set a layer's resizing constraints.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
horizontalstring
verticalstring

reorder_nodes

Move layers in their parent's stacking order.

ParameterTypeDescription
nodeIds *array
position *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
indexinteger

lock_nodes

Lock or unlock layers.

ParameterTypeDescription
nodeIds *array
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
lockedbooleanDefault true

batch_rename_nodes

Rename many layers: regex find/replace, or a template with {name} {index} {type}. Target explicit nodeIds or every layer under rootId.

ParameterTypeDescription
caseSensitiveboolean
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
findstring
nodeIdsarray
replacestring
rootIdFigma node ID, e.g. '4029:12345'
startIndexinteger
templatestring

find_replace_text

Find and replace text in every text layer of a subtree (default: current page). dryRun previews.

ParameterTypeDescription
find *string
caseSensitiveboolean
dryRunboolean
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
regexboolean
replacestring
rootIdstringFigma node ID, e.g. '4029:12345'

rename_page

Rename a page.

ParameterTypeDescription
name *string
pageId *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

delete_page

Delete a page and everything on it. Requires confirm: true.

ParameterTypeDescription
confirm *booleanMust be true — this cannot be undone from here
pageId *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

get_viewport

The canvas viewport: centre, zoom and visible bounds.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

create_from_svg

Create editable vector layers from an SVG string.

ParameterTypeDescription
svg *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
namestring
parentIdstringFigma node ID, e.g. '4029:12345'
xnumber
ynumber

save_version

Save a named version to the file's version history. Figma notes very recent edits may not be included.

ParameterTypeDescription
title *string
descriptionstring
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

notify

Show a toast message inside Figma.

ParameterTypeDescription
message *string
errorboolean
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
timeoutMsnumber

get_rest_json

A layer in the REST API's JSON shape (exportAsync JSON_REST_V1), without using the REST API.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

get_selection_colors

The colours and colour styles used in the current selection.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

get_dev_resources

Dev resources (links) attached to a layer, optionally its children too.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
includeChildrenboolean

add_dev_resource

Attach a dev resource link to a layer. Works in Dev Mode.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
url *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
namestring

delete_dev_resource

Remove a dev resource link from a layer.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
url *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

get_board

FigJam: read a board as compact JSON — stickies (text, colour, author, position), shapes with text, connectors (what they join, label, line type), sections with their children, tables (cell text), code blocks, text and stamps, plus a count of every layer type. Only works when the plugin runs in a FigJam file.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
maxItemsintegerStop listing after this many items (default 500); counts still cover everything
pageIdstringA page other than the current one

create_sticky

FigJam: add a sticky note.

ParameterTypeDescription
text *string
colorstringA FigJam colour name such as yellow, green or lightGray (get_board lists the ones in use), or a hex colour
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
parentIdstringA section to put it in
widebooleanA wide sticky instead of a square one
xnumberLeft edge, in the parent's coordinates. Without x, y or parentId the item is centred in view.
ynumberTop edge, in the parent's coordinates

create_shape_with_text

FigJam: add a shape with text in it, e.g. a flowchart box or decision diamond.

ParameterTypeDescription
shapeType *string
text *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
fillstringA FigJam colour name such as yellow, green or lightGray (get_board lists the ones in use), or a hex colour
heightnumber
parentIdstringA section to put it in
widthnumber
xnumberLeft edge, in the parent's coordinates. Without x, y or parentId the item is centred in view.
ynumberTop edge, in the parent's coordinates

create_connector

FigJam: connect two items (stickies, shapes, sections…) with a connector line that follows them when they move.

ParameterTypeDescription
endNodeId *
startNodeId *stringFigma node ID, e.g. '4029:12345'
endCapstringDefault is FigJam's arrow
endMagnetstring
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
labelstring
lineTypestring
startCapstringDefault NONE
startMagnetstringWhich side it attaches to (default AUTO)

create_table

FigJam: add a table, optionally filled with text row by row.

ParameterTypeDescription
columns *integer
rows *integer
cellsarrayText per row; missing cells stay empty
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
xnumberLeft edge, in the parent's coordinates. Without x, y or parentId the item is centred in view.
ynumberTop edge, in the parent's coordinates

create_code_block

FigJam: add a code block with syntax highlighting.

ParameterTypeDescription
code *string
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
languagestring
xnumberLeft edge, in the parent's coordinates. Without x, y or parentId the item is centred in view.
ynumberTop edge, in the parent's coordinates

generate_diagram

FigJam: draw a Mermaid flowchart as real FigJam shapes, connectors and sections, laid out automatically. Supports flowchart/graph with TD, TB, BT, LR or RL; node shapes [rect], (round), {diamond}, ((circle)), ([stadium]), [(database)], {{hexagon}}, [[subroutine]], [/parallelogram/]; edges -->, ---, -.->, ==> with |label| or -- label -->; subgraphs become sections; %% comments. Styling (classDef, style, click) is skipped and reported in warnings. Returns the id of every shape, connector and section, keyed by Mermaid id. Up to 300 nodes.

ParameterTypeDescription
mermaid *stringMermaid source, starting with e.g. "flowchart LR"
directionstringOverrides the direction in the Mermaid header
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
xnumberLeft edge of the diagram (default: centred in view)
ynumberTop edge of the diagram

get_slides

Figma Slides: the deck as rows of slides with id, name, whether it is skipped, its transition and the first few text layers of each. Only works when the plugin runs in a Slides file. Edit a slide's content with the usual tools (create_text, create_frame, set_text_content, …) using the slide id as parentId.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
textNodesPerSlideintegerText layers summarised per slide (default 5, 0 for none)

create_slide

Figma Slides: add a slide, at the end of the deck or at a row and position. Use a row one past the last to start a new row.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
indexintegerPosition within the row; needs row
namestringLayer name. Figma Slides renames slides to their position number when the deck changes, so it rarely lasts; identify slides by id
rowinteger

reorder_slides

Figma Slides: rearrange the deck. Pass every slide id exactly once, grouped into rows in the new order.

ParameterTypeDescription
grid *arraySlide ids per row, e.g. [['1:2','1:3'],['1:4']]
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

delete_slide

Figma Slides: delete a slide and everything on it.

ParameterTypeDescription
confirm *booleanMust be true — this cannot be undone from here
slideId *stringThe slide's node id, from get_slides
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

set_slide_transition

Figma Slides: set the transition that plays when this slide appears. Values left out keep the slide's current ones.

ParameterTypeDescription
slideId *stringThe slide's node id, from get_slides
style *string
curvestring
delaynumberWith trigger AFTER_DELAY
durationnumberLength of the transition, as Figma's SlideTransition.duration
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
triggerstring

focus_slide

Figma Slides: make a slide the focused one, as when it is opened in single-slide view.

ParameterTypeDescription
slideId *stringThe slide's node id, from get_slides
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.

list_files

List all currently connected Figma files. Returns fileKey and fileName for each. Use the fileKey to target a specific file in other tools.

get_document

Get the current Figma page document tree. When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_selection

Get the currently selected nodes in Figma. When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_node

Get a specific Figma node by ID. Accepts top-level IDs like '4029:12345' and instance-child IDs like 'I12740:17806;12740:17793'. Never use hyphens. When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeId *stringThe node ID to fetch. Accepts top-level IDs like '4029:12345' and instance-child IDs like 'I12740:17806;12740:17793'.
depthintegerLevels of children to include (default all)
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
includeHiddenbooleanInclude children the design hides (visible: false). Default false.

get_styles

Get all local styles in the document. When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_metadata

Get metadata about the current Figma document including file name, pages, and current page info. When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_design_context

Get the design context for the current selection or page. Returns a summarized tree structure optimized for understanding the current design context. When multiple files are connected, specify fileKey.

ParameterTypeDescription
depthnumberHow many levels deep to traverse the node tree (default 2)
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_variable_defs

Get all local variable definitions including variable collections, modes, and variable values. Variables are Figma's system for design tokens (colors, numbers, strings, booleans). When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_screenshot

Export a screenshot of the selected nodes or specific nodes by ID. Returns base64-encoded image data. When multiple files are connected, specify fileKey.

ParameterTypeDescription
allowHiddenbooleanExport even when the node or an ancestor is hidden (default false — hidden nodes are reported instead, since they render nothing)
clipbooleanWhen true, export using Figma's absolute node bounds (REST use_absolute_bounds / plugin useAbsoluteBounds) so PNGs are clipped to the node's logical bounds
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
formatstringExport format: PNG (default) or SVG or JPG or PDF
nodeIdsarrayOptional list of node IDs to export. Accepts top-level IDs like '4029:12345' and instance-child IDs like 'I12740:17806;12740:17793'. Never use hyphens. If empty, exports the current selection.
scalenumberExport scale for raster formats (default 2)
svgIdAttributebooleanSVG only: write layer names as id attributes (Figma default false)
svgOutlineTextbooleanSVG only: outline text as paths (Figma default true). False keeps <text> elements.
svgSimplifyStrokebooleanSVG only: simplify inside/outside strokes (Figma default true)
timeoutMsnumberMilliseconds one export may take before it is reported as stuck (default 30000). A stuck export almost always means Figma's window is minimized or covered.

set_node_visibility

Show or hide specific Figma nodes. Returns previous visibility for each node so you can restore them after. Useful for isolating a single layer before exporting: hide all siblings, export the frame, then restore visibility.

ParameterTypeDescription
items *arrayList of nodes with their target visibility
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

set_text_content

Update the contents of a single text node. The plugin loads the node's fonts before applying the new text. Accepts either text or characters. When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeId *stringThe text node ID to update
charactersstringAlias for text, matching create_text. Supply one of the two.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
textstringThe new text content. Required unless characters is given.

set_text_properties

Patch common text properties such as font family/style, size, alignment, auto-resize, line height, letter spacing, fill color, and bounds. When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeId *stringThe text node ID to update
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
fillHexstringOptional text fill color as hex
fillOpacitynumberOptional text fill opacity from 0 to 1
fontFamilystringOptional font family
fontSizenumberOptional font size
fontStylestringOptional font style
heightnumberOptional height
letterSpacingPxnumberOptional letter spacing in pixels
lineHeightPxnumberOptional line height in pixels
textAlignHorizontalstringOptional horizontal alignment
textAlignVerticalstringOptional vertical alignment
textAutoResizestringOptional text auto-resize mode
widthnumberOptional width
xnumberOptional x position
ynumberOptional y position

set_node_properties

Patch common node properties such as name, position, size, visibility, opacity, and corner radius. Only supported properties for the target node type may be changed. Use set_solid_fill or set_gradient_fill to change paints. When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeId *stringThe node ID to update
cornerRadiusnumberOptional corner radius
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
heightnumberOptional height
namestringOptional new node name
opacitynumberOptional opacity from 0 to 1
rotationnumberOptional rotation in degrees
visiblebooleanOptional visibility
widthnumberOptional width
xnumberOptional x position
ynumberOptional y position

set_solid_fill

Replace a node's fill (or stroke) with a single solid paint. Provide a hex color and optional paint opacity — fillHex/fillOpacity are accepted as aliases. Use set_gradient_fill for gradient paints.

ParameterTypeDescription
nodeId *stringThe node ID to update
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
fillHexstringAlias for hex, matching the create_* tools. Supply one of the two.
fillOpacitynumberAlias for opacity, matching the create_* tools
hexstringSolid color as hex (e.g. '#FFAA00'). Required unless fillHex is given.
opacitynumberOptional paint opacity from 0 to 1 (default 1)
targetstringApply to fills or strokes (default fill)

set_gradient_fill

Replace a node's fill (or stroke) with a gradient paint. Provide ordered stops (position 0..1, hex color, optional alpha) and an optional 2x3 gradientTransform matching Figma's gradientTransform format. Useful for setting linear/radial/angular/diamond gradients programmatically.

ParameterTypeDescription
gradientStops *arrayOrdered list of gradient color stops (at least 2)
nodeId *stringThe node ID to update
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
gradientTransformarray2x3 affine matrix [[a,b,tx],[c,d,ty]] mapping the unit gradient onto the shape (Figma's gradientTransform). Defaults to identity (horizontal left→right).
gradientTypestringGradient family (default LINEAR)
opacitynumberOverall paint opacity (default 1)
targetstringApply to fills or strokes (default fill)

set_effects

Replace a node's effects list (drop/inner shadows, layer/background blurs). Pass an empty array to clear all effects. Each entry mirrors the shape returned by get_node's `effects` field.

ParameterTypeDescription
effects *arrayFull replacement list of effects. Pass [] to clear all effects. Each entry is a drop/inner shadow or a layer/background blur.
nodeId *stringThe node ID to update
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

set_stroke_properties

Patch stroke geometry properties: weight, align, dash pattern, cap, join. Use set_solid_fill/set_gradient_fill with target='stroke' to set the paint itself.

ParameterTypeDescription
nodeId *stringThe node ID to update
dashPatternarrayDash pattern as [dash, gap, dash, gap, ...] in pixels. Pass [] for a solid stroke.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
strokeAlignstringHow the stroke is positioned relative to the geometry edge
strokeCapstringEnd-cap style (only meaningful on open paths/lines)
strokeJoinstringCorner join style
strokeWeightnumberStroke thickness in pixels

set_auto_layout

Configure auto-layout on a frame: direction, gap, padding, alignment, sizing modes, wrap. Set layoutMode='NONE' to disable auto-layout on the frame.

ParameterTypeDescription
nodeId *stringThe node ID to update (must be a frame)
counterAxisAlignItemsstringAlignment along the counter axis
counterAxisSizingModestringAUTO = hug contents along counter axis
counterAxisSpacingnumberGap between wrapped rows/columns (only when layoutWrap=WRAP)
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
itemSpacingnumberGap between children along the primary axis (pixels)
layoutModestringAuto-layout direction. 'NONE' disables auto-layout.
layoutWrapstringAllow children to wrap onto multiple rows/columns
paddingBottomnumber
paddingLeftnumber
paddingRightnumber
paddingTopnumber
primaryAxisAlignItemsstringAlignment along the primary axis
primaryAxisSizingModestringAUTO = hug contents along primary axis

create_page

Create a new page in the Figma document, optionally naming it and switching the editor to it. Returns the new page's ID, which can be passed as parentId to create_frame / create_text / create_shape / create_image to author content on that page. When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
namestringOptional page name (defaults to Figma's 'Page N')
setAsCurrentbooleanWhen true, switch the editor to the new page after creating it (default false)

create_frame

Create a new frame, optionally inside a specified parent. You can set name, size, position, and a solid fill. When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
fillHexstringOptional solid fill color as hex
fillOpacitynumberOptional solid fill opacity from 0 to 1
heightnumberFrame height
namestringOptional frame name
parentIdstringOptional parent node ID to append the frame into
widthnumberFrame width
xnumberOptional x position
ynumberOptional y position

create_text

Create a new text node, optionally inside a specified parent. You can set its content, font, size, alignment, color, position, and bounds. When multiple files are connected, specify fileKey.

ParameterTypeDescription
charactersstringInitial text content
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
fillHexstringOptional text fill color as hex
fillOpacitynumberOptional text fill opacity from 0 to 1
fontFamilystringFont family, defaults to Inter
fontSizenumberOptional font size
fontStylestringFont style, defaults to Regular
heightnumberOptional height
namestringOptional text node name
parentIdstringOptional parent node ID to append the text into
textAlignHorizontalstringOptional horizontal alignment
textAutoResizestringOptional text auto-resize mode
widthnumberOptional width
xnumberOptional x position
ynumberOptional y position

create_shape

Create a rectangle, ellipse, or line, optionally inside a specified parent. You can set its size, position, rotation, fill, and stroke. When multiple files are connected, specify fileKey.

ParameterTypeDescription
shapeType *stringShape type to create
cornerRadiusnumberOptional corner radius for supported shapes
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
fillHexstringOptional fill color as hex
fillOpacitynumberOptional fill opacity from 0 to 1
heightnumberOptional height
namestringOptional shape name
parentIdstringOptional parent node ID to append the shape into
rotationnumberOptional rotation in degrees
strokeHexstringOptional stroke color as hex
strokeOpacitynumberOptional stroke opacity from 0 to 1
strokeWeightnumberOptional stroke weight
widthnumberOptional width
xnumberOptional x position
ynumberOptional y position

create_image

Create an image-backed rectangle from a local file path, remote URL, or data URI. You can set its parent, position, size, corner radius, and fit mode. When multiple files are connected, specify fileKey.

ParameterTypeDescription
source *stringImage source. Accepts a local file path (absolute or relative to the MCP server cwd), an http/https URL, or a data URI.
cornerRadiusnumberOptional corner radius
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
heightnumberOptional height
namestringOptional image node name
parentIdstringOptional parent node ID to append the image into
scaleModestringHow the image should fit its bounds: FILL (default) or FIT
widthnumberOptional width
xnumberOptional x position
ynumberOptional y position

import_html_layers

Import a DOM serialization (JSON produced by html-figma's browser htmlToFigma()) as editable Figma layers inside a new wrapper frame — frames, text, rectangles, and SVG vectors in one call. Source must be a JSON file path inside the MCP server working directory. Optionally append the wrapper into an existing frame/section via parentId. Requires the plugin to be open in the design editor. When multiple files are connected, specify fileKey.

ParameterTypeDescription
source *stringPath to a JSON file containing an html-figma htmlToFigma() layer tree, relative to the MCP server cwd (absolute paths must stay inside it).
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
namestringOptional name for the wrapper frame (default: 'imported layers')
parentIdstringOptional parent node ID (frame/section) to append the wrapper frame into. x/y become relative to that parent.
xnumberOptional x position of the wrapper frame
ynumberOptional y position of the wrapper frame

duplicate_nodes

Duplicate one or more nodes in place. The duplicates remain under the same parent as the originals. When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeIds *arrayList of node IDs to duplicate
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

reparent_nodes

Move one or more nodes into a different parent container. When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeIds *arrayList of node IDs to move
parentId *stringDestination parent node ID
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

group_nodes

Wrap a list of nodes in a new group. Nodes must share a common parent (or supply parentId explicitly). Returns the new group's node ID.

ParameterTypeDescription
nodeIds *arrayNode IDs to group. Must share a common parent.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
namestringOptional name for the new group
parentIdstringOptional explicit parent for the new group. Defaults to the shared parent of the input nodes.

ungroup_node

Ungroup a group or frame — its children move up to its parent and the wrapper is removed. Returns the IDs of the orphaned children in their new parent.

ParameterTypeDescription
nodeId *stringGroup or frame to ungroup. Children move up to its parent and the wrapper is removed.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

set_selection

Set the current page selection to a list of node IDs. Pass an empty array to clear the selection. Works in both design editor and Dev Mode.

ParameterTypeDescription
nodeIds *arrayNode IDs to select. Pass [] to clear the selection.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

scroll_and_zoom_into_view

Scroll and zoom the Figma viewport so the given nodes are framed in view. Works in both design editor and Dev Mode.

ParameterTypeDescription
nodeIds *arrayNode IDs to frame in the viewport
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

delete_nodes

Delete one or more nodes. This is destructive and requires confirm: true. Page and document nodes cannot be deleted through this tool. When multiple files are connected, specify fileKey.

ParameterTypeDescription
confirm *booleanMust be true to confirm deletion
nodeIds *arrayList of node IDs to delete
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_motion_styles

List all available animation presets in Figma (Motion API beta). When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

get_node_motion

Read a node's current animationStyles, animations, manualKeyframeTracks, and timelines (Motion API beta). When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeId *stringThe node ID to fetch motion properties for
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

apply_animation_style

Apply a preset animation style to a node (Motion API beta). When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeId *stringThe node ID to apply the style to
styleId *stringThe ID of the animation style to apply
animationStyleDataobjectOptional values used to configure the applied animation style (e.g. duration, timelineOffset, axis, direction)
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

remove_animation_style

Remove an applied animation style from a node (Motion API beta). If no animationStyleId is provided, removes all styles. When multiple files are connected, specify fileKey.

ParameterTypeDescription
nodeId *stringThe node ID to remove the style from
animationStyleIdstringThe ID of the animation style to remove. If omitted, all animation styles are removed.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

apply_manual_keyframe_track

Applies or replaces the manual Motion keyframe track for a property, paint, or effect field on a node. When multiple files are connected, specify fileKey.

ParameterTypeDescription
field *objectThe property, paint, or effect field to animate. Example: { type: 'PROPERTY', name: 'TRANSLATION_X' }
nodeId *stringThe node ID to apply the track to
track *objectThe manual keyframe track to write. Contains keyframes, baseValue, etc.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

remove_manual_keyframe_track

Removes the manual Motion keyframe track for a property, paint, or effect field on a node. When multiple files are connected, specify fileKey.

ParameterTypeDescription
field *objectThe property, paint, or effect field to remove. Example: { type: 'PROPERTY', name: 'TRANSLATION_X' }
nodeId *stringThe node ID to remove the track from
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

set_timeline_duration

Sets the duration (in seconds) for a timeline. When multiple files are connected, specify fileKey.

ParameterTypeDescription
duration *numberThe new timeline duration in seconds (must be greater than zero)
nodeId *stringThe node ID whose timeline duration will be changed
timelineId *stringA timeline id read from the node's timelines array
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

save_screenshots

Export nodes and save them straight to disk, one node at a time (PNG/SVG/JPG/PDF). Returns metadata only. Hidden nodes and existing files are reported rather than failing the batch; the run stops early if Figma's exports stall. When multiple files are connected, specify fileKey.

ParameterTypeDescription
items *arrayList of screenshot save operations to execute in batch
allowHiddenbooleanExport even when the node or an ancestor is hidden (default false — hidden nodes are reported instead, since they render nothing)
clipbooleanDefault clipping behavior for saved screenshots. When true, PNGs are clipped to the node's logical bounds using Figma's absolute node bounds.
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
formatstringDefault export format: PNG (default) or SVG or JPG or PDF
overwritebooleanReplace files that already exist (default false — existing files are reported, not touched)
scalenumberDefault export scale for raster formats (default 2)
svgIdAttributebooleanSVG only: write layer names as id attributes (Figma default false)
svgOutlineTextbooleanSVG only: outline text as paths (Figma default true). False keeps <text> elements.
svgSimplifyStrokebooleanSVG only: simplify inside/outside strokes (Figma default true)
timeoutMsnumberMilliseconds one export may take before it is reported as stuck (default 30000). A stuck export almost always means Figma's window is minimized or covered.

export_assets

Export every matching layer in a frame to a folder, e.g. all icon instances as SVG, exactly as Figma draws them on that screen, overrides included. Scans rootId with the filter (types, namePattern, size, stopAtMatch, default true) or takes explicit nodeIds; skips hidden layers; writes identical exports once; writes manifest.json with each node's bounds relative to rootId and its file. Stops early and says why if exports stall.

ParameterTypeDescription
outputDir *stringDirectory to write into, relative to the MCP server's working directory (or inside FIGMA_BRIDGE_OUTPUT_ROOTS)
clipbooleanUse the node's logical bounds instead of its render bounds
dedupebooleanWhen two nodes export byte-identical files (ignoring generated SVG ids), write the file once and point the second at it in the manifest (default true)
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
fileNamestringFile name template without extension. Tokens: {name} {id} {index} {type} {x} {y} (x/y relative to rootId). Default '{name}__{id}'
formatstringDefault SVG
includeHiddenbooleanAlso match layers the design hides (default false; they render nothing)
limitintegerMaximum nodes to export (default 500)
manifestbooleanWrite manifest.json listing every node, its bounds and its file (default true)
maxDepthintegerDo not descend deeper than this
maxSizenumberMatch only nodes whose larger side is at most this many px
minSizenumberMatch only nodes whose larger side is at least this many px
namePatternstringCase-insensitive regular expression the layer name must match
nodeIdsarrayExport exactly these nodes instead of scanning (rootId still sets relative positions)
overwritebooleanReplace files that already exist (default false — existing files are reported, not touched)
rootIdstringScan this node's subtree with the filter below and export every match
scalenumberRaster scale (default 2)
stopAtMatchbooleanDo not look inside a node that matched — so an icon instance is returned whole, not also as its inner vectors
svgIdAttributebooleanSVG only: write layer names as id attributes (Figma default false)
svgOutlineTextbooleanSVG only: outline text as paths (Figma default true). False keeps <text> elements.
svgSimplifyStrokebooleanSVG only: simplify inside/outside strokes (Figma default true)
timeoutMsnumberMilliseconds one export may take before it is reported as stuck (default 30000). A stuck export almost always means Figma's window is minimized or covered.
typesarrayNode types to match, e.g. ['INSTANCE','VECTOR','BOOLEAN_OPERATION','TEXT','FRAME']

export_tokens

Export the file's local variables (every mode) and colour/text/effect styles as W3C design-tokens JSON, CSS custom properties, or both, written to disk.

ParameterTypeDescription
outputPath *stringFile to write (e.g. tokens.json or tokens.css); with format 'both' the extension is replaced
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
formatstringW3C design-tokens JSON (default), CSS custom properties, or both
overwritebooleanReplace files that already exist (default false — existing files are reported, not touched)

export_frames_to_pdf

Export frames as one multi-page PDF, one page per frame in the order given, written to disk.

ParameterTypeDescription
nodeIds *arrayFrames in page order
outputPath *stringPDF file to write
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
overwritebooleanReplace files that already exist (default false — existing files are reported, not touched)
timeoutMsnumberMilliseconds one export may take before it is reported as stuck (default 30000). A stuck export almost always means Figma's window is minimized or covered.
titlestringPDF document title

export_image_fills

Save the original images behind image fills in a subtree — the uploaded bitmaps, not a render — plus images.json listing which layers use each.

ParameterTypeDescription
nodeId *stringLayer whose subtree's image fills are saved
outputDir *stringDirectory to write the original images into
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
overwritebooleanReplace files that already exist (default false — existing files are reported, not touched)

import_tokens

Import design tokens into the file's local variables: W3C DTCG JSON (including export_tokens output), CSS custom properties (:root is the default mode; [data-theme="x"], .dark and @media (prefers-color-scheme: dark) are other modes) or Tailwind v4 @theme blocks. Matches existing variables by collection and name, creates what is missing, updates what changed, and sets aliases last. Previews by default — pass dryRun: false to apply. Never deletes; variables the import leaves out are listed as missing.

ParameterTypeDescription
collectionstringPut every token in this collection. Without it, DTCG uses each top-level group as the collection and CSS names are matched to existing variables, falling back to "Tokens".
contentstringThe tokens themselves, instead of a file
deleteMissingbooleanNot implemented: missing variables are only reported, never deleted
dryRunbooleanDefault true: report the plan without changing the file
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
formatstringDefault auto: JSON is DTCG, anything else CSS (which includes @theme blocks). tailwind reads only @theme blocks.
modeMappingobjectRename source modes to Figma mode names, e.g. { "dark": "Dark", ":root": "Light" }
sourcestringPath to a .json or .css file, relative to the server's working directory

compare_to_image

Compare a Figma node with the built page or component: exports the node as PNG, compares it with a local screenshot (image) or a screenshot Playwright takes of a local URL, and writes design, actual and diff PNGs. Returns the mismatch percentage and the largest mismatching regions in design coordinates, each with the layers most likely responsible. url needs the optional Playwright install.

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
fitstringWhen sizes differ: crop compares the overlapping top-left area (default); resize scales the image to the design's size first
imagestringPath to a PNG (or JPG, with the optional jpeg-js) of the built UI, inside the allowed folders
maxRegionsintegerHow many regions to return (default 5)
outputDirstringWhere to write the PNGs (default figma-compare), inside the allowed folders
scalenumberPixels per design unit for both images (default 1). Use 2 for a retina screenshot.
selectorstringWith url: screenshot only the first element matching this CSS selector
thresholdnumberpixelmatch colour threshold, 0–1 (default 0.1; lower is stricter)
urlstringA localhost or file URL to screenshot instead (needs Playwright)
viewportobjectWith url: window size in CSS pixels (default: the node's size)

import_url

Render a localhost or file URL in Playwright and import the page (or one element, via selector) as editable Figma layers — frames, text, images and SVGs — through import_html_layers. Needs the optional Playwright install.

ParameterTypeDescription
url *stringA localhost or file URL (other hosts need FIGMA_BRIDGE_ALLOW_REMOTE_URLS=1)
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
namestringName of the wrapper frame (default: the URL's host and path)
parentIdstringFrame or section to put the wrapper in
selectorstringCSS selector of the element to import (default body)
viewportobjectBrowser window size in CSS pixels (default 1440×900)
xnumber
ynumber

get_code_context

Design-to-code context for one layer, read in a single walk. format "json" (default) returns a compact tree — each layer's flex/grid layout (mode, gap, padding, justify/align, fixed/hug/fill sizing, absolute position with constraints), a ref into a deduped styles table (fills, strokes, radius, effects, opacity) and textStyles table, text with mixed-style segments, component instances with variant and property values, icons collapsed to { type: ICON, assetHint }, image fills as imageRef — plus tokens used and assets to export. Every variable-bound value carries the variable name, its CSS cu…

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
expandInstancesbooleanRead inside component instances instead of treating each as a component placeholder (default false; the requested layer is always read)
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
formatstring"json" (default), "jsx-tailwind" or "html-css"
includeHiddenbooleanInclude layers turned off in the design (default false)
inlineSvgMaxBytesintegerInline each icon's SVG when it is at most this many bytes (default 0: never; up to 60 icons)
maxDepthintegerLevels of children to read; deeper layers are summarised with a childCount. Default: no limit
maxNodesintegerStop after this many layers (default 3000)

run_script

Run JavaScript inside the Figma plugin with `figma` (the Plugin API) in scope, as the body of an async function: use await, and return a JSON-serialisable value. Returns { result, logs (console.log/info/warn/error/debug during the run), durationMs }; nodes in the result become {id, name, type}, cycles are cut and results over ~200KB are truncated. The script can change or delete anything in the file. In Dev Mode only reading works. A timed-out script cannot be stopped and may keep running. Off unless the server runs with FIGMA_BRIDGE_ALLOW_SCRIPTS=1.

ParameterTypeDescription
code *stringBody of an async function, e.g. "const n = await figma.getNodeByIdAsync('1:2'); return n.name"
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
timeoutMsintegerDefault 10000, max 60000

generate_component_docs

Document a component or component set (an instance documents its main component): name, description, documentation links, property definitions with types, defaults and variant options, the variants, every variable (with its CSS custom property) and style used inside it, and optionally how many instances the file has. Returns markdown (default) or JSON; outputPath also writes it to a file, writeToCanvas also places a documentation frame beside the component (needs the design editor).

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
countInstancesbooleanCount instances across the file (can be slow on big files; default false)
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
formatstring"markdown" (default) or "json"
outputPathstringAlso write the result here (inside the allowed output folders)
overwritebooleanReplace an existing file at outputPath (default false)
writeToCanvasbooleanAlso create a documentation frame next to the component (default false)

check_accessibility

Check a frame for WCAG 2.2 accessibility problems: text contrast (1.4.3 AA / 1.4.6 AAA), target size (2.5.8, or 2.5.5 at 44px) and very small text. Contrast is computed from the layers behind each text; when the background is an image, gradient, blur or blend it renders the containing layer as a PNG and samples the pixels behind the text, reporting the worst background colour (method: sampled). Returns a 0-100 score and issues sorted by severity, each with the node, colours, ratio, required ratio, informational APCA Lc, and the nearest colour variable or style that would pass. Optional: write…

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
annotatebooleanAdd a Figma annotation to each failing layer (changes the file; design editor only)
checksarrayWhich checks to run (default all three)
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
levelstringWCAG level (default AA)
maxExportsintegerMost layers to render for pixel sampling (default 25)
maxIssuesintegerMost issues in the reply (default 200; files list all)
minFontSizenumberWarn below this font size in px (default 12)
minTargetnumberMinimum target size in px (default 24 for AA per WCAG 2.5.8; 44 for AAA 2.5.5 and Apple's HIG)
outputDirstringWrite accessibility-<node>.json and .md here (inside the allowed output folders)

lint_design_system

Lint a frame against the file's design system. Rules: unbound-color (solid fill/stroke with no variable or style; suggests the matching local colour variable in the layer's mode, respecting variable scopes, or paint style — exact first, else nearest by CIEDE2000 within maxDeltaE), unbound-spacing and unbound-radius (auto-layout gap/padding and corner radius not bound to a number variable; suggests one), text-without-style (suggests the nearest text style in the same family), detached-instance, off-scale-spacing / off-scale-radius (against spacingScale/radiusScale, or a scale inferred from th…

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
includeInstanceChildrenbooleanAlso look inside instances (default false: their insides come from the main component, so lint that instead)
limitintegerMost layers with findings to collect (default 5000)
maxDeltaEnumberColour distance (CIEDE2000) for suggestions (default 5; fixes use 2)
maxIssuesintegerMost issues in the reply (default 300)
radiusScalearrayAllowed corner radii in px
respectScopesbooleanOnly suggest variables whose scopes allow the property (default true)
rulesarrayRules to run (default all)
spacingScalearrayAllowed spacing values in px

fix_design_system

Apply lint_design_system's suggestions: bind solid fills/strokes to matching colour variables (or a paint style when the layer has one paint), bind auto-layout spacing/padding and corner radius to number variables with exactly the same value, and give unstyled text a text style whose font, size, line height and letter spacing match. Only binds when the variable resolves, in that layer's mode, to the same value (colours within maxDeltaE, default 2); re-checks each layer before changing it and reverts if Figma changed the result. dryRun defaults to true and returns the plan without changing anyt…

ParameterTypeDescription
nodeId *stringFigma node ID, e.g. '4029:12345'
dryRunbooleanDefault true: plan only. Pass false to change the file.
fileKeystringThe fileKey of the Figma file. Required when several files are connected; see list_files.
includeInstanceChildrenbooleanAlso look inside instances (default false: their insides come from the main component, so lint that instead)
limitintegerMost layers with findings to collect (default 5000)
maxDeltaEnumberLargest colour change allowed when binding (CIEDE2000, default 2; 0 = exact only)
maxItemsintegerMost changes/skips listed in the reply (default 300)
respectScopesbooleanOnly bind variables whose scopes allow the property (default true)
rulesarrayWhich fixes (default all four)

health

Diagnose the bridge: server version and role, connected files, and a live test export from the plugin. Use it when calls time out: it tells a dead plugin apart from one node that will not export.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
nodeIdstringNode to test-export (default: the first visible layer on the current page)

get_pages

List the file's pages and which one Figma currently shows. When multiple files are connected, specify fileKey.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.

navigate_to_page

Switch Figma to a page by pageId or exact pageName. Reads and exports work across pages without this; use it to change what get_document and get_selection see.

ParameterTypeDescription
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
pageIdstringPage ID, e.g. '0:1'
pageNamestringExact page name, used when pageId is not given

get_nodes

Fetch several nodes in one call. Each result carries its tree (optionally depth-limited), absolute bounds, auto-layout sizing, instance component properties and mixed-text segments. A node that fails is reported in place instead of failing the call. includeHidden keeps layers the design turns off.

ParameterTypeDescription
nodeIds *arrayNode IDs to fetch
depthintegerLevels of children to include (default all)
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
includeHiddenbooleanInclude children the design hides (visible: false). Default false.

scan_nodes

Search a node's subtree and return a flat list of matches: id, name, type, visibility, layer path, absolute bounds, bounds relative to the root, text and font for TEXT, component name for INSTANCE. Filter by types, namePattern, textPattern, size, maxDepth; stopAtMatch keeps an icon instance whole. Hidden layers are skipped unless visibleOnly is false.

ParameterTypeDescription
rootId *stringNode whose subtree is searched
fileKeystringThe fileKey of the Figma file to query. Required when multiple files are connected. Use list_files to see connected files.
limitintegerMaximum matches returned (default 2000)
maxDepthintegerDo not descend deeper than this
maxSizenumberMatch only nodes whose larger side is at most this many px
minSizenumberMatch only nodes whose larger side is at least this many px
namePatternstringCase-insensitive regular expression the layer name must match
stopAtMatchbooleanDo not look inside a node that matched — so an icon instance is returned whole, not also as its inner vectors
textPatternstringCase-insensitive regular expression a TEXT node's characters must match
typesarrayNode types to match, e.g. ['INSTANCE','VECTOR','BOOLEAN_OPERATION','TEXT','FRAME']
visibleOnlybooleanSkip hidden layers and everything inside them (default true)