Skip to main content
Glama
JALAL591

compose-bridge

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

TableJSON Schema
NameRequiredDescriptionDefault
valueYes
token_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.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 present, the description fully carries the behavioral burden: it flags DESTRUCTIVE, discloses on-disk source mutation and the WebSocket phone notification, and specifies the approve_file_changes/reject_file_changes commit-revert workflow. This is exactly the safety 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?

Sections are labeled and the destructive warning is front-loaded, so it is easy to scan. The 'Returns' block largely restates the output schema, which is mild redundancy that slightly dilutes conciseness.

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?

For a destructive, two-parameter mutation tool with no annotations, the description covers purpose, routing, side effects, workflow prerequisites, parameter formats, and even a return summary. An agent has everything required to invoke it correctly.

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: it explains token_name accepts either a bare name or a 'AppColors.TokenName' form, and that value is '#RRGGBB' for colors or numeric/'24.dp' for dimensions, with concrete examples for both.

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 a design token value in source code,' and immediately constrains the target to .kt files containing the token definition. It also distinguishes itself from closely-named siblings (set_text, add_token).

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 'When to use' (adjusting a color/dimension token with live feedback) and 'When NOT to use' sections that name the alternative tools for the excluded cases (set_text for strings, add_token for hardcoded-to-token conversion). Routing is unambiguous.

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