Skip to main content
Glama

get_css_styles

Read-onlyIdempotent

Inspect which CSS declaration wins for an element and what it overrides — selector, stylesheet, rule position, !important, @layer — to debug why a style applies.

Instructions

Why an element looks the way it does: for each CSS property the winning declaration — selector, stylesheet, rule position, !important, @layer, @media — and the ones it overrides, like the Styles panel of DevTools; query_dom gives the computed value, this gives who set it. Read-only, from the CSSOM: stylesheets of another origin without CORS are opaque and listed by href; user-agent styles, @container and @scope rules are not evaluated. properties narrows the output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNoTarget tab; omitted = last tab navigated in this session, else the active one
frame_idNoTarget iframe id from get_frames; omitted = main frame
selectorYesCSS selector; ">>>" pierces shadow DOM. Only the first match is inspected
propertiesNoOnly these, e.g. ["margin-top","--brand"]; margin covers its longhands. Omitted = every property a matching rule sets
include_inheritedNoAlso inherited properties (color, font-*, custom properties) with the ancestor that sets them

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.28.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly/idempotent/non-destructive). The description goes well beyond: it discloses that output is scoped to the first selector match, that opaque cross-origin stylesheets are listed by href only, and which CSS features (user-agent styles, @container, @scope) are not evaluated — real behavioral caveats an agent needs.

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?

Information-dense and front-loaded: the purpose sentence comes first, followed by the distinctive comparison, then caveats, then the parameter note. Slightly long with heavy parenthetical enumeration, but nearly every clause carries signal.

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?

There is no output schema, and the description compensates by describing the return shape (per-property winning declaration with selector, stylesheet, rule position, importance, layer, media, plus overridden declarations). Combined with the disclosed evaluation limits, an agent has what it needs to call and interpret the tool.

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 are already documented in the schema (shadow-DOM piercing, frame/tab defaults, inherited handling). The description only restates that 'properties narrows the output', adding 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.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource — resolving which CSS declaration wins for an element — and immediately contrasts it with query_dom ('query_dom gives the computed value, this gives who set it'). An agent can route between the two without opening schemas.

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

Usage Guidelines5/5

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

Explicitly names the sibling alternative and the deciding criterion (computed value vs. originating declaration), and enumerates when the tool will not deliver useful results: cross-origin sheets without CORS, user-agent styles, @container and @scope.

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