Skip to main content
Glama

pilot_page_css

Retrieve computed CSS property values for web elements using element references or CSS selectors to inspect styling in browser automation.

Instructions

Get computed CSS property value for an element.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesElement ref or CSS selector
propertyYesCSS property name (e.g. color, font-size)

Implementation Reference

  • The implementation of the pilot_page_css tool handler, which uses Playwright's locator to evaluate and retrieve the computed CSS property of a specified element.
    server.tool(
      'pilot_page_css',
      'Get computed CSS property value for an element.',
      {
        ref: z.string().describe('Element ref or CSS selector'),
        property: z.string().describe('CSS property name (e.g. color, font-size)'),
      },
      async ({ ref, property }) => {
        await bm.ensureBrowser();
        try {
          const page = bm.getPage();
          const resolved = await bm.resolveRef(ref);
          const locator = 'locator' in resolved ? resolved.locator : page.locator(resolved.selector);
          const value = await locator.evaluate(
            (el, prop) => getComputedStyle(el).getPropertyValue(prop),
            property
          );
          return { content: [{ type: 'text' as const, text: value }] };
        } catch (err) {
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full disclosure burden. It adds the important behavioral context that values are 'computed' (final calculated styles), but lacks critical details: error behavior when elements aren't found, return value format (string vs object), or whether pseudo-elements are supported.

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?

The description is a single, front-loaded sentence of nine words. It contains no redundancy or filler, immediately conveying the tool's function without wasting tokens.

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 2-parameter tool with simple flat schema and no output schema, the description covers the core function but omits the return value format (e.g., whether units are included, computed vs resolved values). This is minimally adequate but leaves agents to infer response structure.

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%, with both 'ref' and 'property' fully documented in the schema. The description generically references 'element' and 'CSS property' without adding syntax constraints, format details, or examples beyond what the schema already provides. Baseline 3 is appropriate.

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 the specific action ('Get'), resource ('computed CSS property value'), and target ('element'). The term 'computed' effectively distinguishes this from sibling tools like pilot_element_state or pilot_page_attrs, though it could more explicitly contrast with alternatives.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus siblings (e.g., pilot_element_state for boolean visibility checks, pilot_evaluate for complex style calculations, or pilot_page_html for inline styles). No prerequisites or conditions are mentioned.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TacosyHorchata/Pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server