Skip to main content
Glama

dom_query

Extract properties from the first DOM element that matches a CSS selector in a browser tab using the Chrome DevTools Protocol, solving the need to quickly inspect specific page elements.

Instructions

Query the first element matching a CSS selector and return its properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector to query
targetIdYesTarget ID of the tab

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only says 'Query... return its properties' without stating whether the operation is read-only, what happens if no element matches, or what 'properties' includes. This is a significant gap for a tool with no safety annotations.

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 no waste. It clearly communicates the core action and outcome in a compact form, ideal for quick parsing.

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?

With no output schema and no annotations, the description should clarify return shape (which properties, format) and behavior on no match. It also leaves the distinction from dom_query_all implicit. The description is too sparse for an agent to invoke it reliably in varied scenarios.

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%: both selector and targetId have descriptions. The tool description adds little beyond the schema, but baseline 3 applies because the schema already documents the parameters adequately.

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?

States a specific verb ('Query') and resource ('first element matching a CSS selector'), and explicitly says it returns properties. The qualifier 'first element' distinguishes it from sibling dom_query_all, which presumably queries all matching elements.

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 phrase 'first element' implies a targeted single-element lookup, but the description never mentions alternatives like dom_query_all or provides when-not-to-use guidance. There is no explicit routing to siblings, so usage is only implied rather than clarified.

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