figma_bind_variable
Bind a Figma library variable to a node property to make fills, strokes, or spacing update dynamically when design tokens change.
Instructions
Import a library variable by key and bind it to a node property. For colors: binds to fills or strokes via setBoundVariableForPaint. For spacing/sizing: binds via setBoundVariable (paddingLeft, itemSpacing, cornerRadius, etc.). Get variableKey from figma_get_library_variables. The node's fill/spacing will dynamically update when the DS token changes.
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": {
"nodeId": "<nodeId>",
"variableKey": "<variableKey>",
"property": "<property>"
},
"name": "figma_bind_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | Target node ID | |
| fileKey | No | Target a specific connected file. | |
| figmaUrl | No | Figma file URL for routing. | |
| property | Yes | Node property to bind the variable to | |
| paintIndex | No | For fills/strokes: which paint index (default 0) | |
| variableKey | Yes | Variable import key from figma_get_library_variables |