Skip to main content
Glama

check_css_specificity

Detects CSS specificity anti-patterns like !important, ID selectors, deep nesting, and inline styles that cause styling issues in web components. Supports CSS and HTML analysis.

Instructions

Detects CSS specificity anti-patterns that cause styling issues with web components — catches !important usage, ID selectors targeting components, deeply nested selectors (4+ levels), and inline style attributes. Supports both CSS and HTML mode. Run this on any CSS or HTML to prevent specificity wars.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe CSS or HTML code to analyze for specificity issues.
modeNoAnalysis mode — "css" checks stylesheets for !important/ID/nesting issues, "html" checks for inline style attributes on web components. Defaults to "css".
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that the tool detects issues and supports two modes, but does not state whether it modifies code, side effects, or performance implications. As a check tool, read-only behavior is implied but not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loading the main purpose and then listing specifics. Every sentence is meaningful, with no redundancy or fluff.

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?

Given the simplicity of the tool (2 params, no output schema, no nested objects), the description covers the key aspects: what it detects, modes, and purpose. It could mention the output type (e.g., list of issues) but is largely complete for a check tool.

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 coverage is 100%, and the description adds value by explaining that 'code' can be CSS or HTML and that 'mode' defaults to 'css'. It clarifies the meaning of each parameter beyond the schema's brief descriptions.

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?

The description clearly states it detects CSS specificity anti-patterns like !important, ID selectors, deeply nested selectors, and inline styles. It specifies that it supports CSS and HTML modes, making its purpose distinct from sibling tools like check_css_scope or check_css_vars.

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?

While it says 'Run this on any CSS or HTML to prevent specificity wars,' it does not provide explicit guidance on when to use this tool versus alternatives (e.g., check_css_scope for scoping issues). No exclusions or when-not-to-use advice given.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bookedsolidtech/helixir'

If you have feedback or need assistance with the MCP directory API, please join our Discord server