Skip to main content
Glama
figma-mcp-v2

figma-mcp-v2

by LukasAnda

Run Figma Plugin API code

figma_execute
Destructive

Execute JavaScript in the Figma plugin to handle bulk edits, build complex layouts, and read plugin-only data when standard tools cannot cover the task.

Instructions

Runs JavaScript inside the Figma plugin with the full Plugin API, for anything the other tools don't cover (bulk edits, complex layouts, reading plugin-only data). The code is the body of an async function with figma, params and helpers ({getNode, toPaints, parseColor, applyProps, summary}) in scope; return a JSON-serializable value. Load fonts before editing text: await figma.loadFontAsync({family:"Inter",style:"Regular"}). Example: const f = figma.createFrame(); f.layoutMode = "VERTICAL"; f.itemSpacing = 8; return helpers.summary(f);

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "figma_execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoFigma link (or file key) of the file to edit. Needed only when the plugin is open in more than one file.
codeYes
paramsNo
timeout_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, idempotentHint=false, so the safety profile is covered; the description instead adds the execution contract that annotations can't express — code runs as an async function body, `figma`/`params`/`helpers` are in scope, the return value must be JSON-serializable, and fonts must be loaded before text edits. It does not mention what happens on thrown errors or how returned data is surfaced, but beyond the annotation baseline that is a minor omission rather than a gap.

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 purpose and the escape-hatch framing are front-loaded, and the example and font-loading note both earn their space by preventing common failures. It is packed into one dense paragraph rather than broken into scannable clauses, which slightly hurts fast parsing.

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

Completeness3/5

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

For a high-complexity, destructive escape hatch with no output schema and nested `params`, the description covers how to write the code but not what the response envelope looks like, error/timeout behavior, or whether large return values are truncated. There is no output schema to offload that, so an agent is left guessing about the result shape.

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

Parameters3/5

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

Schema coverage is only 25%, so the description is expected to compensate: it explains the semantics of `code` (async function body, helpers available, return convention) and implies `params` via the scope list, while `url` is already documented in the schema. `timeout_ms` is never explained in either place, so the compensation is partial.

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?

States a concrete verb and resource ('Runs JavaScript inside the Figma plugin with the full Plugin API') and explicitly positions itself as the fallback for what the other tools don't cover (bulk edits, complex layouts, plugin-only data). An agent can distinguish it from the many figma_create_/figma_get_ siblings without opening any schema.

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

Usage Guidelines4/5

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

Gives clear selection context — use this when the dedicated tools can't do the job — and lists three concrete example categories. It stops short of an explicit 'prefer figma_create_node / figma_build_layout when they suffice' warning, which matters given this tool is the destructive option.

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