Skip to main content
Glama

Add Code Connect Mapping

add_code_connect_map
Idempotent

Map a Figma design component or set to a code component so get_design_context identifies the matching code name for every instance.

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.

Input Schema

NameRequiredDescriptionDefault
labelNoFramework, e.g. Flutter 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. First observedv1.5.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare idempotent=true, destructive=false, and closed-world, so the safety profile is covered. The description adds a genuinely non-obvious behavioral trait beyond that: mapping a component inside a set maps the whole set. It doesn't disclose overwrite/conflict behavior, but given annotations carry the safety burden, this addition earns above baseline.

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 tight sentences, front-loaded with the action and its effect, followed by the ID guidance. No filler; every clause informs invocation.

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?

No output schema exists, so the description needn't explain returns. For a mutation tool it covers the effect and the ID semantics well, leaving only edge behavior (overwriting an existing mapping, conflict handling) unspecified, which is a minor gap.

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. The description nevertheless adds meaning the schema lacks: it clarifies that nodeId accepts instance, component, or component-set IDs and that a component within a set maps the entire set, which is not stated in the schema's nodeId description.

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 (map) with both resources (design component -> code component) and the downstream effect (get_design_context names the code component). It is clearly the 'add' counterpart to the sibling get_code_connect_map/remove_code_connect_map, though it never names them explicitly, so an agent infers the distinction rather than being told it.

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?

The clause 'Pass an instance, component or component set id' gives usage context on what to supply, and the effect clause implies why you'd use it. But there is no explicit when-to-use vs the sibling get_code_connect_map or remove_code_connect_map, and no stated preconditions. Usage is implied, not spelled out.

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