Skip to main content
Glama

inspect_element

Inspect a DOM element by CSS selector to retrieve its tag, text, attributes, computed styles, bounding box, visibility, parent, and children for debugging and responsive layout checks.

Instructions

Inspect a specific DOM element using a CSS selector. Returns tag, text, attributes, computed styles, bounding box, visibility, parent, and relevant children.

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

Input Schema

NameRequiredDescriptionDefault
selectorYesCSS selector of the target element (e.g. "header", "#hero", ".navbar-brand", "button.submit")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the return fields (tag, text, attributes, computed styles, bounding box, visibility, parent, children), but it does not state whether the operation is read-only, what happens if the selector matches multiple elements, or how selector-not-found errors are handled.

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?

Two sentences, front-loaded with the primary action and followed by the return value summary. There is no redundant or filler wording.

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 one-parameter read inspection tool with a fully documented schema and no output schema, the definition is largely complete. The main omissions are behavioral details around multiple matches and error handling, plus routing guidance against closely related inspection tools.

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%, and the schema already documents the selector parameter with examples. The description adds only the phrase "using a CSS selector," which is a baseline restatement rather than additional semantics such as first-match behavior or shadow DOM support.

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 gives a specific verb and resource: "Inspect a specific DOM element using a CSS selector." It is clear what the tool does, but it does not distinguish itself from siblings like inspect_styles or inspect_element_responsiveness, which likely overlap in inspecting element-level details.

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 explicit guidance on when to use this tool versus alternatives such as inspect_styles or inspect_element_responsiveness. The intended usage is only implied by the tool name and the phrase "specific DOM element," leaving the agent to infer the correct context.

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