Skip to main content
Glama

component_map

Read-only

Map Figma component instances to existing local code components, enabling reuse instead of regeneration. Matches via fuzzy scan and explicit documentation file.

Instructions

Map the Figma component instances in a selection/subtree to existing local code components, so they can be reused instead of regenerated. Joins the grounded Figma component names (and their variant axes) against an AST scan of the project; an explicit docs/figma-component-map.md row (FigmaName | code/path) overrides the fuzzy match — this file is the durable record a verified mapping is written back to, so the next run reuses it instead of re-guessing. A row whose target no longer resolves (deleted/renamed) is reported in staleOverrides and degrades to the fuzzy result rather than a phantom import. Each distinct component is mapped once with all its instance ids. A mapped candidate also reports matchedProps (Figma axes the component already has) and unmatchedProps (axes it lacks → component-extension TODOs). Returns { mappings (candidate + confidence + status high/medium/low/unmapped), unmapped, staleOverrides, profile }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdNoRoot node id; omit to use the selection or current page
rootDirNoProject root to scan; defaults to the server cwd
thresholdNoConfidence at/above which a match counts as a reliable reuse (default 0.7)
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses rich behavioral details: the join against AST scan, override file mechanism, staleness handling, per-component mapping with instance IDs, and matched/unmatched property reporting. This far exceeds what annotations provide.

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?

The description is informative but somewhat lengthy. It effectively front-loads the purpose and then provides sequential details. While every sentence adds value, it could be slightly more concise without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mapping, AST scan, override file, staleness, output structure), the description covers all necessary aspects. The return object is fully described despite the lack of an output schema, making the tool's behavior transparent and predictable.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds significant context beyond raw parameter descriptions—for example, explaining how threshold determines confidence for reliable reuse, how rootDir defaults to server cwd, and how nodeId selection works. This enriches the agent's understanding.

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

Purpose5/5

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

The description clearly states the verb ('Map') and the resource ('Figma component instances') and explains the action ('to existing local code components'). It distinguishes from siblings by detailing the mapping mechanism and override file, which is unique among sibling tools like scan_components or icon_map.

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?

The description implies the use case ('so they can be reused instead of regenerated') but does not explicitly contrast with sibling tools or provide when-not-to-use guidance. It offers enough context for an agent to infer appropriate usage but lacks explicit exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awdr74100/figwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server