Skip to main content
Glama
This server has been deprecated

Rebranded to ComposeLint AI. Repository has been moved to TechsOneAi/ComposeLintAI.

set_token

Destructive

Edits design token values in Kotlin source files and triggers live preview via WebSocket so developers can adjust Compose colors or dimensions and observe feedback.

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

NameRequiredDescriptionDefault
valueYes
token_nameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, but the description goes well beyond them: it discloses that source code on disk changes, that a WebSocket live preview is pushed to the phone, and that approve_file_changes must commit or reject_file_changes must revert. That approval-workflow dependency is exactly the kind of context annotations cannot convey.

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?

Labeled sections (What it does / When to use / When NOT to use / Side effects / Parameters / Returns) make it scannable and front-loaded. Minor redundancy: 'DESTRUCTIVE: Modifies .kt files' appears in the opening line and again under side effects, and the returns section partially duplicates the output schema.

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, the description covers purpose, alternatives, on-disk consequences, the approval gate, and parameter formats. An output schema exists, so the brief Returns note is supplementary rather than the sole source of return-shape information, leaving no meaningful gap.

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 description coverage is 0% and both properties are bare strings, so the description carries the full burden. It supplies accepted formats and examples for each: token_name as either 'Primary' or 'AppColors.TokenName', and value as '#RRGGBB' or a numeric dimension like '24.dp'. This fully compensates for the empty 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 a design token value in source code') and immediately scopes it to .kt files containing the token definition. It explicitly names the siblings it is not (set_text, add_token), so an agent can disambiguate without opening any 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?

Provides an explicit 'When to use' condition (adjusting a color or dimension with immediate visual feedback) and a 'When NOT to use' section that routes text edits to set_text and hardcoded-value conversion to add_token. Both alternatives are named with the condition that selects them.

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