Skip to main content
Glama
chrome-dev-mcp

chrome-dev-mcp

get_computed_style

Read-only

Retrieve computed CSS values for specified properties on the first element matching a selector, helping inspect actual rendered styles in Chrome.

Instructions

Get computed CSS values for the given properties on the first element matching selector.

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>",
      "properties": "<properties>"
    },
    "name": "get_computed_style"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorYesCSS selector for the target element
propertiesYesCSS property names to return (kebab-case or camelCase)

Output Schema

NameRequiredDescriptionDefault
stylesYesMap of property name → computed value. Keys match the input `properties` verbatim (case preserved).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.1
    • changedOutput schema / properties / styles / description
      Previous value: -"Map of property name → computed value. Keys match the input `properties` verbatim (case preserved). Values are `getComputedStyle` output; unknown properties yield empty string."New value: +"Map of property name → computed value. Keys match the input `properties` verbatim (case preserved)."
  2. Changed4 schema fields changedv1.3.0
    • addedInput schema / properties / properties
      Added value: +{
      +  "description": "CSS property names to return (kebab-case or camelCase)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / selector / description
      Added value: +"CSS selector for the target element"
    • changedInput schema / required
      Previous value: -[
      -  "selector"
      -]New value: +[
      +  "selector",
      +  "properties"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "styles": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "description": "Map of property name → computed value. Keys match the input `properties` verbatim (case preserved). Values are `getComputedStyle` output; unknown properties yield empty string.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "styles"
      +  ],
      +  "type": "object"
      +}
  3. First observedv1.1.0

TDQS

A3.5/5.0
Behavior3/5

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

readOnlyHint=true already declares the safety profile, so the description's added value is the 'first element matching selector' detail, which usefully signals that only one element's values are returned. It omits other behavioral facts beyond the annotations, such as what happens when no element matches or whether pseudo-elements/inherited values are covered.

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 no wasted words; the resource and the scoping constraint are both front-loaded and immediately actionable.

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

Completeness3/5

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

The tool is simple, the schema is fully described, an output schema exists, and the read-only annotation covers safety, so most of an agent's needs are met. The remaining gap is failure behavior when the selector matches nothing, which the description does not address.

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 coverage is 100%, with both `selector` and `properties` fully documented in the schema including kebab-case/camelCase acceptance, so the baseline is 3. The description reinforces the selector-targeting semantics ('first element matching') but adds no format or edge-case detail beyond the schema.

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 (get) and resource (computed CSS values) plus the scope constraint 'on the first element matching `selector`'. An agent can distinguish it from get_html or get_inspected_element because it explicitly returns computed CSS property values rather than markup or element metadata, though it does not name a sibling alternative.

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 by the resource: use it when you need resolved/computed CSS values for specific properties. There is no explicit when-to-use or when-not-to-use guidance, and no mention of the plausible alternative (e.g. evaluate_js for styles), so routing depends on the agent inferring intent from the name and purpose line.

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