Skip to main content
Glama

icon_map

Read-only

Map Figma icon nodes to existing SVG files in your project, reusing designer-curated assets and preventing duplicate exports. Reports color contracts and import hints for each match.

Instructions

Map the Figma icon nodes in a selection/subtree to the project's existing .svg files, so codegen reuses the designer-curated asset instead of re-exporting a duplicate. Joins the grounded Figma icon names against the repo svg files (gitignore-aware scan), name-based and near-exact (a wrong icon is a silent visual bug, so unsure matches fall through to a fresh export rather than mis-reuse). Each match reports the file path, the color contract read from the file (currentColor / fixed / multi-color), and how to recolor it in this project (currentColor → text-{token}, gated on the svg mode since currentColor dies through an ). It does not fabricate the import line — compose it from the file path and profile.svg (importHint gives the loader form: svgr ?react / vite-svg-loader ?component / { ReactComponent } / url <img>), mirroring the project's existing imports for the alias/relative path. Unmatched icons are returned in unmapped; iconLibraries lists any installed icon component library (lucide / heroicons / iconify) as the alternative to a fresh export. rootDir defaults to the server cwd. Returns { mappings, unmapped, iconLibraries, 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)
Behavior4/5

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

Annotations declare readOnlyHint=true, and the description details a non-modifying operation (mapping and returning matches). It adds transparency on specifics like color contract analysis and that import lines are not fabricated, which aligns with the read-only nature.

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 relatively long but front-loaded with the primary purpose. Each sentence contributes meaningful detail (e.g., color contract, import hint, fallback logic). It could be slightly more concise but is still well-structured for a complex tool.

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?

Despite lacking an output schema, the description thoroughly explains the return structure (`{ mappings, unmapped, iconLibraries, profile }`) and the content of each field. It covers parameters, behavior, and output, making it self-contained for a tool of this complexity.

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% with parameter descriptions. The description adds extra context: `nodeId` can be omitted to use selection/page, `rootDir` defaults to server cwd, and `threshold` default 0.7. This goes beyond the schema by clarifying defaults and behavior.

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 tool's action ('Map'), the resource ('Figma icon nodes to SVG files'), and the purpose ('so codegen reuses the designer-curated asset'). This distinguishes it from siblings like `token_map` or `component_map` by specifically focusing on icons and SVG assets.

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 explains the use case (reusing assets for codegen) and the fallback behavior (unsure matches fall through to fresh export). However, it does not explicitly mention when not to use this tool or compare it to alternatives like `token_map`, leaving some ambiguity.

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