Skip to main content
Glama

css.matched_rules

Read-only

Diagnose CSS styling issues by identifying which stylesheet rule and line set each property, ordered by cascade strength, including inherited rules.

Instructions

The cascade as DevTools shows it: which rule in which stylesheet at which line set each property, strongest first, plus inherited rules.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "css.matched_rules"
  }
}

Input Schema

NameRequiredDescriptionDefault
nthNoZero-based index when the locator matches several elements.
refNoSnapshot ref (eNN) from page.snapshot.
textNoVisible text of the element.
xpathNoXPath expression.
frame_idNoFrame to search within; see page.list_frames.
propertyNoNarrow to one property.
selectorNoCSS selector; pierces shadow DOM.
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered. The description does add genuine behavior beyond that: results are ordered strongest-first and inherited rules are included, which shapes how the output must be read. It stops short of saying what happens when the locator matches multiple elements or nothing.

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?

A single sentence with a colon that front-loads the framing ('the cascade as DevTools shows it') and then enumerates the payload and ordering. No filler or redundant restatement of the tool name.

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 read-only inspection tool with no required parameters, no output schema, and fully documented schema fields, the description covers what comes back and how it is ordered. The one gap is that with 10 optional locator parameters an agent gets no description-level signal about which locator form to prefer or whether they are mutually exclusive.

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%, including the meaningful 'property' narrowing parameter and the locator alternatives, so the schema carries parameter meaning. The description's phrase 'set each property' hints at the property scope but adds no syntax or format detail beyond the schema. Baseline 3 applies.

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 concretely what is produced: the matched rule, its stylesheet, its source line, per property, ordered strongest-first, plus inherited rules. That is a specific resource (matched CSS rules) rather than a restatement of the name. It does not explicitly contrast with the natural alternative css.computed, so sibling differentiation is only implicit.

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 — an agent would infer this is for investigating why a property resolves the way it does and which author rule wins. There is no explicit when-to-use vs css.computed/css.list_stylesheets guidance, and no statement of preconditions such as needing a resolved element locator.

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

Deploy Server

Other Tools