get_tokens_by_mode
Retrieves all design tokens from a specific mode within a tokenset, with the ability to find modes by name rather than ID. This is especially useful when you know the mode name (like “Light”, “Dark”) but don’t have the mode ID.Tool Schema
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenset_id | string | Yes | The ID of the tokenset to get tokens from |
mode_name | string | No | Mode name to search for (case-insensitive). If not provided, uses the default mode |
Response
Example Usage in Claude
Get Default Mode Tokens
Get Specific Mode by Name
Compare Light and Dark
Handle Missing Mode
Common Use Cases
1. Theme Comparison
2. Mode-Specific Values
3. Default Mode Tokens
4. Named Mode Access
Mode Name Matching
- Case-insensitive: “Light”, “light”, “LIGHT” all work
- Partial matching: Will find the first mode containing the search term
- Default fallback: If no mode_name provided, uses the default mode
- Error handling: Shows available modes if the requested mode doesn’t exist
Notes
- This tool is perfect when you know mode names but not IDs
- Useful for theme comparisons and mode-specific token access
- Returns resolved values (aliases are resolved to their actual values)
- Includes token descriptions and types for context
Tips
- Mode Names: Common names are “Light”, “Dark”, “High Contrast”
- Default Mode: Omit mode_name to get the default mode tokens
- Case Insensitive: “dark”, “Dark”, “DARK” all work the same
- Comparison: Great for seeing how tokens change across themes
See Also
- list_tokens_by_mode - List tokens by mode ID
- list_modes - Find available modes and their IDs
- search_tokens - Search tokens across modes
- find_tokens_by_type - Find tokens by type