set_component_property
Add a Boolean, Text, Instance Swap, or Variant property to a Figma component or component set. Specify default values and link instance swap properties.
Instructions
Add a Component Property (Boolean, Text, Instance Swap, or Variant) to a Component or ComponentSet. For INSTANCE_SWAP: defaultValue must be the component KEY (not node ID), and targetChildId should be the child Instance node whose mainComponent will be linked.
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>",
"propertyName": "<propertyName>",
"propertyType": "<propertyType>"
},
"name": "set_component_property"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | Component or ComponentSet node ID | |
| defaultValue | No | Default value. For INSTANCE_SWAP: use component KEY string (not node ID) | |
| propertyName | Yes | Property name (e.g. 'Show Icon', 'Label', 'icon') | |
| propertyType | Yes | Property type | |
| targetChildId | No | For INSTANCE_SWAP: the child Instance node ID to link. Sets componentPropertyReferences.mainComponent automatically |