Skip to main content
Glama

dom_query

Query page elements by CSS selector and retrieve tag, text, classes, attributes, geometry, and real visibility. Request computed styles or search inside iframes to inspect single-page app content.

Instructions

Query elements by CSS selector and return tag, id, classes, text, attributes, geometry and real visibility. Ask for computed styles by naming the properties you want. Set frame:'all' to search inside iframes too — single-page apps often render the screen you care about in a child frame.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameNo'main' (default), 'all', or a substring of a frame's origin/name.main
limitNoMaximum elements to return.
fieldsNoRestrict the returned keys, e.g. ['tag','id','text','visible'].
stylesNoComputed style properties to read, e.g. ['display','zIndex','color'].
selectorYesCSS selector.
include_htmlNoInclude a truncated outerHTML for each match.
visible_onlyNoDrop elements that are not actually rendered.
include_attrsNoInclude every HTML attribute of each match. Off by default: attributes dominate the response on real apps.
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden for behavior, and it delivers: it explains computed style access on demand, iframe search with practical reasoning, and 'real visibility' as a distinct concept. It does not mention response limits, but the schema covers those details.

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 core function and return data, and no wasted words. The second sentence adds actionable usage guidance efficiently.

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?

Given eight parameters and no output schema, the description covers the most decision-critical behaviors: selector querying, return fields, computed styles, and iframe search. The schema fully documents the remaining parameters, so an agent has enough context to call this tool correctly.

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

Parameters4/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 adds value beyond the schema by explaining the rationale for frame:'all' in single-page apps and clarifying how the styles parameter should be used. This is extra guidance, not just restatement.

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 states a specific verb and resource: 'Query elements by CSS selector' and enumerates the rich set of returned data (tag, id, classes, text, attributes, geometry, visibility). This clearly separates it from sibling tools like dom_get_html or dom_list_frames, which have different scopes.

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, such as setting frame:'all' to search inside iframes and asking for computed styles by naming properties. It does not explicitly name alternatives or state when not to use this tool, but the guidance is strong enough to steer an agent effectively.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dayananda-D/Devcdp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server