Skip to main content
Glama

Get Code Connect map

figma_local_get_code_connect_map
Read-only

Maps 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

NameRequiredDescriptionDefault
nodeIdYesThe 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.
fileKeyYesThe 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.
codeConnectLabelNoOnly return links whose name or URL contains this label, e.g. a framework name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, but the description adds a genuinely important data-source limitation: links come from Dev Mode dev resources, and CLI-published Code Connect files are not exposed by the public API. That tells the agent why results may be missing entries, which annotations do not convey.

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 return shape and example, which is the highest-value information, and the data-source caveat follows logically. The closing "Extract nodeId and fileKey from the URL; do not pass an empty or guessed nodeId" duplicates the schema text and is the one expendable sentence.

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?

There is no output schema, but the description compensates by spelling out the returned object shape and a concrete example. It also covers the data-source caveat and input-validation constraint; the only omission is behavior when no Code Connect links exist (presumably an empty map).

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%, so all three parameters are already documented in the schema, including the URL-extraction rules for nodeId and fileKey. The description adds only the map-key semantics (nodeId as key) and repeats the "do not pass an empty or guessed nodeId" advice verbatim, so it does not meaningfully exceed the schema baseline.

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

Purpose4/5

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

States a specific verb and resource ("Get a mapping of {[nodeId]: {codeConnectSrc, codeConnectName}} for the component instances in a node") and even shows the exact return shape with a concrete example. It does not name a sibling alternative, so an agent must infer that get_design_context or get_metadata are different, keeping it out of the top band.

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?

Usage is implied rather than stated: the caveat that the server reads Dev Mode dev resources and not CLI-published Code Connect files hints at when results will be incomplete, and "Extract nodeId and fileKey from the URL" gives a prerequisite. There is no explicit when-to-use/when-not versus get_design_context or get_metadata.

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