Skip to main content
Glama

Swap component

figma_swap_component
Idempotent

Swap 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

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe INSTANCE to swap.
sessionNoOptional sessionId or file name, to pick a Figma file when more than one is connected.
variantNoFor a set: which variant, e.g. "Size=Large, State=Hover".
componentIdNoThe COMPONENT or COMPONENT_SET to show instead. Exactly one of componentId, componentKey, componentSetKey.
componentKeyNoA published library component's key.
idempotencyKeyNoCaller-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.
componentSetKeyNoA published library component set's key.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare idempotentHint=true and destructiveHint=false, lowering the bar. The description still adds real behavior: overrides are preserved 'where Figma can' (implying partial loss is possible), library components given by key are imported first, and editor support is scoped (Design; unverified FigJam/Slides). It does not state the failure modes when overrides cannot be mapped, which keeps it below a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the operation, then alternatives, then environment constraints; every sentence carries information and none repeats the schema verbatim. It is a single dense paragraph rather than cleanly segmented lines, which is the only reason it is not a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no output schema, it covers purpose, routing, prerequisite import behavior, and platform availability, while annotations cover idempotency and non-destructiveness. The idempotencyKey retry semantics live in the schema. It stops short of describing the result of a swap or partial-override-failure behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3 and the schema already documents nodeId, variant, componentId/componentKey/componentSetKey, and idempotencyKey. The description adds only one genuine nuance beyond the schema — that omitting `variant` yields the set's default variant, and that keyed components are imported first. Useful but marginal against fully documented params.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Precise verb+resource ('make an existing instance show a different component') with the exact mechanism spelled out, including the default-variant behavior for component sets. It explicitly distinguishes itself from figma_set_instance_properties and figma_create_instance by name, so an agent can route without opening a sibling schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use routing: '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.' The alternative and the condition selecting it are both stated, plus the library-import prerequisite for key-based swaps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools