Get Code Connect map
figma_local_get_code_connect_mapMaps Figma component instances to their Code Connect source files and component names, with optional label filtering, so you can trace design nodes to code.
Instructions
Get a mapping of {[nodeId]: {codeConnectSrc, codeConnectName}} for the component instances in a node, e.g. {'1:2': {codeConnectSrc: 'https://github.com/foo/components/Button.tsx', codeConnectName: 'Button'}}. This server reads the code links attached to components as Dev Mode dev resources (Figma's public API does not expose CLI-published Code Connect files). Extract nodeId and fileKey from the URL; do not pass an empty or guessed nodeId.
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": {
"fileKey": "<fileKey>",
"nodeId": "<nodeId>"
},
"name": "figma_local_get_code_connect_map"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the node in the Figma document, eg. "123:456" or "123-456". Extract it from the URL's node-id query parameter. Do not pass an empty or guessed nodeId. | |
| fileKey | Yes | The key of the Figma file to use. If a URL is provided, extract the file key from it: for https://figma.com/design/:fileKey/:fileName?node-id=1-2 the fileKey is `:fileKey`. For https://figma.com/design/:fileKey/branch/:branchKey/:fileName use the branchKey. A full URL is also accepted. | |
| codeConnectLabel | No | Only return links whose name or URL contains this label, e.g. a framework name. |