Skip to main content
Glama

inspect_element

Check if a DOM element exists on a page and get its bounding box, size, and visibility via Chrome DevTools Protocol to verify layout or catch UI regressions.

Instructions

Inspect a DOM element on a webpage via CDP: check if it exists, its computed physical bounding box (x, y, width, height), and whether it is currently visible.

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": {
      "url": "<url>",
      "selector": "<selector>"
    },
    "name": "inspect_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesTarget webpage URL
delayNoDelay in milliseconds before inspecting (default: 500)
widthNoViewport width in pixels (default: 1920)
heightNoViewport height in pixels (default: 1080)
waitForNoOptional CSS selector to wait for before inspecting
selectorYesCSS selector of the DOM element to inspect

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the mechanism (CDP), the navigation target (url), and the three outputs, and the phrasing "check if it exists" implies a missing element is reported rather than thrown as an error. However, it says nothing about whether a browser context is launched or reused, whether the call has side effects on any session, how long it blocks, or what happens on navigation failure — all material for a 6-parameter CDP tool with zero annotation coverage.

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 zero filler: the verb and resource come first, followed by the three concrete outputs. Nothing is repeated from the schema and no sentence is wasted.

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?

With six parameters, no annotations, and no output schema, the description should explain the return shape (it partly does) and the failure/latency semantics (it does not). The interaction between delay, waitFor, and viewport size — which materially changes results — is left entirely to the schema. Adequate for a simple probe, but not complete for a tool of this parameter count.

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 six parameters (url, selector, delay, width, height, waitFor) are already documented with defaults in the schema. The description adds no meaning beyond that — it never mentions viewport sizing, the pre-inspection delay, or the waitFor selector, which is the parameter most likely to be misunderstood. Baseline 3 is appropriate when the schema does all the work.

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 pairs a specific verb ("Inspect") with a specific resource ("a DOM element on a webpage via CDP") and enumerates exactly what is reported: existence, computed bounding box (x, y, width, height), and current visibility. That is far more precise than the sibling screenshot tools imply. It stops short of naming a sibling or stating the boundary against them, so it lands at 4 rather than 5.

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?

There is no when-to-use guidance, no when-not-to-use, and no reference to the sibling tools (interact_and_screenshot, take_screenshot) that an agent might confuse this with. The agent must infer that this is the read-only geometry/existence probe while screenshots are for visual capture. Usage is implied by the purpose statement only.

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