Skip to main content
Glama

query_dom

Query specific elements like form fields, buttons, or error messages via CSS selector to get their tag, text, attributes, and visibility—without reading the whole page.

Instructions

Inspect specific elements: tag, text, attributes, size, visibility.

Use this instead of reading the page when the question is about particular elements — form fields, buttons, error messages, option lists.

Args: selector: CSS selector. tab_id: Exact tab id. Prefer url_pattern. url_pattern: Regex matched against tab URLs. limit: Maximum elements to return. attrs: Only report these attributes. Defaults to a useful set (id, name, type, href, value, placeholder, role, aria-label, data-testid, class) plus disabled/checked/selected state. text_max: Truncate each element's text at this many characters. visible_only: Skip elements that are not rendered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attrsNo
limitNo
tab_idNo
selectorYes
text_maxNo
url_patternNo
visible_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It communicates read-only intent via 'Inspect' and 'instead of reading the page', and it details behavior like truncating text and skipping non-rendered elements. It does not explicitly state 'does not modify the page' or cover rate/auth limits, but for a DOM inspection tool the implication is strong enough.

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?

The description is well structured: a one-line purpose, a sentence on when to use it, then a compact Args list. Every sentence contributes, and the most important scoping guidance is front-loaded before parameter details.

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?

The description covers all parameters, usage, and output fields, and the output schema exists to specify return values. However, the relationship between tab_id and url_pattern is not fully specified (what happens if both or neither are provided), which leaves a small gap for correct invocation in multi-tab scenarios.

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

Parameters5/5

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

Schema description coverage is 0%, so the parameter explanation is critical. The Args section explains all seven parameters with meaningful semantics: url_pattern is 'Regex matched against tab URLs', attrs defaults to a useful attribute set, text_max truncates text, and visible_only skips non-rendered elements. This exceeds baseline.

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?

Description opens with a specific verb and resource: 'Inspect specific elements' and enumerates the kinds of data returned (tag, text, attributes, size, visibility). It also distinguishes this from reading the whole page by stating it is for particular elements such as form fields and buttons, which separates it from siblings like read_tab.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit usage guidance is present: 'Use this instead of reading the page when the question is about particular elements — form fields, buttons, error messages, option lists.' This names the alternative (reading the page) and the triggering condition, so an agent can decide when to call it.

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