Skip to main content
Glama

css.set_style

Sets inline CSS style properties on a page element, similar to editing element.style in DevTools, so agents can adjust appearance or layout during browser automation.

Instructions

Set inline style properties on an element, as editing element.style in DevTools would.

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": {
      "properties": "<properties>"
    },
    "name": "css.set_style"
  }
}

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.
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.
propertiesYes
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=false and openWorldHint=true, so the mutation and external-page nature is known from structured data. The DevTools analogy adds real context by implying the change is a live, in-page DOM mutation rather than a stylesheet edit, but the description omits whether existing inline styles are merged or overwritten, whether !important is honored, and whether changes survive navigation.

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 front-loaded sentence with no filler, and the analogy does substantive work rather than padding. Nothing in it could be removed without losing clarity.

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?

For a 10-parameter mutation tool with no output schema, the description is adequate but thin: it covers what the tool does and the shape of the style payload, but not merge-vs-replace semantics, specificity interactions, or what is returned. The extensive locator surface is left entirely to the schema.

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 90%, so most locator parameters are self-documenting and baseline would apply. The description nevertheless adds meaning for the one required parameter, properties: the element.style analogy signals a CSS-property-to-value map, and that JavaScript style-object naming (camelCase) is likely expected — a non-trivial disambiguation for an untyped string-to-string object.

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 and resource ("Set inline style properties on an element") and anchors it with a concrete analogy to DevTools' element.style editing. It is clear about what changes (inline style), though it never contrasts itself with sibling mutators such as dom.set_attribute that could also touch the style attribute.

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 only implied through the DevTools analogy — an agent can infer this is for ad-hoc inline style overrides rather than editing stylesheets, but no explicit when-to-use, when-not-to-use, or alternative is named. Siblings like css.matched_rules (inspection) and dom.set_attribute (attribute writes) are not referenced, leaving the routing decision to inference.

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