Skip to main content
Glama

apply_theme_tokens

Map theme token definitions to components by generating CSS custom property overrides. Produces per-component CSS blocks and a global :root block for applying your theme tokens to specific components.

Instructions

Map a theme token definition to specific components, showing how to apply it with correct CSS custom property overrides. Accepts a map of CSS variable names to values, then generates per-component CSS blocks and a global :root block. Use this after create_theme to wire your theme tokens to individual component CSS properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
themeTokensYesMap of CSS custom property names to their values. E.g. { "--hx-color-primary": "#0066cc", "--hx-spacing-md": "1rem" }. Property names that match component CSS properties generate per-component CSS blocks.
tagNamesNoOptional list of component tag names to filter results. When omitted, all components with CSS properties are included.
libraryIdNoOptional multi-library dispatch hint. When set, src/mcp/index.ts uses it to pick the correct CEM before invoking this tool.
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses that the tool accepts a map of CSS variable names to values and generates per-component and global CSS blocks. It does not mention side effects, preconditions (e.g., library loaded), or permissions, but the non-destructive nature is implied. Slightly more detail on preconditions would improve transparency.

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 consists of two efficient sentences with no fluff. Every sentence earns its place: first defines the core operation, second gives usage guidance. Well-structured and front-loaded.

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?

Given no output schema, the description could mention the return format (e.g., what the generated output looks like). It says 'generates per-component CSS blocks' but doesn't specify if the return is a string, object, or something else. However, for a mapping tool with good sibling context, it covers most needs. Slightly incomplete on return type.

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 100%, and the schema already provides detailed descriptions for all three parameters (themeTokens with example, tagNames, libraryId). The description does not add significant meaning beyond the schema, so baseline 3 is appropriate.

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 purpose: 'Map a theme token definition to specific components...generates per-component CSS blocks and a global :root block.' It uses a specific verb (map, generate) and resources (theme token definition, components) and distinguishes from sibling 'create_theme' by indicating it is used after that.

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

Usage Guidelines5/5

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

Explicit guidance: 'Use this after create_theme to wire your theme tokens to individual component CSS properties.' This tells the agent when to use the tool and in what sequence relative to a sibling tool, providing clear usage context.

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