Skip to main content
Glama

swap_component

Destructive

Swap the main component of a Figma instance while preserving position and size. Replace existing components with new ones using node and component IDs.

Instructions

Swap the main component of an existing INSTANCE node, replacing it with a different component while keeping position and size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentIdYesTarget COMPONENT node ID in colon format (from get_local_components)
nodeIdYesINSTANCE node ID in colon format e.g. 4029:12345
Behavior4/5

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

Adds valuable behavioral context beyond annotations: explicitly states 'keeping position and size' (preservation semantics) which is critical for understanding the operation's non-destructive aspects despite destructiveHint=true. Aligns with annotations (destructive mutation confirmed by 'replacing'). Could improve by mentioning override behavior or return values.

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

Conciseness5/5

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

Single sentence, 19 words. Front-loaded action verb ('Swap'). Every clause earns its place: specifies target (INSTANCE node), operation (replacing component), and side-effect (keeping position/size). Zero redundancy or filler.

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?

Adequate for a focused 2-parameter mutation tool. Annotations cover safety profile (destructive/non-readOnly), schema covers inputs completely, and description covers core behavioral nuance. Minor gap: no mention of return values or what happens to component overrides, but sufficient given tool scope.

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 coverage is 100% with detailed parameter descriptions including format hints ('colon format') and cross-references to get_local_components. Description provides conceptual mapping ('INSTANCE node', 'component') but does not add syntax or format details beyond schema. Baseline 3 appropriate given schema carries full load.

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?

Excellent specificity: uses precise verb 'Swap' with clear resource 'main component of an existing INSTANCE node'. Explicitly distinguishes from siblings like 'detach_instance' (which removes component links) by emphasizing 'replacing it with a different component'. Domain terminology (INSTANCE vs COMPONENT) is precise.

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

Usage Guidelines3/5

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

Provides implicit guidance through 'keeping position and size' (suggesting layout-preserving replacement), but lacks explicit when-to-use vs alternatives. Does not mention prerequisites like obtaining component IDs via get_local_components first, or when to prefer detach_instance instead.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vkhanhqui/figma-mcp-go'

If you have feedback or need assistance with the MCP directory API, please join our Discord server