Skip to main content
Glama

check_token_fallbacks

Validates CSS for complete var() fallback chains and detects hardcoded colors that prevent theme switching.

Instructions

Validates consumer CSS for proper var() fallback chains and detects hardcoded colors that break theme switching. Catches var() calls without fallback values (fragile if token undefined), hardcoded hex/rgb/hsl/named colors on color properties (breaks dark mode), and named CSS colors used directly instead of tokens. Run this on any CSS that references design tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
libraryIdNoOptional library ID to target a specific loaded library instead of the default.
cssTextYesThe CSS code to validate for token fallback usage.
tagNameYesThe custom element tag name to validate against (e.g. "sl-button").
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It describes validation and detection of issues, implying a read-only analysis, but does not specify output format, side effects, or whether modifications occur.

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 concise with three sentences: purpose, specific detections, and usage context. It is front-loaded and contains no unnecessary words or redundancies.

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

Completeness2/5

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

Given the lack of output schema and the tool's analytical nature, the description should explain what the validation result looks like (e.g., warnings list, pass/fail). It also omits that tagName and cssText are required, which is important for agent usage.

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 description coverage is 100%, so baseline is 3. The description adds context about the tool's validation purpose but does not elaborate on parameter meanings beyond the schema. No new parameter semantics are provided.

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?

The description clearly states the tool validates CSS for var() fallback chains and detects hardcoded colors that break theme switching, with specific examples. However, it does not explicitly differentiate from sibling tools like check_css_vars or check_dark_mode_patterns, which could overlap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description advises to run on any CSS referencing design tokens, providing a clear context. But it lacks explicit when-not-to-use instructions or comparisons to alternatives, leaving some ambiguity among the many sibling tools.

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/bookedsolidtech/helixir'

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