Skip to main content
Glama

get_css_styles

Read-only

Explains why an element looks as it does by listing matching CSS rules in priority order, with selectors, stylesheets, at-rules, and computed values.

Instructions

Explains why an element looks as it does: the CSS rules matching it, highest priority first (style attribute, then rules), each with selector, stylesheet URL (the page's for an inline ), 0-based line and column, enclosing at-rules (@media, @container, @layer, @supports) and declarations marked important, invalid or overridden; its pseudo-elements; and the computed values of the declared properties. Options add the ancestors' rules (nearest first) and the browser's, or narrow to some properties (declarations included). Firefox reads them with its inspector (needs its debugger port).

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": {
      "selector": "<selector>"
    },
    "name": "get_css_styles"
  }
}

Input Schema

NameRequiredDescriptionDefault
tab_idNoDefault: the active tab.
selectorYesThe element (CSS, 'host >>> inner' or a snapshot ref).
max_rulesNoMost rules listed, 1 to 200. Default: 30.
propertiesNoOnly these properties (e.g. ['color', 'margin']); a shorthand also matches its longhands.
instance_idNoDefault: 'default'.
include_inheritedNoAlso its ancestors' rules (what it inherits). Default: false.
include_user_agentNoThe browser's own rules too. Default: false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.1

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, and the description adds substantial behavior beyond that: rules are ranked highest priority first with the style attribute leading, the exact per-rule metadata returned, flagging of important/invalid/overridden declarations, ancestor ordering ('nearest first') for inherited rules, and a real environment prerequisite (Firefox requires its debugger port). That is far more than the safety profile the annotation provides.

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 dense sentence (plus one short prerequisite clause) with the purpose front-loaded and each clause carrying distinct information — output contents, ordering, options, environment caveat. Nothing is redundant with the schema or annotations, though the semicolon-chained structure requires careful reading.

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

Completeness5/5

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

With seven parameters and no output schema, the description compensates by describing the return shape in detail (rules with selectors, URLs, positions, enclosing at-rules, computed values) and discloses the Firefox debugger-port requirement. An agent has enough to decide, invoke, and interpret results correctly.

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%, so the baseline is 3, and the description goes beyond it by explaining that include_inherited returns ancestors' rules nearest-first, that include_user_agent pulls the browser's own rules, and that property narrowing still includes declarations. Only max_rules' range and the shorthand/longhand matching are left to the schema.

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?

Opens with a specific verb and resource framed by intent: 'Explains why an element looks as it does: the CSS rules matching it, highest priority first.' It also enumerates the exact payload (selector, stylesheet URL, line/column, at-rules, declarations, pseudo-elements, computed values), which clearly separates it from structural siblings like inspect_dom or evaluate_js.

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 framing 'explains why an element looks as it does' implies the debugging-styling use case, and the Firefox debugger-port note flags a prerequisite. However, it never states when to prefer this over alternatives such as inspect_dom or evaluate_js, nor any exclusion conditions, so routing must be inferred.

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