> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokencraft.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Find Tokens by Type

> Find all tokens of a specific type across all workspaces, tokensets, and modes. No workspace ID needed!

# Find Tokens by Type

Find all tokens of a specific type across all your workspaces, tokensets, and modes. This tool is perfect for discovering all tokens of a particular type without needing to know workspace IDs.

## Description

This helper tool searches for tokens by type across your entire Tokencraft account. It automatically discovers all workspaces and searches through all tokensets and modes to find tokens of the specified type. No workspace ID required!

## Parameters

| Parameter | Type   | Required | Description                                                 |
| --------- | ------ | -------- | ----------------------------------------------------------- |
| `type`    | string | Yes      | Token type to search for (color, dimension, fontSize, etc.) |

## Response

Returns all tokens of the specified type with:

* `token_type`: The type searched for
* `results`: Array of workspaces and tokensets containing matching tokens
* `total_found`: Total number of matching tokens
* `usage`: Instructions on how to use the returned IDs

## Example Usage

```bash theme={null}
# Find all dimension tokens
find_tokens_by_type(type: "dimension")

# Find all color tokens
find_tokens_by_type(type: "color")

# Find all fontSize tokens
find_tokens_by_type(type: "fontSize")
```

## Example Response

```json theme={null}
{
  "token_type": "dimension",
  "results": [
    {
      "workspace": {
        "id": "0afa0a8a-5e59-4ef9-9619-c12ecdad3c1a",
        "name": "My Workspace"
      },
      "tokenset": {
        "id": "164809aa-cbd2-4c5f-ac1a-af6902c29f6e",
        "name": "Core"
      },
      "tokens": [
        {
          "id": "b748db41-1cb0-4e8a-b671-c9eab26bd584",
          "name": "spacing.xs",
          "type": "dimension",
          "value": "4px",
          "description": "Extra small spacing",
          "mode_id": "2edd637b-5088-4c9b-abbc-e431e5816e94",
          "alias_to": null
        },
        {
          "id": "43796993-1d65-4a89-b1a8-e210fec9c8af",
          "name": "spacing.sm",
          "type": "dimension",
          "value": "8px",
          "description": "Small spacing",
          "mode_id": "2edd637b-5088-4c9b-abbc-e431e5816e94",
          "alias_to": null
        }
      ]
    }
  ],
  "total_found": 2,
  "usage": "Use these token IDs and mode IDs in other tools"
}
```

## Use Cases

* **Type discovery**: Find all tokens of a specific type across your account
* **Type analysis**: Analyze all tokens of a particular type
* **Type management**: Manage all tokens of a specific type
* **Export by type**: Export all tokens of a specific type
* **No workspace knowledge needed**: Works without knowing workspace IDs

## Supported Token Types

| Type            | Description         | Example Values                                |
| --------------- | ------------------- | --------------------------------------------- |
| `color`         | Color values        | `#0066CC`, `rgb(0, 102, 204)`                 |
| `dimension`     | Spacing, sizing     | `16px`, `2rem`, `100%`                        |
| `fontSize`      | Font sizes          | `14px`, `1.2rem`                              |
| `fontWeight`    | Font weights        | `400`, `bold`, `600`                          |
| `fontFamily`    | Font families       | `Inter`, `Arial, sans-serif`                  |
| `lineHeight`    | Line heights        | `1.5`, `24px`                                 |
| `letterSpacing` | Letter spacing      | `0.1em`, `1px`                                |
| `duration`      | Animation durations | `200ms`, `0.3s`                               |
| `cubicBezier`   | Timing functions    | `ease-in-out`, `cubic-bezier(0.4, 0, 0.2, 1)` |
| `number`        | Numeric values      | `42`, `3.14`                                  |
| `string`        | String values       | `"Hello"`, `"World"`                          |
| `boolean`       | Boolean values      | `true`, `false`                               |

## Related Tools

* `list_resources` - Get workspace and tokenset IDs
* `search_tokens` - Search tokens by name or value
* `get_tokens_by_mode` - Get tokens from specific modes
* `export_tokenset` - Export tokensets

## Workflow Example

```bash theme={null}
# 1. Find all dimension tokens
find_tokens_by_type(type: "dimension")

# 2. Use the results to update tokens
update_token(
  tokenset_id: "164809aa-cbd2-4c5f-ac1a-af6902c29f6e",
  mode_id: "2edd637b-5088-4c9b-abbc-e431e5816e94",
  token_id: "b748db41-1cb0-4e8a-b671-c9eab26bd584",
  value: "6px"
)
```

## Best Practices

1. **Use exact type names**: Use the exact token type names (case sensitive)
2. **Check all results**: Review all workspaces and tokensets in results
3. **Use token IDs**: Copy exact token IDs for other operations
4. **Combine with other tools**: Use with `search_tokens` for more specific searches

## Error Prevention

This tool helps prevent common errors:

* ❌ Needing to know workspace IDs
* ❌ Missing tokens in other workspaces
* ❌ Using wrong token types
* ✅ Finding all tokens of a type across your account
* ✅ No workspace ID required

## Common Use Cases

* **"Show me all dimension tokens"** → `find_tokens_by_type(type: "dimension")`
* **"Find all color tokens"** → `find_tokens_by_type(type: "color")`
* **"Get all fontSize tokens"** → `find_tokens_by_type(type: "fontSize")`
* **"List all spacing tokens"** → `find_tokens_by_type(type: "dimension")` then filter by name
