Skip to main content
Glama

map_reference_to_tokens

Read-onlyIdempotent

Convert captured CSS values into matching design tokens, using your token families and thresholds. Unmatched values become gaps with reasons, so generated code respects your design system.

Instructions

Translate a captured pattern's raw literals (font-size: 64px, color: rgb(247,248,248)) onto the project's own design tokens, so generated code uses the user's type ramp and palette instead of another site's values. Pure and deterministic — no model, no network. Colours compare by RGBA distance (exact at 0, near under 12; alpha counts), lengths normalize to px at root 16 (near under 2px), unitless numbers near within 1%, font families compare on the first family. A property with a known token family (font-size, line-height, gap, radius, …) only ever binds inside that family: if the closest token by value belongs to another ramp, the result is a gap naming it, not a binding. Winners are ordered by distance, then family fit, then shortest and lexicographic token path. Percent and viewport units, unparseable colour syntaxes, shadows, gradients, and other unmatchable classes become gaps with a stated reason — never a forced match. Broken token chains are reported in diagnostics whether or not anything else matched. A project with no tokens is not an error: every property returns as a gap at coverage 0. It does not invent tokens and does not write code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ref_idNoCaptured reference to translate; its styles are the input. Supply this or captured.
tokensNoFlattened design tokens directly, if not reading a DESIGN.md
capturedNoRaw CSS property/value pairs to translate, if not using a stored ref_id
propertiesNoOnly map these CSS properties; omit to attempt every captured property
thresholdsNoOverride the near-match thresholds
design_file_pathNoPath to the project's DESIGN.md; its flattened tokens are the target vocabulary. Supply this or tokens.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv2.5.1

TDQS

A4.6/5.0
Behavior5/5

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

The description goes far beyond annotations, disclosing deterministic behavior, matcher semantics, family-binding constraints, gap handling, diagnostics, coverage, and the fact that it never invents tokens or writes code. It aligns with the readOnly and idempotent hints, with no contradiction.

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?

The description is long but every sentence contributes critical algorithm or outcome information. It is front-loaded with the core map-and-generate purpose, then packs in precise matching rules and edge cases without any redundancy.

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?

The description covers major behavioral aspects: matching rules, gaps, diagnostics, no-token projects, and the guarantee that it does not invent values. However, it does not specify the concrete return shape (e.g., property-to-token/gap record), which would be valuable since no output schema exists.

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%, but the description adds value beyond the schema by explaining how thresholds are used (RGBA 0 exactly, near under 12, length under 2px, unitless within 1%, root 16) and the token-family restriction. It does not map to every parameter individually, but the overall semantics enrich the schema 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 states the exact verb 'translate', the resource ('a captured pattern's raw literals'), and the target outcome ('onto the project's own design tokens'), with concrete examples. It clearly distinguishes this tool from the many reference-capture and design-system reading siblings.

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 gives clear context for when to use the tool: when you have a captured pattern's raw values and want generated code to use the project's own tokens. However, it does not explicitly name alternatives or say 'do not use this when ...', leaving room for an agent to infer the boundaries.

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/rhinocap/raven-mcp'

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