Skip to main content
Glama
JALAL591

compose-bridge

add_token

Convert a hardcoded value into a design token by adding its definition and replacing only the specified line, without altering other code in the file.

Instructions

Convert a hardcoded value to a design token.

This tool:
1. Adds a new token definition to AppDimens.kt or AppColors.kt
2. Replaces ONLY the specified line with the new token
3. Does NOT touch any other line in the project

Use list_tokens() first to find hardcoded values that
could become tokens.

Args:
    file: File name (e.g., "DashboardPage.kt")
    line: Line number (1-indexed)
    value: Expected value (e.g., "16.dp" or "0xFF7C3AED")
    token_name: New token name (e.g., "padding_md")
    token_type: "dimension" or "color"
    preferred_token_file: Optional target token file (e.g. "Tokens.kt")
    force_create: ⚠️ force_create bypasses duplicate detection. Use ONLY for testing.

Returns:
    JSON with success status and details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes
lineYes
valueYes
token_nameYes
token_typeYes
force_createNo
preferred_token_fileNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose key mutation behavior: it adds a definition to AppDimens.kt/AppColors.kt, replaces ONLY the specified line, and touches no other line. It also warns that force_create bypasses duplicate detection. It omits permissions, failure modes, and whether edits enter a pending-approval workflow implied by siblings like approve_file_changes.

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?

It is front-loaded with purpose, then a tight numbered behavior list, usage note, Args and Returns. The structure is scannable and every section earns its place, though the Returns line adds little given an output schema exists.

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

Completeness4/5

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

For a 7-parameter mutation tool with no annotations, the description covers behavior, all parameters, and a prerequisite step, which is substantial. The main gap is the staged-approval/rollback workflow implied by sibling tools, which is not mentioned.

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%, so the description must document all parameters, and it does so via a full Args block. It supplies concrete examples ('16.dp', '0xFF7C3AED', 'padding_md') and enumerates the token_type values ('dimension' or 'color') that the schema itself lacks.

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

Purpose4/5

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

The description opens with a specific verb+resource ('Convert a hardcoded value to a design token') and the numbered steps make the operation concrete. It does not explicitly distinguish itself from the nearby set_token sibling, so it stops short of a 5.

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

Usage Guidelines4/5

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

It gives clear context via the prerequisite 'Use list_tokens() first to find hardcoded values that could become tokens.' However it offers no when-not guidance and never contrasts add_token with set_token, which an agent could reasonably confuse it with.

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