Swap component
figma_swap_componentSwap an existing Figma instance to another component or component set, importing library keys first, optionally choosing a variant, and keeping overrides where Figma allows.
Instructions
Make an existing instance show a different component (a component set swaps to its default variant, or to the variant you name), keeping overrides where Figma can. A library component is given by componentKey / componentSetKey and imported first. To switch a variant of the SAME set, figma_set_instance_properties keeps the other values; to place a new instance use figma_create_instance. Editors: Design; unverified: FigJam, Slides.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The INSTANCE to swap. | |
| session | No | Optional sessionId or file name, to pick a Figma file when more than one is connected. | |
| variant | No | For a set: which variant, e.g. "Size=Large, State=Hover". | |
| componentId | No | The COMPONENT or COMPONENT_SET to show instead. Exactly one of componentId, componentKey, componentSetKey. | |
| componentKey | No | A published library component's key. | |
| idempotencyKey | No | Caller-owned retry key, ≤128 chars. Re-calling with the same key never executes twice: it returns the existing result, or waits for the op still in flight. Supply your own for anything large — if the MCP client times out (rather than the bridge), only a key you chose can be used to retry safely. | |
| componentSetKey | No | A published library component set's key. |