evaluate_token

Evaluate a safe WebDesignHot v0.2 color reference or expression.

Evaluate one color expression against a design’s default palette. This is a restricted resolver, not JavaScript: arbitrary functions and code execution are rejected, and reference/expression depth is bounded.

Input schema

{
  "slug": "linear",
  "expression": "darken(brand, 10%)"
}

Supported forms include token references such as {colors.brand}, CSS colors, color-mix(in srgb, ...), and the v0.2 functions darken, lighten, mix, alpha, auto-contrast, and shift-hue.

Output

{
  "slug": "linear",
  "expression": "darken(brand, 10%)",
  "value": "#555fbd"
}

Undefined references, cycles, invalid colors, and unsupported functions return an MCP tool error rather than an untrusted evaluation result.