Skip to main content
Glama

Query elements

browser_query
Read-only

Find web elements by role, name, text, or CSS selector and get compact match details with visible/enabled state, bypassing full snapshots.

Instructions

Finds elements by role+name, visible text, or CSS, and returns a compact line per match including its ref and visible/enabled state. Use this instead of a full snapshot when you already know what you are looking for.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cssNoCSS selector to match.
nameNoAccessible name to match alongside role.
roleNoARIA role, e.g. "button".
textNoVisible text to match.
limitNoMax matches (default 10).
sessionIdYesSession id returned by browser_start.
Behavior4/5

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

The annotations already declare readOnlyHint=true, so no read-only disclosure is needed from the description. The description adds transparency by detailing the return format (compact line per match, including ref and visible/enabled state), which is not in the schema or annotations. It does not contradict 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?

The description is exactly two sentences with zero filler. The first sentence states the core functionality and return format; the second gives actionable usage advice. All information is front-loaded and necessary.

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 6-parameter tool with full schema coverage and read-only annotations, the description provides everything an agent needs to invoke it correctly: query modes, output structure, and when to prefer it over alternatives. No critical detail is missing given the absence of an output schema; the return format is explicitly stated.

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?

Although schema coverage is 100%, the description goes beyond mere parameter names by explaining the intended use of role and name together ('role+name'), and by grouping the three query modes. This is meaningful guidance that the schema properties alone do not convey. It does not fully duplicate schema descriptions for every parameter.

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 uses a specific verb ('Finds'), names the resource ('elements'), and specifies three search criteria (role+name, visible text, CSS) plus a defined output shape (compact line with ref, visible/enabled state). It also implicitly differentiates from sibling browser_snapshot by calling itself an alternative to a 'full snapshot', so an agent can distinguish it without opening the schema.

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?

It explicitly advises using this instead of a full snapshot when the target is known, which is clear usage guidance. It does not enumerate all alternatives (e.g., browser_read_text, browser_inspect_element), but the primary alternative is named and the selection condition is provided. That is sufficient for a read-only query tool.

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

Install Server

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/hofmeister/web-ui-tester'

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