Skip to main content
Glama

dom.query

Read-only

Find elements by CSS selector and return text, attributes, bounding box, and visibility for each match, enabling page inspection or UI-state verification.

Instructions

Find elements by CSS selector, with text, attributes, box and visibility for each match.

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": "dom.query"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
frame_idNo
selectorYes
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/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 usefully adds what each match returns (text, attributes, box, visibility), which substitutes for the missing output schema, but says nothing about truncation, the effect of limit, frame scoping, or auto-launching a browser.

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 the selector mechanism first and the return shape second; no wasted wording.

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?

The return-field disclosure compensates partly for the absent output schema, but for a five-parameter tool with 40% schema coverage there is no explanation of limit semantics, frame scoping, or browser auto-launch behavior, which an agent needs before calling it reliably.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 40% schema description coverage across five parameters, the description carries real burden but only restates that selector is a CSS selector. limit, frame_id, and the interaction between target_id and browser_id get no explanation in either the schema or the description.

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 a specific verb (find) and resource (elements by CSS selector) and previews the per-match payload (text, attributes, box, visibility). It is distinguishable from siblings like dom.get_html or dom.summary, though it does not explicitly contrast with them.

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?

Usage is only implied: an agent can infer this is the tool for locating DOM nodes, but there is no explicit when-to-use or when-not guidance, no mention of when to prefer dom.inspect or dom.get_html, and no stated prerequisites for frame/page targeting.

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