Skip to main content
Glama
Gawasna

figma-antigravity-mcp

by Gawasna

use_figma

Run JavaScript code in Figma's Plugin API sandbox to create, edit, delete, or query design elements on the canvas.

Instructions

Do what: PRIMARY WRITE TOOL. Executes arbitrary JavaScript against the Figma Plugin API sandbox to create, edit, delete, or query any design element. Expected output: Return value of the executed code (JSON-serializable). Mutations are applied live to the Figma canvas. CRITICAL RULES:

  • Parameters: fileKey (required), code (required JS string), description (required human-readable intent).

  • code has access to the global figma object (Figma Plugin API).

  • MUST use await figma.setCurrentPageAsync(page) to switch pages.

  • NEVER use: loadAllPagesAsync, setPluginData, createImageAsync.

  • Font style for Inter: "Semi Bold" (not "SemiBold"), "Extra Bold" (not "ExtraBold").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesJavaScript code to execute. Has access to `figma` global (Figma Plugin API).
fileKeyYesFigma file key. Extract from URL /design/{fileKey}/.
skillNamesNoComma-separated list of Figma skill names being followed, if any.
descriptionYesConcise description of what the code does.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden. It discloses that mutations are applied live to the canvas, that the output is JSON-serializable, and it lists critical constraints: required use of setCurrentPageAsync, forbidden APIs (loadAllPagesAsync, setPluginData, createImageAsync), and specific font-style spelling. This is thorough and goes beyond the schema, which is essential for a tool that executes arbitrary code.

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

Conciseness5/5

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

The description is well-structured with clear sections: 'Do what', 'Expected output', and 'CRITICAL RULES'. The purpose is front-loaded, and every sentence contributes to understanding the tool's behavior or constraints. It is detailed but not verbose, making it easy to parse efficiently.

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

Completeness5/5

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

For a complex tool with arbitrary code execution and no output schema, the description covers expected output format, live mutation behavior, and critical API usage rules. It does not explain error handling or authentication, but those are likely handled by other tools and the schema. The omission of the optional `skillNames` parameter is minor given that the schema documents it. Overall, an agent has enough to call this tool correctly.

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

Parameters5/5

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

The schema already describes all parameters with 100% coverage. The description adds significant value beyond the schema by clarifying the `code` parameter's execution context (access to `figma` global, sandbox constraints) and emphasizing that `fileKey` and `description` are required. It also documents the font-style convention, which is critical for correct code generation but not present in the schema.

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 states 'PRIMARY WRITE TOOL' and explicitly says it 'Executes arbitrary JavaScript against the Figma Plugin API sandbox to create, edit, delete, or query any design element.' This is a specific verb+resource+scope that clearly distinguishes it from sibling tools like figma_auth_login or get_design_context, which are read/auth oriented.

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 explicitly labels itself as the 'PRIMARY WRITE TOOL', making it unambiguous that any mutation to the Figma canvas should go through this tool. While it doesn't name read siblings, the contrast between 'write' and the read-only tools is sufficient to guide selection. It also gives critical usage rules (e.g., must use setCurrentPageAsync) that affect invocation.

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