Skip to main content
Glama

Find the token for a hard-coded value

find_token_for_value
Read-onlyIdempotent

Retrieve design tokens for a hard-coded color or dimension: exact semantic matches first, then nearest perceptual ones, to replace literals with tokens.

Instructions

Given a hard-coded value (#1a73e8, rgb(...), 16px, 1rem), return the tokens that carry it: exact matches first (semantic before primitive), then the perceptually nearest colors or nearest dimensions. Use it whenever code or a design contains a literal value, to replace it with a token.

Input Schema

NameRequiredDescriptionDefault
modeNoColor mode, for example light or dark
typeNoInferred from the value when omitted
brandNoBrand name, for example aurora or nord
limitNo
valueYesA hard-coded value, for example #1a73e8, rgb(26 115 232), 16px or 1rem
propertyNoCSS property where the value is used (padding, color, border-radius...). Ranks tokens by intent

Output Schema

NameRequiredDescriptionDefault
typeYes
exactYes
valueYes
nearestYes
normalizedYesCanonical form of the input used for comparison
recommendationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish the read-only, idempotent, closed-world safety profile, and the description adds real behavioral detail beyond them: the result ordering (exact → semantic → primitive) and the fuzzy fallback to perceptually nearest colors or dimensions. It never states implied limits on the fallback (e.g. how distant a match can be) or whether approximate results are flagged.

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 sentences, zero waste, with the matching strategy front-loaded ahead of the usage cue. The parenthetical format examples mildly duplicate the schema's value description but are defensible as quick-scannable input hints.

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?

An output schema exists, so return shape needn't be explained, and the description covers the input formats and result ranking that matter for correct invocation. Gaps remain around how brand/mode/property constrain matching and how the limit interacts with the fuzzy fallback tier.

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

Parameters3/5

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

Schema coverage is 83%, so the schema already documents mode, type, brand, property and limit. The description only reinforces the value formats, which are also examples in the schema, and its ranking language hints at property-as-intent without making that explicit. It adds little beyond the baseline for the five optional parameters.

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+resource pair: given a hard-coded literal, return the tokens carrying it, with an explicit match strategy (exact first, semantic before primitive, then nearest). Input formats are enumerated. It doesn't name sibling tools like search_tokens or resolve_token, so an agent must infer the boundary itself.

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?

"Use it whenever code or a design contains a literal value, to replace it with a token" gives a clear activating condition. There are no exclusions and no named alternatives, so it stops short of the when/when-not/alternative guidance that would earn a 5.

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