Skip to main content
Glama

refactor_css_with_theme

Read-onlyIdempotent

Replace hardcoded CSS colors with theme variables by matching styles against theme CSS, using confidence thresholds and optional reports.

Instructions

Refactor CSS to use theme variables instead of hardcoded colors

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "css": "<css>",
      "themeCSS": "<themeCSS>"
    },
    "name": "refactor_css_with_theme"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssYesCSS content to refactor
themeCSSYesCSS containing theme variables
minConfidenceNoMinimum confidence for replacements
generateReportNoGenerate detailed refactoring report
preserveOriginalNoKeep original values as comments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world behavior, so the safety profile is covered. The description adds nothing beyond that: it does not say what the tool returns, whether the CSS is modified in place, how minConfidence gates partial replacements, or what the generated report contains.

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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though it leaves no room for the operational detail this tool needs.

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

Completeness2/5

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

There is no output schema, yet the description never indicates what comes back (refactored CSS string, report, diff) or how the two inputs interact. For a transformation tool with a confidence threshold and a report flag, this omission leaves the agent guessing about invocation outcome.

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 100%, so all five parameters (css, themeCSS, minConfidence, generateReport, preserveOriginal) are already documented in the schema. The description adds no extra meaning such as how matching is performed or what a confidence score means in practice, leaving it at the baseline.

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?

States a specific verb and resource ("Refactor CSS") plus the exact transformation goal (replace hardcoded colors with theme variables). It is clearly distinguishable from siblings like generate_theme_css or audit_ui_colors, though it never names an alternative explicitly.

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?

The usage context is implied: you have CSS with literal color values and a theme stylesheet to map them onto. There is no explicit when-to-use/when-not-to-use guidance and no prerequisite statement (e.g., that themeCSS must actually define variables), so an agent must infer applicability.

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