set_token
Edit a design token value in Kotlin source files and notify the phone over WebSocket for live preview. Use it to adjust color or dimension tokens and see visual feedback immediately.
Instructions
DESTRUCTIVE: Modifies .kt files. Surgically edit a design token value in source code.
What it does: Modifies .kt files containing the token definition. Notifies phone via WebSocket (live preview).
When to use: When adjusting a design token (color or dimension) and immediately observing visual feedback.
When NOT to use: Do not use for text strings (use set_text). Do not use for converting hardcoded values to tokens (use add_token).
Side effects: DESTRUCTIVE: Modifies source code on disk. Requires approve_file_changes to commit changes or reject_file_changes to revert.
Parameters:
- token_name: exact token name OR 'AppColors.TokenName' (e.g., 'Primary', 'cardCorner').
- value: '#RRGGBB' for colors or numeric for dimensions (e.g., '#FF1122', '24.dp').
Returns:
JSON string with update status, file path, and previous/new values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | ||
| token_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |