Skip to main content
Glama
TranHoaiHung

figma-ui-mcp

by TranHoaiHung

figma_write

Create or modify Figma designs programmatically with JavaScript code. Supports design operations, variables, styles, components, and prototyping transitions.

Instructions

Execute JavaScript code to CREATE or MODIFY designs in Figma. ⚠️ MANDATORY: Call figma_docs BEFORE writing any design code. Skipping figma_docs causes hardcoded colors, wrong sizing, broken layouts, and low-quality UI. Use the figma proxy object — all methods return Promises, use async/await. Operations: create, modify, delete, clone, group, ungroup, flatten, resize, set_selection, set_viewport, batch (multiple ops in one call). Design Tokens: createVariableCollection, createVariable, setVariableValue, addVariableMode, renameVariableMode, removeVariableMode, applyVariable, setFrameVariableMode, clearFrameVariableMode, createPaintStyle, createTextStyle, createComponent. Prototyping: setReactions, getReactions, removeReactions (click/hover/press → navigate/overlay/swap with Smart Animate transitions). Scroll: setScrollBehavior (overflowDirection: NONE/HORIZONTAL/VERTICAL/BOTH). Variants: setComponentProperties, swapComponent, getComponentProperties. Component property definitions (master-side, required for instance text overrides to recalc auto-layout): addComponentProperty (TEXT/BOOLEAN/INSTANCE_SWAP), bindComponentPropertyToText, removeComponentProperty. The code runs in a sandboxed VM: no access to require, process, fs, fetch, or network.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesJavaScript using figma.create(), figma.modify(), figma.setPage(), etc.
sessionIdNoTarget a specific Figma file/tab when multiple are connected. Omit to auto-select.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It details sandbox restrictions (no require, process, fs, fetch, network), async/await usage, and a wide range of supported operations (create, modify, delete, etc.). However, it does not explicitly state that the tool modifies files (though implied), nor does it mention authentication or rate limits, but the transparency is high.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is lengthy but well-structured with sections (operations, design tokens, prototyping, etc.) and bullet points. The most critical information (purpose and mandatory figma_docs call) is front-loaded. Every sentence adds value, though it could be slightly more concise without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity and the absence of an output schema, the description provides extensive context about capabilities, sandboxing, and prerequisites. It covers a wide range of operations. However, it does not explain return values or error handling, but for a mutation tool with no output schema, the description is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds valuable context beyond the schema, such as explaining the use of the 'figma' proxy object, async/await, and the mandatory figma_docs call. This helps agents understand how to use the parameters effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute JavaScript code to CREATE or MODIFY designs in Figma,' providing a specific verb and resource. It distinguishes itself from sibling tools (figma_docs, figma_read, etc.) by emphasizing that this tool performs write operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes an explicit mandatory instruction: 'Call figma_docs BEFORE writing any design code' and explains consequences of skipping that step. This provides clear when-to-use and when-not-to-use guidance, and implies that figma_docs is a prerequisite.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/TranHoaiHung/figma-ui-mcp'

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