Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
pingA

Health check. Returns server info plus, when a plugin is connected, end-to-end info from the Figma sandbox.

get_selectionA

Return the IDs and basic geometry of the currently selected nodes on the active Figma page.

get_documentA

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

get_nodeA

Return a single Figma node by id, with full recursive children subtree.

get_nodes_infoA

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

get_metadataA

Return file metadata: fileName, current page, and all page references.

get_pagesA

Return id+name of every page in the active Figma file.

search_nodesA

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

scan_text_nodesA

Return every TEXT node within a subtree, each with its characters / fontSize / fontName. Scope with root (a node id); defaults to the current page.

scan_nodes_by_typesA

Return every node whose type is in the given types list, within a subtree. Scope with root (a node id); defaults to the current page. Returns a flat array of matching nodes.

get_stylesA

Return the document's local styles grouped as { paints, texts, effects, grids }. Paint styles carry their paints; text styles carry fontName / fontSize / lineHeight / letterSpacing; effect styles carry their effects; grid styles carry their layout grids.

get_variable_defsA

Return the document's local variables as { collections, variables }. Each collection lists its modes and defaultModeId; each variable lists its resolvedType and valuesByMode (primitives, RGBA colors, or { type: "VARIABLE_ALIAS", id } references to other variables).

get_local_componentsA

Return the components and component sets within a node subtree (or the current selection) as { components, componentSets }. Scans a subtree, not the whole document — pass nodeId, or select the frames to scan. Components carry their variantProperties (when part of a set); component sets carry their variantGroupProperties (available values per axis) and the ids of their variant components.

get_component_apiA

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

get_viewportA

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

get_fontsA

Return every font used on the current page as { fonts: [{ fontName, count }] }, sorted by usage frequency (descending). Mixed-font text contributes one count per styled segment.

get_annotationsA

Return Dev Mode annotations as { annotations: [{ nodeId, nodeName, annotations }] }. With nodeId, returns that node's annotations; without it, scans the current page for all annotated nodes.

get_reactionsA

Return the prototype reactions on a node as { nodeId, reactions: [{ trigger, actions }] }. Each reaction pairs an interaction trigger (click, hover, timeout…) with its actions (navigate to node, open URL, back/close…).

list_filesA

Return the files reachable from the plugin as { files: [{ fileKey, fileName, currentPage }] }. A plugin only sees its host document, so this is a single-element list describing the current file.

get_design_contextA

Get a depth-limited, token-efficient node tree for exploring large files — prefer this over get_document. Starts from nodeId, else the current selection, else the current page. depth limits child levels (omit or 0 = unlimited). detail is minimal / compact / full. dedupeComponents collapses repeated component instances (children of an already-seen main component are omitted and flagged deduped). A deduped instance still carries textOverrides — the visible text it renders ({ name, characters }) — so per-instance content (card titles, list items, form labels) is available without re-expanding the collapsed subtree.

get_screenshotA

Export nodes as base64 images: { images: [{ nodeId, format, base64, recovered?, empty? }] }. format is PNG (default) / JPG / SVG; scale applies to raster formats (default 1). base64 is null for missing or non-exportable nodes. Nodes that are fully clipped or off-canvas (carousels, masks, off-screen states) are auto-recovered at their intrinsic bounds and flagged recovered:true. empty:true means the node genuinely renders nothing even unclipped (hidden / no content) so the export is blank.

save_screenshotsA

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

export_pdfA

Export a node (or the current page) to a single PDF file on disk: { nodeId, path, empty? }. Renders the target as one PDF page — Figma's plugin API exports one page per node and cannot paginate a page into one-frame-per-page or combine multiple nodes into a multi-page file. Pass a frame / section id for a vector PDF of that node; omit nodeId for the current page (large pages can be slow). path is null if the target is missing or not exportable; empty:true means it rendered nothing (blank PDF).

analyze_projectA

Detect the local project profile (framework, language, styling system, component file extensions, svg handling) by reading manifests and config — the foundation scan_components / component_map switch on. Optional standalone probe: those tools run detection internally and return the same profile, so call this only to inspect detection in isolation (no Figma, no file scan). Runs on the server filesystem. rootDir defaults to the server cwd. Detects Tailwind v3 (config file) and v4 (CSS-first @import/@theme) and reports tailwindVersion; detects svg loader (svgr / vite-svg-loader / …) → svg.mode component vs url + an import hint.

scan_componentsA

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

component_mapA

Map the Figma component instances in a selection/subtree to existing local code components, so they can be reused instead of regenerated. Joins the grounded Figma component names (and their variant axes) against an AST scan of the project; an explicit docs/figma-component-map.md row overrides the fuzzy match. Each distinct component is mapped once with all its instance ids. A mapped candidate also reports matchedProps (Figma axes the component already has) and unmatchedProps (axes it lacks → component-extension TODOs). Returns { mappings (candidate + confidence + status high/medium/low/unmapped), unmapped, profile }.

token_mapA

Map the document's Figma variables to the project's design tokens, so generated code references existing tokens instead of hard-coded values. Joins the grounded Figma variable names + values against tokens parsed from the project CSS (Tailwind v4 @theme or :root custom properties); the match is name-based with an exact color value-match as confirmation. On a Tailwind project a variable that hits a framework built-in scale (spacing/N, line-height/N, weight/*) is reported as status 'framework-builtin' with { builtin: { scale, step } } rather than unmapped — it has no @theme token but the utility (p-4 / gap-4, leading-7, font-bold) is still usable. tokenSource overrides the detected styling config; rootDir defaults to the server cwd. Tailwind v3 JS configs are not yet parsed (pass tokenSource to a CSS file). Returns { mappings (candidate + confidence + status + matchedBy + builtin), unmapped, tokenSource, profile }.

icon_mapA

Map the Figma icon nodes in a selection/subtree to the project's existing .svg files, so codegen reuses the designer-curated asset instead of re-exporting a duplicate. Joins the grounded Figma icon names against the repo svg files (gitignore-aware scan), name-based and near-exact (a wrong icon is a silent visual bug, so unsure matches fall through to a fresh export rather than mis-reuse). Each match reports the file path, the color contract read from the file (currentColor / fixed / multi-color), and how to recolor it in this project (currentColor → text-{token}, gated on the svg mode since currentColor dies through an ). It does not fabricate the import line — compose it from the file path and profile.svg (importHint gives the loader form: svgr ?react / vite-svg-loader ?component / { ReactComponent } / url <img>), mirroring the project's existing imports for the alias/relative path. Unmatched icons are returned in unmapped; iconLibraries lists any installed icon component library (lucide / heroicons / iconify) as the alternative to a fresh export. rootDir defaults to the server cwd. Returns { mappings, unmapped, iconLibraries, profile }.

set_fillsA

Set a node's fills. SOLID: { type:'SOLID', color:{r,g,b} } (0–1). Gradient: { type:'GRADIENT_LINEAR'|…, gradientStops:[{position,color:{r,g,b,a}}], gradientTransform } (round-trips get_node output). Returns { ok, nodeId }.

set_textA

Replace a TEXT node's characters. The plugin loads the node's fonts first. Returns { ok, nodeId }.

set_text_propertiesA

Set a TEXT node's typography and layout/overflow properties. Typography: fontName ({ family, style }), fontSize, lineHeight, letterSpacing, textCase, textDecoration — these load the required fonts first. Layout/overflow: textTruncation (ellipsis), maxLines (line clamp), textAutoResize. Any field may be omitted to leave it unchanged. maxLines applies when textTruncation is ENDING. Returns { ok, nodeId }.

create_frameA

Create a frame, optionally sized/positioned and appended to a parent (else the current page). Returns { ok, nodeId, name, type }.

set_opacityA

Set a node's opacity (0–1). Returns { ok, nodeId }.

set_visibleB

Show or hide a node. Returns { ok, nodeId }.

rename_nodeA

Rename a node. Returns { ok, nodeId }.

delete_nodesA

Delete nodes by id. Missing / non-removable nodes are skipped. Returns { ok, affected } — the ids actually removed.

create_textA

Create a TEXT node with the given characters (default font loaded automatically), optionally sized/positioned and appended to a parent (else the current page). Returns { ok, nodeId, name, type }.

create_rectangleA

Create a rectangle, optionally sized/positioned and appended to a parent (else the current page). Returns { ok, nodeId, name, type }.

set_corner_radiusA

Set a node's corner radius. Pass radius for a uniform radius, and/or per-corner topLeftRadius / topRightRadius / bottomRightRadius / bottomLeftRadius (for nodes that support individual corners, e.g. a card rounded only on top, a tab or a chat bubble). A per-corner value overrides radius for that corner. At least one of radius or a corner is required. Returns { ok, nodeId }.

set_strokesA

Set a node's strokes (SOLID or gradient paints, same shape as set_fills) plus optional strokeWeight, strokeAlign (INSIDE / OUTSIDE / CENTER), dashPattern (dashes), and per-side weights (strokeTopWeight / strokeRightWeight / strokeBottomWeight / strokeLeftWeight — for nodes that support individual stroke weights, e.g. a border-bottom-only divider). A per-side weight overrides strokeWeight for that side. Any field may be omitted to leave it unchanged. Returns { ok, nodeId }.

move_nodesA

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

resize_nodesA

Resize nodes to the given width × height (positive). Non-resizable nodes are skipped. Returns { ok, affected }.

set_auto_layoutA

Configure a frame's auto layout. layoutMode NONE disables it; HORIZONTAL/VERTICAL enable flex (padding / itemSpacing / alignment / wrap); GRID enables CSS-Grid-style layout (padding / gridRowCount / gridColumnCount / gridRowGap / gridColumnGap). Returns { ok, nodeId }.

set_layout_propsA

Set a node's auto-layout child properties — how it behaves inside its auto-layout parent. layoutAlign (STRETCH = fill the counter axis, INHERIT = default). layoutGrow (1 = grow to fill the primary axis / "fill container", 0 = hug). layoutPositioning (ABSOLUTE = ignore the flow and position freely, AUTO = participate in layout). Any field may be omitted to leave it unchanged. Returns { ok, nodeId }.

set_blend_modeB

Set a node's blend mode (e.g. NORMAL, MULTIPLY, SCREEN, OVERLAY). Returns { ok, nodeId }.

set_maskA

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

set_arcA

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

set_constraintsB

Set a node's resize constraints relative to its parent. Returns { ok, nodeId }.

rotate_nodesA

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

lock_nodesA

Lock nodes (prevent selection/editing on canvas). Returns { ok, affected }.

unlock_nodesB

Unlock nodes. Returns { ok, affected }.

clone_nodeA

Duplicate a node next to the original (same parent). Returns { ok, nodeId, name, type } for the copy.

set_effectsA

Set a node's effects. Shadows (DROP_SHADOW / INNER_SHADOW) need color + offset; blurs need radius. Returns { ok, nodeId }.

create_paint_styleA

Create a local paint (color) style. SOLID or gradient paints (same shape as set_fills). Use a/b/c slashes in the name for folder grouping. Returns { ok, styleId, name }.

create_text_styleA

Create a local text style. The font is loaded before assignment. lineHeight unit is AUTO / PIXELS / PERCENT (AUTO omits value); letterSpacing unit is PIXELS / PERCENT. Returns { ok, styleId, name }.

create_effect_styleA

Create a local effect style. Shadows (DROP_SHADOW / INNER_SHADOW) need color + offset; blurs (LAYER_BLUR / BACKGROUND_BLUR) need radius. Returns { ok, styleId, name }.

create_grid_styleA

Create a local layout-grid style. GRID is uniform (sectionSize); ROWS / COLUMNS carry count + gutterSize + alignment. Returns { ok, styleId, name }.

update_paint_styleA

Update an existing paint style by id. Any of name / paints / description may be omitted to leave unchanged. Returns { ok, styleId, name }.

apply_style_to_nodeA

Bind a shared style to a node. field selects which slot the style applies to: fill / stroke / effect / grid / text. Returns { ok, nodeId }.

delete_styleA

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

create_variable_collectionA

Create a variable collection. Figma auto-creates a default mode. Returns { ok, collectionId, defaultModeId, name }.

add_variable_modeA

Add a mode (e.g. "Dark") to a variable collection. Returns { ok, modeId, name }.

create_variableA

Create a variable in a collection. resolvedType is BOOLEAN / FLOAT / STRING / COLOR. Use set_variable_value to populate per-mode values. Returns { ok, variableId, name }.

set_variable_valueA

Set a variable's value for a mode. value is a boolean / number / string, a color { r, g, b, a } (0–1), or an alias { type: "VARIABLE_ALIAS", id }. Returns { ok, variableId, name }.

bind_variable_to_nodeA

Bind a variable to a node field (e.g. width, height, characters, itemSpacing, topLeftRadius, or cornerRadius to bind all four corners at once), or unbind by passing variableId: null. The variable type must match the field. Returns { ok, nodeId }.

bind_variable_to_paintA

Bind a COLOR variable to a SOLID fill or stroke paint (the design-token way to colour a node) — or unbind by passing variableId: null. Figma stores fill/stroke colour bindings on the paint, not the node, so this is separate from bind_variable_to_node (which covers scalar fields like width / padding / radius). target is fills (default) or strokes; index selects which paint (default 0). The paint at that index must be SOLID. Returns { ok, nodeId }.

rename_variableA

Rename a variable (e.g. "color/primary" → "color/brand"). Returns { ok, variableId, name }.

delete_variableA

Delete a variable by id. Returns { ok, variableId, name }.

delete_variable_collectionA

Delete a variable collection by id, removing the collection and every variable in it (bindings to those variables revert to raw values). Returns { ok, collectionId, name }.

group_nodesA

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

ungroup_nodesA

Ungroup GROUP nodes by id; non-group nodes are skipped. Returns { ok, affected } — the ids of the children promoted out of the groups.

reparent_nodesA

Move nodes into a new parent (optionally at index). Nodes that no longer exist are skipped. Returns { ok, affected }.

reorder_nodesA

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

find_replace_textA

Replace a substring across all TEXT nodes under a scope. Without rootId the whole current page is searched; matching is case-insensitive unless caseSensitive is true. Fonts are loaded before each edit. Returns { ok, affected } — the text node ids changed.

batch_rename_nodesA

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

add_pageA

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

delete_pageA

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

rename_pageB

Rename a page by id. Returns { ok, nodeId }.

navigate_to_pageA

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

set_reactionsB

Replace a node's prototype reactions. Each reaction has a trigger (e.g. { type: 'ON_CLICK' }) and an actions array (e.g. { type: 'NODE', destinationId, navigation, transition }). Best used to round-trip get_reactions output. Returns { ok, nodeId }.

remove_reactionsA

Clear all prototype reactions from a node. Returns { ok, nodeId }.

swap_componentA

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

set_instance_propertiesA

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

detach_instanceA

Detach an instance into a plain frame (breaks the component link). Returns { ok, nodeId, name, type } for the resulting frame.

import_imageA

Import a raster image (PNG / JPG / GIF) and place it as a rectangle with an IMAGE fill. Provide data (base64-encoded image bytes) or url. The rectangle defaults to the image size unless width/height are given. scaleMode is FILL / FIT / CROP / TILE (default FILL). For vector SVG (logos / icons) use import_svg instead. Returns { ok, nodeId, name, type }.

import_svgA

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

create_ellipseA

Create an ellipse, optionally sized / named / positioned and placed under a parent (default: current page). Returns { ok, nodeId, name, type }.

create_componentA

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

create_sectionA

Create a section (a canvas-level grouping container), optionally sized / named / positioned. Sections live on a page or inside another section. Returns { ok, nodeId, name, type }.

create_instanceA

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

combine_as_variantsA

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

batchA

Apply multiple invertible write ops atomically (all-or-nothing with rollback). ops is an ordered list of { tool, params } where tool is an invertible write (e.g. set_fills, rename_node, move_nodes, create_frame). Destructive ops (delete_*, ungroup_nodes, …) are rejected. Returns { ok, results } with one result per op in order.

Prompts

Interactive templates invoked by user choice

NameDescription
figma_to_codeGenerate framework-aware code from a Figma selection that reuses the project’s existing components and design tokens instead of regenerating them (the cross-client form of the figma-codegen workflow: get_design_context + component_map + token_map).
code_to_figmaBuild a Figma design from code or a description in the connected file, reusing the file’s existing components / variables / styles instead of drawing primitives (the cross-client form of the figma-build workflow: get_variable_defs + scan_components + create_instance + bind_variable_to_paint / bind_variable_to_node).

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awdr74100/figwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server