Skip to main content
Glama
This server has been deprecated

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

detect_conditional_variants

Read-onlyIdempotent

Identify repeated conditional variant patterns, such as dark-mode color branches, optionally filtered by token name, and return 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

NameRequiredDescriptionDefault
token_nameNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds that results include detected patterns, occurrences, and suggestions, which hints at scan-plus-recommendation behavior. It doesn't say how patterns are grouped, whether occurrences reference file/line locations, or how the suggestions should be acted on, so the added value is modest.

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 an illustrative example, then clean Args/Returns sections — no filler sentences. The example line is worth its space because the tool name alone would not convey the target pattern shape. Slightly terse overall, but nothing to cut.

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?

An output schema exists, so return values needn't be spelled out, and annotations cover safety; the description just needs purpose and the filter. It is complete for a single-optional-param analysis tool, with the main residual gap being the absence of any workflow guidance about when a conditional-variant scan is the right move.

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

Parameters3/5

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

Schema description coverage is 0% for the single parameter, so the description carries the burden and does at least say it is optional and filters by 'base token name'. It does not clarify matching semantics (exact vs. prefix vs. case-sensitive) or what happens when omitted beyond the word 'optional', leaving real ambiguity for the agent.

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 gives a concrete verb ('Detect') plus a resource ('repeated patterns') and immediately grounds it with a code example of the target shape (a conditional color expression). An agent can tell this is a read-only analysis sweep for conditional token variants. It doesn't explicitly differentiate itself from nearby analysis siblings such as suggest_token_split or analyze_design_scatter, which keeps it out of 5 territory.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites, and no named alternative. The Args section explains the filter but never says when to run a filtered scan versus a full scan, or how this relates to suggest_token_split / replace_pattern in the workflow.

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