get_variable_defs
Extract design tokens from a Figma node to get variable names and resolved values for colors, spacing, and typography before writing code.
Instructions
Do what: Returns all design variables (tokens) referenced by a node — colors, spacing, typography values with their names and resolved values. Expected output: Map of variable names to resolved values e.g. { "p1-orange": "#ED9E4A" }. Use to extract the design system token palette before writing code or creating new nodes.
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": {
"fileKey": "<fileKey>",
"nodeId": "<nodeId>"
},
"name": "get_variable_defs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | Target node ID e.g. "4:85". | |
| fileKey | Yes | Figma file key. Only /design/ URLs are supported. |