Skip to main content
Glama

inspect_dom

Inspect DOM elements via CSS selector or evaluate JavaScript in page context, optionally navigating to a URL first.

Instructions

Inspect DOM elements or run JavaScript in a page context. Optionally navigate to a URL first.

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": "inspect_dom"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoURL to navigate to before inspecting (optional)
scriptNoJavaScript expression to evaluate in page context (overrides selector)
selectorNoCSS selector to query — returns outerHTML of all matching elements

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.4.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden, and it discloses very little. It says the tool can run arbitrary JavaScript and navigate, but not whether navigation discards or preserves the current page state, whether scripts run with page privileges (and any security implications), how the result is shaped, or what happens when multiple selectors match.

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?

Two short sentences with no filler, and the two main modes are front-loaded. The navigation option reads slightly as an afterthought, but nothing is wasteful.

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

Completeness2/5

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

For an unannotated tool that executes arbitrary code and mutates browser navigation state, the definition is thin: no permission or setup requirements, no output description (there is no output schema), and no precedence or failure behavior beyond the brief parenthetical.

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 the parameters are already documented. The description adds one useful precedence rule, namely that script overrides selector, but it does not explain how selector results are ordered or what the return value of script evaluation looks like.

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 two specific capabilities, inspecting DOM elements and running JavaScript in page context, and notes optional navigation. It is clearer than a generic browser tool, but it does not distinguish itself from siblings such as take_screenshot or run_assertion, which also operate on the page.

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 mention of prerequisites such as an active browser connection or a loaded page, and no routing to alternatives. The only implicit hint is that url navigation is optional and script overrides selector, which is guidance about parameters rather than usage context.

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