> ## 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.

# update_token

> Update an existing token

# update\_token

Updates the properties of an existing design token.

## Tool Schema

```json theme={null}
{
  "name": "update_token",
  "description": "Update a token",
  "inputSchema": {
    "type": "object",
    "properties": {
      "tokenset_id": {
        "type": "string",
        "description": "The ID of the tokenset"
      },
      "mode_id": {
        "type": "string",
        "description": "The ID of the mode"
      },
      "token_id": {
        "type": "string",
        "description": "The ID of the token to update"
      },
      "name": {
        "type": "string",
        "minLength": 1,
        "description": "The new name of the token"
      },
      "type": {
        "type": "string",
        "enum": [
          "color", "dimension", "fontFamily", "fontWeight", "fontSize",
          "lineHeight", "letterSpacing", "duration", "cubicBezier",
          "number", "strokeStyle", "border", "transition", "shadow",
          "gradient", "typography", "string", "boolean"
        ],
        "description": "The new type of the token"
      },
      "value": {
        "type": "string",
        "description": "The new value of the token"
      },
      "description": {
        "type": "string",
        "description": "The new description of the token"
      },
      "alias_to": {
        "type": "string",
        "description": "The new alias target"
      }
    },
    "required": ["tokenset_id", "mode_id", "token_id"]
  }
}
```

## Parameters

| Parameter     | Type   | Required | Description                                        |
| ------------- | ------ | -------- | -------------------------------------------------- |
| `tokenset_id` | string | Yes      | The ID of the tokenset                             |
| `mode_id`     | string | Yes      | The ID of the mode                                 |
| `token_id`    | string | Yes      | The ID of the token to update                      |
| `name`        | string | No       | The new name of the token                          |
| `type`        | string | No       | The new token type                                 |
| `value`       | string | No       | The new value of the token                         |
| `description` | string | No       | The new description of the token                   |
| `alias_to`    | string | No       | The new alias target (set to null to remove alias) |

## Response

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440035",
  "name": "color.brand.primary",
  "type": "color",
  "value": "#0066CC",
  "description": "Updated primary brand color - darker for better contrast",
  "alias_to": null,
  "mode_id": "550e8400-e29b-41d4-a716-446655440020",
  "tokenset_id": "550e8400-e29b-41d4-a716-446655440010",
  "created_at": "2025-01-15T13:00:00Z",
  "updated_at": "2025-01-20T19:15:00Z"
}
```

## Example Usage in Claude

### Update Token Value

```
You: Change the primary color from #007AFF to #0066CC

Claude: I'll update the token value to the new color.

Token updated successfully:
- **Name**: color.primary
- **Old Value**: #007AFF
- **New Value**: #0066CC ✓
- **Description**: Updated primary brand color - darker for better contrast
```

### Update Token Name and Description

```
You: Rename color.primary to color.brand.primary and update its description

Claude: I'll update both the name and description of the token.

Token updated successfully:
- **Name**: color.brand.primary (updated)
- **Description**: Primary brand color for all brand touchpoints (updated)
```

### Convert to Alias

```
You: Make color.secondary an alias of color.primary

Claude: I'll convert this token to an alias that references the primary color.

Token updated successfully:
- **Name**: color.secondary
- **Type**: color
- **Value**: (alias)
- **Alias To**: color.primary
- **Resolved Value**: #0066CC
```

### Remove Alias

```
You: Remove the alias from color.accent so it has its own value

Claude: I'll remove the alias and set a direct value for this token.

Token updated successfully:
- **Name**: color.accent
- **Alias To**: (removed)
- **Value**: #FF9500 (direct value)
```

## Common Use Cases

### 1. Brand Updates

```
You: Update the brand colors to match the new brand guidelines
```

### 2. Token Renaming

```
You: Rename tokens to follow the new naming convention
```

### 3. Value Adjustments

```
You: Adjust spacing values for better visual hierarchy
```

### 4. Alias Management

```
You: Convert direct tokens to aliases for better maintainability
```

## Important Notes

* At least one update parameter must be provided
* Token names must be unique within their mode
* Changing `alias_to` will automatically resolve the token's value
* The `updated_at` timestamp is automatically updated
* Type changes may require value format changes

## See Also

* [get\_token](/mcp/tools/get-token) - Get current token details
* [create\_token](/mcp/tools/create-token) - Create new tokens
* [list\_tokens\_by\_mode](/mcp/tools/list-tokens-by-mode) - View all tokens in a mode
