Skip to main content
Glama

inspector.parents

Read-only

Retrieves the ancestor chain of a DOM element, including layout properties that create stacking and clipping contexts, to help debug z-index and overflow issues.

Instructions

Ancestor chain of an element with the layout properties that create stacking and clipping.

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": "inspector.parents"
  }
}

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.
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered. The description contributes real behavioral value by saying the output includes layout properties that create stacking and clipping, not just node identities. It does not say whether the chain is ordered nearest-first, whether the element itself is included, or how deep it goes.

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 tight sentence with zero filler, and the payoff (stacking/clipping layout properties) is front-loaded. The fragmentary phrasing without a verb costs a little clarity but nothing 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 nine optional locator parameters, no output schema, and an open-world read, the description gives only a high-level statement of the result. It is enough to know the tool is safe and returns ancestor layout data, but ordering, chain termination, and how it relates to the sibling inspector tools are left unstated.

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?

All nine parameters are documented in the schema at 100% coverage, including locator strategies (ref, xpath, selector, text, backend_node_id) and target/browser handles, so the description need not repeat them. It adds no locating semantics of its own, which is acceptable given the schema but leaves it at baseline.

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?

Names a specific resource (the ancestor chain of an element) and qualifies it with the useful detail that the returned nodes carry the layout properties responsible for stacking and clipping. That makes it distinguishable from inspector.children (descendants) and inspector.element (a single node) without needing the schema. It is a noun phrase rather than a verb, so whether it 'returns' or 'lists' the chain is left implicit.

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?

The mention of stacking and clipping implies the debugging scenario (z-index / overflow / containment issues), so the when-to-use case is inferable. However, no alternative is named and no exclusion is stated — an agent gets no explicit signal about when inspector.element or inspector.children would be the better call.

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