Skip to main content
Glama
Pagewright (browser-mcp)

Pagewright (browser-mcp)

by zamansheikh

browser_inspect

Read-only

Inspects an element's box, spacing, overflow, and computed styles, and lists matching CSS rules with source file and line so you can find which rule to fix.

Instructions

Explain an element's layout: box size and position, margin/border/padding, key computed styles, overflow, parent, and the CSS rules that style it with their source file and line — use it to find which rule to change when fixing the frontend.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_inspect"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoElement ref from browser_snapshot, e.g. "e12". Preferred over selector.
tabIdNoTab to act on. Defaults to the tab last opened/selected by an agent, else the active tab.
selectorNoCSS selector, "text=Sign in" (visible text), or "xpath=//button". Searches open shadow roots too.
propertiesNoExtra computed CSS properties to report.
matchedRulesNoInclude matching CSS rules with source locations.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.6/5.0
Behavior3/5

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

readOnlyHint=true already establishes this is a safe inspection, so the bar is lower. The description adds useful behavioral content by spelling out that CSS rules are returned with their source file and line, but it says nothing about the cost of the operation, whether a prior browser_snapshot ref is required, or what happens when selector/ref do not resolve.

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?

A single front-loaded sentence with an em dash separates the what (layout facts) from the why (find the rule to change). The output enumeration is dense but each item is a distinct capability, so little is wasted; only the inline list of margin/border/padding could be condensed.

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

Completeness4/5

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

For a read-only inspection tool with a fully documented 5-parameter schema and no output schema, the description covers what is returned well enough for an agent to call it blind. The main missing piece is the prerequisite that ref comes from a prior browser_snapshot, which only the schema states, plus a note on failure behavior for unresolved elements.

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 ref, tabId, selector, properties, and matchedRules are all documented upstream, and the description adds no parameter-level meaning beyond that. The mention of "the CSS rules that style it with their source file and line" loosely explains the matchedRules behavior, but that is already covered by the schema default and description.

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 names a specific verb ("Explain") and resource (an element's layout) and enumerates exactly what is reported: box size/position, margin/border/padding, computed styles, overflow, parent, and matched CSS rules with source file/line. It stops short of naming a sibling such as browser_audit_layout, so the agent must infer the distinction from the output list rather than an explicit comparison.

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

Usage Guidelines4/5

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

It gives a clear triggering context — "use it to find which rule to change when fixing the frontend" — which tells the agent when this tool is the right pick over generic evaluation or screenshotting. It offers no explicit exclusions or named alternatives, so the agent gets context but not routing rules.

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