Skip to main content
Glama

token_map

Read-only

Map Figma variables to project design tokens, preventing hard-coded values and enabling code to reference existing tokens.

Instructions

Map the document's Figma variables to the project's design tokens, so generated code references existing tokens instead of hard-coded values. Joins the grounded Figma variable names + values against tokens parsed from the project CSS (Tailwind v4 @theme or :root custom properties); the match is name-based with an exact color value-match as confirmation. On a Tailwind project a variable that hits a framework built-in scale (spacing/N, line-height/N, weight/*) is reported as status 'framework-builtin' with { builtin: { scale, step } } rather than unmapped — it has no @theme token but the utility (p-4 / gap-4, leading-7, font-bold) is still usable. tokenSource overrides the detected styling config; rootDir defaults to the server cwd. Tailwind v3 JS configs are not yet parsed (pass tokenSource to a CSS file). Returns { mappings (candidate + confidence + status + matchedBy + builtin), unmapped, tokenSource, profile }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootDirNoProject root; defaults to the server cwd
thresholdNoConfidence at/above which a match counts as reliable (default 0.7)
tokenSourceNoPath (relative to rootDir) to a CSS file holding the tokens; overrides detection
Behavior5/5

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

Annotations indicate readOnlyHint=true, and the description confirms a non-destructive mapping operation that returns results. It details the matching logic, reporting of built-in framework scales, and output structure. No contradictions with annotations.

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 a single paragraph that packs essential information efficiently. While it could benefit from bullet points for readability, it is concise and front-loads the primary purpose. No redundant sentences.

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 three optional parameters and no output schema, the description fully covers the return format ({ mappings, unmapped, tokenSource, profile }) and edge cases like framework-builtin matches. It provides enough context for an agent to use the tool correctly without additional documentation.

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?

All three parameters are described in the schema (100% coverage). The description adds value by specifying defaults (rootDir defaults to server cwd, threshold default 0.7) and clarifying the tokenSource parameter's relative path behavior, going beyond the schema's descriptions.

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 it maps Figma variables to project design tokens for code generation. It distinguishes from sibling tools like component_map and icon_map by specifying its unique function. It provides specific details about the matching process (name-based with color confirmation) and mentions limitations (Tailwind v3 not parsed).

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 when to use the tool (to generate code with existing tokens) and includes constraints (e.g., Tailwind v3 JS configs not parsed, so tokenSource must point to a CSS file). It does not explicitly exclude alternative tools but the purpose is distinct enough to avoid confusion.

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