create_variable
Creates a variable in a Figma collection and optionally sets its value. Use slash-separated names for grouping; RGBA colors use 0-1 components.
Instructions
Create a variable in a collection and optionally set its value. Use slashes in the name for grouping (e.g. "color/primary"). Colors use RGBA 0-1.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable name | |
| value | No | Optional initial value: {r,g,b,a?} for COLOR, number for FLOAT, string for STRING, boolean for BOOLEAN, or {aliasOf: variableId} | |
| modeId | No | Optional mode ID for the value (default: collection's default mode) | |
| scopes | No | Optional variable scopes, e.g. ["ALL_FILLS"], ["GAP"], ["CORNER_RADIUS"] | |
| collectionId | Yes | ID of the variable collection | |
| resolvedType | Yes | Variable type |