Create variable
figma_create_variableCreates a Figma variable in a collection with per-mode values or aliases, letting you define colors, numbers, strings, or booleans for design tokens and themes.
Instructions
Creates a variable in a collection with a value per mode, e.g. type COLOR, values {"Light":"#FFFFFF","Dark":"#111111"}, or an alias {"Light":{"alias":"Base/White"}}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collection_id": "<collection_id>",
"name": "<name>",
"type": "<type>",
"values": "<values>"
},
"name": "figma_create_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Figma link (or file key) of the file to edit. Needed only when the plugin is open in more than one file. | |
| name | Yes | Slash-separated groups allowed, e.g. "Background/Primary" | |
| type | Yes | ||
| scopes | No | ||
| values | Yes | Mode name (or id) -> value | |
| code_syntax | No | e.g. {"WEB":"var(--bg-primary)"} | |
| description | No | ||
| collection_id | Yes |