create_variable
Create a design token variable (COLOR, FLOAT, STRING, or BOOLEAN) inside a Figma collection and assign optional mode values to organize reusable design values.
Instructions
Create a design token variable (COLOR, FLOAT, STRING, BOOLEAN) inside a collection with optional mode values.
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": {
"collectionId": "<collectionId>",
"name": "<name>",
"resolvedType": "<resolvedType>"
},
"name": "create_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable name e.g. color/bg/primary | |
| channel | No | Optional Figma document channel, fileKey, or documentName when multiple Figma files are open | |
| collectionId | Yes | Target variable collection ID | |
| resolvedType | Yes | ||
| valuesByMode | No | Map of modeId or modeName to value (hex string for COLOR, or { aliasVariableId }) |