Skip to main content
Glama

Add Code Connect Mapping

add_code_connect_map
Idempotent

Map 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

NameRequiredDescriptionDefault
labelNoFramework, e.g. Flutter, SwiftUI or React.
nodeIdYesThe 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.
sourceYesPath of the code component in the project.
fileKeyNoThe key of the Figma file. Accepted for compatibility; the file open in Figma Desktop is always used.
componentNameYesCode component name, e.g. AppPrimaryButton.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.8.1
    • changedInput schema / properties / label / description
      Previous value: -"Framework, e.g. Flutter or React."New value: +"Framework, e.g. Flutter, SwiftUI or React."
  2. First observedv1.5.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, idempotent, non-destructive local write. The description adds real behavioral information beyond them: the mapping changes what get_design_context returns for every instance, and mapping a set component fans out to the whole set — a scope side effect an agent could not infer from the annotations.

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?

Two sentences, zero filler, with the outcome-driving effect stated first and the node-id caveat second. Nothing could be removed without losing information.

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?

For a local, idempotent write with 100% schema coverage and no output schema, the description covers purpose, node targeting, and mutation scope. It does not address overwrite/conflict behavior when a mapping already exists for that node, which is the one thing an agent might still wonder about.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning about nodeId semantics — that instances, components, and component sets are all accepted and that set components propagate to the whole set. It says nothing about source, componentName, or label, but those are already well documented in the schema.

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?

The description gives a specific verb and resource ('Map a design component to a code component') plus the downstream effect on get_design_context, which lets an agent distinguish this from get_code_connect_map and remove_code_connect_map by their names alone. It stops short of explicitly naming the sibling operations, but the purpose is unambiguous.

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

Usage Guidelines4/5

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

It states what to pass ('Pass an instance, component or component set id') and clarifies the escalation rule that mapping a component inside a set maps the entire set. It gives no exclusions or prerequisites (e.g., when to prefer use_figma or import_design_export instead), so it is clear context rather than full when/when-not guidance.

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