Skip to main content

search_tokens

Search for design tokens across a tokenset using various criteria.

Tool Schema

{
  "name": "search_tokens",
  "description": "Search for design tokens by name, type, or value",
  "inputSchema": {
    "type": "object",
    "properties": {
      "tokenset_id": {
        "type": "string",
        "description": "ID of the tokenset to search"
      },
      "mode_id": {
        "type": "string",
        "description": "ID of the mode to search (optional)"
      },
      "query": {
        "type": "string",
        "description": "Search query (searches in token names and descriptions)"
      },
      "type": {
        "type": "string",
        "description": "Filter by token type (color, dimension, etc.)"
      }
    },
    "required": ["tokenset_id", "query"]
  }
}

Parameters

ParameterTypeRequiredDescription
tokenset_idstringYesTokenset ID
mode_idstringNoMode ID (searches all modes if not specified)
querystringYesSearch term
typestringNoFilter by token type

Response

{
  "results": [
    {
      "name": "colors.primary.500",
      "type": "color",
      "value": "#3b82f6",
      "mode": "Light",
      "description": "Primary brand color"
    }
  ],
  "total": 1
}

Example Usage

Search by Name

You: Find all tokens with "primary" in the name
Claude: Found 8 tokens with "primary":

**Light Mode**:
- colors.primary.500: #3b82f6
- colors.primary.600: #2563eb
- button.primary.background → colors.primary.500

**Dark Mode**:
- colors.primary.500: #60a5fa
- colors.primary.600: #3b82f6
- button.primary.background → colors.primary.500

Search by Type

You: Show me all color tokens

Search with Description

You: Find tokens related to "brand"
Claude: Found 5 tokens related to "brand":
- colors.primary.500: "Primary brand color"
- colors.secondary.500: "Secondary brand color"
...
You: Find all dimension tokens with "spacing" in the name in the Light mode

See Also