Create variable
figma_create_variableCreates one Figma design variable (token) in a collection with name, type, value, scopes, and code syntax; duplicate names are refused.
Instructions
One design token. value is a string for every type: "#1a2b3c" for COLOR, "16" for FLOAT, text for STRING, "true"/"false" for BOOLEAN, or "alias:" of the same type. Set scopes (which pickers offer it; [] for a primitive only aliased) and a WEB codeSyntax on every token. A name the collection already has is refused. For a whole token set in one call use figma_create_variables. Bind one to nodes with figma_bind_variable_to_node; extra modes (figma_add_variable_mode) need a paid plan. Editors: Design; unverified: FigJam, Slides.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| type | Yes | ||
| value | Yes | The value for the declared type: "#1a2b3c" for COLOR, "16" for FLOAT, "Inter" for STRING, "true" for BOOLEAN. | |
| modeId | No | Mode id or name. Defaults to the collection's first mode. | |
| scopes | No | Which property pickers offer it. [] hides a primitive that is only aliased; semantic tokens name their fields, e.g. ["FRAME_FILL","SHAPE_FILL"] or ["GAP"]. Checked against the type; ALL_SCOPES stands alone. Default (omitted): Figma's ALL_SCOPES. | |
| session | No | Optional sessionId or file name, to pick a Figma file when more than one is connected. | |
| codeSyntax | No | The name in code per platform, e.g. { "WEB": "var(--color-bg-brand)" }. "" removes that platform. | |
| description | No | ||
| collectionId | Yes | ||
| 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. | |
| hiddenFromPublishing | No | Hide it when the file is published as a library. |