Add Code Connect Mapping
add_code_connect_mapMap a design component to a project code component so get_design_context names the correct code component for every instance; pass an instance, component, or set ID.
Instructions
Map a design component to a code component, so get_design_context names the code component for every instance of it. Pass an instance, component or component set id; a component in a set maps the whole set.
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>",
"componentName": "<componentName>",
"source": "<source>"
},
"name": "add_code_connect_map"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Framework, e.g. Flutter, SwiftUI or React. | |
| nodeId | Yes | The ID of the node, eg. "123:456" or "123-456" (instance ids like "I1:2;3:4" work too). Omit it to use the current selection in Figma. | |
| source | Yes | Path of the code component in the project. | |
| fileKey | No | The key of the Figma file. Accepted for compatibility; the file open in Figma Desktop is always used. | |
| componentName | Yes | Code component name, e.g. AppPrimaryButton. |