Skip to main content
Glama
ZenRows
by ZenRows

browser_query_selector_all

Read-only

Find all elements matching a CSS selector in a browser session and return their text, HTML, and attributes.

Instructions

Find all elements matching a CSS selector and return their text, HTML, and attributes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector to query
session_idYesSession ID returned by browser_navigate

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.7.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is covered. The description adds the useful fact that it returns text, HTML, and attributes, but says nothing about behavior on zero matches, whether it waits for elements, result caps, or pagination.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single well-formed sentence with no filler, and the operation ('find all matching elements') is front-loaded ahead of the return payload. It is efficient, though it could spend one more clause on disambiguation rather than staying this terse.

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?

With no output schema, the description sensibly enumerates the returned fields (text, HTML, attributes), which is genuinely needed. However, for a browser-query tool in a large sibling set, it omits key context such as empty-result behavior and whether it requires the page to be already loaded.

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%, so both session_id and selector are already documented at the schema level. The description adds no syntax, format, or defaulting detail beyond what the schema provides, making 3 the correct baseline.

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 gives a specific verb ('find all elements matching a CSS selector') plus the resource and the payload returned ('text, HTML, and attributes'), so an agent knows exactly what it does. It does not, however, distinguish itself from near-neighbours like browser_get_text or browser_get_html, which also retrieve element content.

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

Usage Guidelines2/5

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

There is no statement of when to prefer this over browser_get_html, browser_get_text, browser_get_attribute, or browser_wait_for_selector. The intended use (bulk multi-element retrieval by selector) must be inferred from the name and the word 'all'.

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