Skip to main content
Glama
JALAL591

compose-bridge

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

TableJSON Schema
NameRequiredDescriptionDefault
lineNo
file_pathNo
new_valueYes
token_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and delivers: it flags DESTRUCTIVE on-disk source modification, discloses auto-migration to BridgeTextRegistry, states the approve_file_changes gating requirement, and documents reversibility via reject_file_changes. This is exactly the behavioral context an agent needs before a mutating call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Strongly front-loaded with labeled sections (destructive warning, what/when/when-not, side effects, params, returns). Minor cost: 'Modifies .kt files' is restated three times, creating slight redundancy that could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, usage, safety, approval workflow, per-parameter meaning, and even return contents (success status, old_text, new_text, file location) despite an output schema existing. Nothing an agent needs to invoke this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and does: token_name is explained as EITHER a reference key (with an example format) OR exact old text content, new_value and file_path get examples, and line is explained as optional disambiguation for repeated text. This adds meaning well beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Surgically edit text content', 'Modifies .kt files') and scopes it to UI text strings including hardcoded Text("...") elements. It clearly differentiates itself from siblings set_token and add_token, so an agent can select it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit and complete: 'When to use' names editing UI text strings, and 'When NOT to use' routes colors/dimensions to set_token or add_token. Both the triggering condition and the excluded alternatives are spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.