set_text
Edits text strings in Kotlin Compose files, auto-wrapping hardcoded UI copy in BridgeTextRegistry for live preview. Use for UI text changes, not colors or dimensions.
Instructions
DESTRUCTIVE: Modifies .kt files. Surgically edit text content with automatic BridgeTextRegistry wrapping.
What it does: Modifies .kt files. Auto-migrates hardcoded text to BridgeTextRegistry for live preview.
When to use: When editing UI text strings, whether defined in AppStrings or hardcoded in Composable Text("...") elements.
When NOT to use: Do not use for colors or dimensions (use set_token or add_token).
Side effects: DESTRUCTIVE: Modifies source code on disk. Requires approve_file_changes before changes take effect in git. Can be reverted via reject_file_changes.
Parameters:
- token_name: reference key (e.g., 'AppStrings.Dashboard.title') OR exact old text content to replace.
- new_value: The new text string to set.
- file_path: relative path to source file (e.g., 'QuickActionsWidget.kt' or 'ui/theme/AppStrings.kt').
- line: optional line number for disambiguation if text appears multiple times.
Returns:
JSON string with success status, old_text, new_text, and modified file location.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | No | ||
| file_path | No | ||
| new_value | Yes | ||
| token_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |