set_variable_value
Set Figma variable values per mode: supply a value matching the variable type (boolean, number, string, color, or alias) and get confirmation.
Instructions
Set a variable's value for one mode (modeId comes from the variable's collection). value must match the variable resolvedType: a boolean, a number (FLOAT), a string, a color { r, g, b, a } (0–1), or an alias { type: "VARIABLE_ALIAS", id } pointing at another variable. EASING and TIMING variables are read-only to plugins — Figma rejects editing them, so read them with get_variable_defs and change them in the Figma UI instead. Create the variable first with create_variable. Returns { ok, variableId, name }.
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": {
"variableId": "<variableId>",
"modeId": "<modeId>",
"value": "<value>"
},
"name": "set_variable_value"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | boolean | number | string | { r,g,b,a } | { type:"VARIABLE_ALIAS", id } | { type: easing } | |
| modeId | Yes | Mode id (from the collection) | |
| variableId | Yes | Variable id |