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
figmaobject (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
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript code to execute. Has access to `figma` global (Figma Plugin API). | |
| fileKey | Yes | Figma file key. Extract from URL /design/{fileKey}/. | |
| skillNames | No | Comma-separated list of Figma skill names being followed, if any. | |
| description | Yes | Concise description of what the code does. |