Get Tokens by Mode
Get all tokens from a specific mode in a tokenset. This flexible tool can find modes by name or use the default mode, making it easy to access tokens from any mode without needing to know mode IDs.Description
This helper tool provides flexible access to tokens from any mode in a tokenset. You can specify a mode by name (e.g., “Light”, “Dark”, “Mobile”) or let it automatically use the default mode. Perfect for getting tokens from specific themes or contexts.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenset_id | string | Yes | The ID of the tokenset |
mode_name | string | No | Optional mode name to search for (e.g., ‘Light’, ‘Dark’). If not provided, uses the default mode |
Response
Returns all tokens from the specified mode with:mode: Mode information (id, name, is_default)tokens: Array of tokens with simplified informationtotal: Total number of tokens
Example Usage
Get tokens from a specific mode
Get tokens from default mode
Example Response
Error Response
If the mode is not found, the tool returns available modes:Use Cases
- Theme-specific tokens: Get tokens from Light, Dark, or any theme
- Context-specific tokens: Get tokens from Mobile, Desktop, or other contexts
- Default mode access: Get tokens from the default mode without specifying name
- Mode exploration: Discover available modes and their tokens
- Token comparison: Compare tokens between different modes
Mode Selection Logic
The tool uses this priority for mode selection:- Exact name match: If
mode_nameprovided, finds exact match (case insensitive) - Default mode: If no
mode_nameprovided, uses the mode withis_default: true - First mode: If no default mode, uses the first available mode
Related Tools
list_resources- Get tokenset IDs and available modessearch_tokens- Search for specific tokens across modesexport_mode- Export tokens from a specific modecreate_token- Create new tokens in specific modes
Workflow Example
Best Practices
- Use descriptive mode names: Be specific with mode names for clarity
- Check available modes: Use error response to see available modes
- Use default mode: Omit
mode_nameto get default mode tokens - Copy exact IDs: Use the exact token and mode IDs from results
Error Prevention
This tool helps prevent common errors:- ❌ Using invalid mode IDs
- ❌ Guessing mode names
- ❌ Using wrong mode for tokens
- ✅ Finding modes by name
- ✅ Getting tokens from the correct mode
- ✅ Discovering available modes when errors occur
Common Mode Names
- Light: Light theme mode
- Dark: Dark theme mode
- Mobile: Mobile-specific tokens
- Desktop: Desktop-specific tokens
- Brand: Brand-specific tokens
- Default: Default mode (usually Light)