Skip to main content
Glama

Query DOM

query_dom
Read-onlyIdempotent

Return outer HTML of elements matching a CSS selector to identify the exact targets to click or type into and verify what is on the page.

Instructions

Return the outer HTML of every element matching a CSS selector (capped). Use to locate the exact elements to click or type into, and to confirm what is actually on the page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax matches to return (default 20).
selectorYesCSS selector, e.g. 'button.submit' or '[data-testid=login]'.
target_idYesTarget id from list_targets — the page / webview / Electron window to inspect.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With readOnlyHint and idempotentHint already true in annotations, the safety profile is covered. The description adds useful behavioral context beyond annotations by revealing the output shape (outer HTML), the capped result set, and the real-time page verification purpose, which helps an agent predict call outcomes.

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 with no filler. The primary action and cap are front-loaded, and the second sentence adds concrete use cases. Every phrase earns its place without redundancy.

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

Completeness5/5

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

For a low-complexity read-only tool with three fully documented parameters and no output schema, the description adequately explains the return value (outer HTML of matches) and the practical purpose. Nothing an agent needs to decide whether to call this tool is missing.

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 baseline is 3. The description does not add meaning beyond the schema; it mentions 'CSS selector' and 'capped' but does not elaborate on parameter formats or defaults, all of which the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with the specific verb and resource: 'Return the outer HTML of every element matching a CSS selector (capped).' It differentiates itself from siblings like dom_snapshot by specifying targeted selector-based querying with capped results, and it states the practical purpose of locating elements to click or type into.

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?

The description provides clear usage context: 'Use to locate the exact elements to click or type into, and to confirm what is actually on the page.' It does not explicitly name alternatives or state when not to use it, so it misses the top exclusions criterion, but the intended scenarios are unambiguous.

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