create_variable
Create a new design token variable in a Figma collection. Specify name, type (COLOR, FLOAT, STRING, BOOLEAN), and optional initial value.
Instructions
Create a new variable (design token) inside an existing collection. Returns the new variable's ID. Use get_variable_defs to find collection IDs, set_variable_value to set values per mode, and bind_variable_to_node to apply the variable to a node property.
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": {
"name": "<name>",
"collectionId": "<collectionId>",
"type": "<type>"
},
"name": "create_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable name — use slash notation to group e.g. 'Color/Primary', 'Spacing/MD' | |
| type | Yes | Variable type: COLOR (hex color), FLOAT (numeric dimension/spacing), STRING (text), or BOOLEAN (true/false toggle) | |
| value | No | Initial value for the first mode. COLOR: hex e.g. #FF5733. FLOAT: number e.g. 16. STRING: text. BOOLEAN: true or false. | |
| collectionId | Yes | ID of the variable collection to add this variable to (from get_variable_defs) |