Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LOCALFIG_OUTNoWhere figma_export writes.~/.localfig/exports
LOCALFIG_HOMENoWhere the token, plugin and exports live.~/.localfig
LOCALFIG_PORTNoThe port for the local bridge. Also change networkAccess in the manifest and re-import the plugin.8765

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
figma_statusA

Bridge + plugin health: is the Figma plugin connected, which file/page is open, current selection, and whether dynamic code execution is available.

figma_evalA

Run JavaScript inside the Figma plugin sandbox, against the file where the bridge plugin is running.

  • The code body is wrapped in an async function: top-level await and return both work.

  • Globals: figma (full Plugin API) and helpers.

  • Use figma.getNodeByIdAsync(id) — the sync getNodeById is unavailable under dynamic-page access.

  • Switch pages with: await figma.setCurrentPageAsync(page)

  • Load fonts before ANY text mutation, or use helpers.setText / helpers.loadNodeFonts.

  • The return value is JSON-serialized (figma.mixed -> "mixed", cycles pruned). Real Figma nodes collapse to {id,name,type}; return plain data (ids, numbers, strings) instead.

  • resize() RESETS sizing: on TEXT it sets textAutoResize to NONE (resize first, then set textAutoResize = "HEIGHT"); on auto-layout frames it sets both sizing modes to FIXED (set them after resizing, or use helpers.set / helpers.createText, which order this correctly).

  • Heights of text and hug-sized frames read back correctly right after the change — if you see h=10 on a text you resized, the auto-resize was reset (see above).

  • Each mutating tool call becomes ONE undo step for the person (checkpointed with figma.commitUndo); figma_history {action:"undo"} reverts the last call if asked within 60 s. Call helpers.reveal(nodes) at the end so what you built is on their screen.

  • For structure + styles (fills, fonts, effects, auto-layout, bound variables, components) of an existing frame, prefer figma_metadata with styles:true over a hand-written walker; figma_tokens lists the file's variable collections and styles.

helpers: setText(node, chars), loadNodeFonts(node), createText({characters, font:{family,style}, fontSize, color:"#hex", width, lineHeight(%), letterSpacing(px), textCase, textAlign, name, parent, x, y}), rgb("#hex"), set(node, props), query(root, selector), createAutoLayout(dir, props), reveal(nodes), notify(msg), rgba("#hex8"), collection(name, [modes]), token(collection, name, "COLOR"|"FLOAT"|"STRING"|"BOOLEAN", value | {mode: value}), bind(node, "fills"|"strokes"|prop, variable), importComponent(key), instance(key, parent, props), command(kind, payload) — runs a typed command (tokens, metadata, find, changes...) from inside eval and returns {result}.

figma_metadataA

Structural dump of a node subtree (id, name, type, x/y/w/h, text characters). Omit nodeId for the current page. Cheap way to find node IDs before editing. Pass styles:true to also get fills, strokes, effects, opacity, corner radius, auto-layout and text styles per node — plus bound variables (token names), named styles, and for instances the main component and its property values. css:true adds the CSS Figma computes per node.

figma_exportA

Export nodes to local files. PNG/JPG (up to 2 MB each) are attached inline as images — the screenshot path. JSON = the subtree in Figma REST API shape (JSON_REST_V1), for design-to-code tooling; SVG and JSON also come back inline as text (up to 200 KB).

figma_tokensA

Design tokens and styles of the open file: every local variable collection with its modes and per-mode values (colors as hex, aliases as {name}), plus local paint/text/effect styles. Read this before generating code or building on a design system; figma_metadata with styles:true then tells you what each node is bound to.

figma_findA

Search the current page (or all pages) for nodes by type, layer-name pattern and/or text content. Returns ids, names and positions — the way to locate things in a big file before editing.

figma_changesA

What changed in the file since a previous call: node creations, deletions and property changes recorded by the plugin, with a per-node summary. Changes made by tool calls are tagged byPlugin (heuristic: they arrive during, or within 2 s after, a mutating call) and hidden by default, so this shows what the person edited in Figma between your calls. Pass back the returned seq as since.

figma_historyA

snapshot: save a named version to the file's version history — a restore point before risky edits. undo: revert the edits of the last mutating tool call (figma_eval / figma_place_image / library import) if it ran within the last 60 s; after that they are committed to the file's undo history as one step per call, where the person can Ctrl+Z them.

figma_libraryA

Team library access (the plugin manifest asks for the "teamlibrary" permission). collections: list the library variable collections available to this file. variables: list the variables in one collection (collectionKey). import: bring a component / componentSet / style / variable into the file by its library key; for components, instance:true also places an instance (figma_metadata reports component keys on instances).

figma_place_imageA

Put a local image file into a node as an image fill. Any format the browser decodes (PNG, JPG, WebP, GIF, BMP, AVIF...): images over 4096px per side are downscaled automatically in the plugin UI and non-native formats are converted to PNG. The result reports what was done (prepared).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.3/5.0

Scored across 10 tools

Disambiguation5/5

Each tool targets a clearly distinct concern: connection status, arbitrary plugin execution, structural metadata, design tokens, search, change tracking, history, library access, export, and image placement. Even the overlap between metadata and find is resolved by their descriptions: metadata dumps subtree structure, find locates nodes by criteria.

Naming Consistency4/5

All tools share the figma_ prefix, which makes the family recognizable. There is slight inconsistency in grammatical form—nouns like figma_metadata and figma_tokens versus verbs like figma_find and figma_place_image—but the pattern is still predictable and readable.

Tool Count5/5

Ten tools is well within the ideal 3–15 range and matches the server's scope: a Figma bridge needs status, inspection, mutation, search, history, assets, and library access. Each tool earns its place without redundancy or bloat.

Completeness5/5

The surface covers the full workflow: inspect the file, find nodes, read tokens, run arbitrary mutations via figma_eval, track changes, snapshot/undo, import from libraries, export files, and place images. figma_eval acts as a well-documented escape hatch for anything not explicitly exposed, so there are no obvious dead ends.