figma_instantiate_component
Create a component instance in Figma from a local or published library key, then set variants, position, parent, and overrides for design work.
Instructions
Create an instance of a component from the design system — works with BOTH local and published library components.
For local components: Pass BOTH componentKey AND nodeId together. Most local/unpublished components require nodeId. For library components: Pass just the componentKey from figma_get_library_components or figma_search_components (with libraryFileKey). The component will be imported from the published library automatically.
CRITICAL: Use VARIANT keys, not COMPONENT_SET keys! When importing from a published library, use the key of a specific variant (type: "COMPONENT"), NOT the parent component set key (type: "COMPONENT_SET"). Component set keys will fail with importComponentByKeyAsync. In figma_get_library_components results, look inside the "variants" array for individual variant keys.
Font loading: Library components may use fonts not loaded in the current file. If instantiation fails with a font error, load the required fonts first via figma_execute before retrying (e.g., await figma.loadFontAsync({ family: "Geist", style: "Regular" })).
IMPORTANT: Always re-search before instantiating! NodeIds are session-specific and may be stale from previous conversations. ALWAYS search for components at the start of each design session to get current, valid identifiers.
VISUAL VALIDATION WORKFLOW: After instantiating components, use figma_take_screenshot to verify the result looks correct. Check placement, sizing, and visual balance.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "figma_instantiate_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | No | The node ID from search results. ALWAYS pass this alongside componentKey - most local components need it. | |
| variant | No | Variant properties to set (e.g., { Type: 'Simple', State: 'Active' }) | |
| parentId | No | Parent node ID to append the instance to | |
| position | No | Position on canvas (default: 0, 0) | |
| overrides | No | Property overrides (e.g., { 'Button Label': 'Click Me' }) | |
| componentKey | No | The component key from search results. Pass this WITH nodeId for automatic fallback. |