Create variables
figma_create_variablesCreate a full variable token set in one call: primitives first, then semantic aliases with per-mode values, scopes, and code syntax. Everything is validated before any write.
Instructions
A token set in ONE call (one undo step): primitives first, then semantic tokens that alias them, each with a value per mode, scopes and code syntax. Values are strings: "#1a2b3c" / "#1a2b3c80", "16", text, "true", or "alias:" — the target must exist already or come EARLIER in this call, with the same type. Everything is checked before the first variable exists, so a refusal creates nothing. ifExists decides what a name the collection already has does: "error" (default), "skip" (keep it; aliases resolve to it), or "update" (set the given values and properties). Up to 200 per call, paced so Figma stays responsive. For one variable figma_create_variable is enough; to change properties later use figma_set_variable_properties. Editors: Design; unverified: FigJam, Slides.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | No | Optional sessionId or file name, to pick a Figma file when more than one is connected. | |
| ifExists | No | Default "error". | |
| variables | Yes | ||
| collectionId | Yes | The collection, from figma_get_variable_defs or figma_create_variable_collection. | |
| idempotencyKey | No | Caller-owned retry key, ≤128 chars. Re-calling with the same key never executes twice: it returns the existing result, or waits for the op still in flight. Supply your own for anything large — if the MCP client times out (rather than the bridge), only a key you chose can be used to retry safely. |