figma_create_variable
Create one Figma variable with a name, collection ID, type (COLOR, FLOAT, STRING, BOOLEAN), and optional mode values; use it for single design-token setup and batch creation for multiple variables.
Instructions
Create a single Figma variable. For multiple variables, use figma_batch_create_variables instead (10-50x faster). Use figma_get_variables first to get collection IDs. Supports COLOR, FLOAT, STRING, BOOLEAN. Requires Canvas Bridge plugin.
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>",
"resolvedType": "<resolvedType>"
},
"name": "figma_create_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name for the new variable (e.g., 'primary-blue') | |
| description | No | Optional description for the variable | |
| collectionId | Yes | The collection ID to create the variable in (e.g., 'VariableCollectionId:123:456'). Get this from figma_get_variables. | |
| resolvedType | Yes | The variable type: COLOR, FLOAT, STRING, or BOOLEAN | |
| valuesByMode | No | Optional initial values by mode ID. Example: { '1:0': '#FF0000', '1:1': '#0000FF' } |