Skip to main content
Glama
JALAL591

compose-bridge

detect_conditional_variants

Finds repeated conditional token or color patterns in Jetpack Compose code, optionally filtered by token name, and returns occurrences with consolidation suggestions.

Instructions

Detect repeated patterns like:
if (isDark) Color(0xFF818CF8) else AppColors.Primary

Args:
    token_name: optional — filter by base token name.
    
Returns:
    JSON with detected patterns + occurrences + suggestions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. 'Detect' plus the 'Returns: JSON with detected patterns + occurrences + suggestions' line reasonably conveys a read-only, non-mutating analysis, but it says nothing about permissions, scan scope (which files/workspace), or cost/latency. Nothing contradicts expected behavior, but disclosure is thin.

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?

Front-loaded with the core verb and an illustrative example, then Args and Returns in clearly labeled blocks with no filler sentences. The code example is long but earns its place by disambiguating what a 'conditional variant' is.

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

Completeness3/5

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

The single parameter is explained and an output schema exists, so the Returns line is largely redundant but harmless. What's missing for a detection tool in a dense sibling set (replace_pattern, suggest_token_split, list_applied_patterns) is any statement of where detection fits in the workflow — e.g., that results feed into `replace_pattern`.

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

Parameters4/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 compensate, and it does: it states `token_name` is optional and filters by base token name, which is exactly the semantic the bare schema (`type: string`, `default: null`) lacks. Only a single parameter exists, so this is close to complete, though it doesn't specify matching semantics (exact vs substring).

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 states a specific verb and target ('Detect repeated patterns') and anchors it with a concrete code example (`if (isDark) Color(0xFF818CF8) else AppColors.Primary`), so the agent knows exactly what class of finding this produces. It does not, however, explicitly distinguish itself from sibling tools like `suggest_token_split` or `find_token_by_color`, which the agent must infer from the example.

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

Usage Guidelines3/5

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

Usage is implied by the example pattern rather than stated: an agent can infer this is for locating hardcoded conditional color branches that should be tokenized. There is no explicit when-to-use statement, no exclusions, and no named alternative (e.g., when to prefer `suggest_token_split` or `replace_pattern` after detection).

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