create_variable
Create a new variable within a Figma variable collection, specifying its name and type. After creation, use set_variable_value to assign a value.
Instructions
Create a variable in an existing collection.
No value is set here — use set_variable_value after. Returns {data: {id}}.
Examples: create_variable({collection: "VariableCollectionId:1:2", name: "Theme/bg", type: "COLOR"}) create_variable({collection: "VariableCollectionId:1:2", name: "spacing/md", type: "FLOAT"})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection | Yes | VariableCollectionId to create the variable in | |
| name | Yes | Variable name (slashes denote hierarchy in the Figma UI) | |
| type | Yes | Variable type |