validate_class_string
Validate Tailwind CSS class strings against your project's actual config to catch hallucinated design tokens before writing code. Returns valid, invalid, and uncertain classes with conflict warnings.
Instructions
Validates a Tailwind CSS className string against the project's actual config. Returns valid_classes, invalid_classes (hallucinated tokens), possibly_valid_classes (plugin-generated — cannot verify without PostCSS), and conflict warnings. Handles variants (hover:, dark:, lg:), important (!), opacity modifiers (/50), negative values (-mt-4), and arbitrary values ([32rem]). Use to catch hallucinated design tokens before writing code.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"config_path": "<config_path>",
"class_string": "<class_string>"
},
"name": "validate_class_string"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config_path | Yes | Absolute path to tailwind.config.js or tailwind.config.ts | |
| class_string | Yes | Space-separated Tailwind class string to validate |