Skip to main content
Glama

browser_query

Extract multiple fields from all elements matching a CSS selector in the active or specified browser tab, avoiding repeated per-element script calls.

Instructions

Extract multiple fields from every element matching a CSS selector.

Much faster and cheaper than calling browser_js per element. The default fields cover the common ones (text, href, value, src, alt, id, name); pass fields=["text","data-foo","bounds","attrs"] to get arbitrary attributes or bounds/attrs/html extras.

Args: selector: CSS selector. fields: Field names to extract per element. Defaults to a useful set. limit: Max elements to return (capped at 500). tab_id: Optional tab; defaults to active.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
fieldsNo
tab_idNo
selectorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose the default field set, the 500-element cap, and that tab_id defaults to the active tab. It does not say what happens when nothing matches, whether it waits for elements, or the shape of the returned list, which is a gap for a no-annotation tool.

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?

Front-loaded with the core action and the performance rationale before the Args block, so the most decision-relevant content is first. The extra-fields sentence is somewhat dense but earns its place; nothing is filler.

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?

For a read-only extraction tool with no output schema and no annotations, the description tells the agent what each parameter does and what fields can be retrieved. It leaves the return structure and empty-match behavior implicit, but an agent has enough to call it 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 0%, so the description must compensate — and it does, covering all four params: selector, fields (with a concrete example including 'data-foo', 'bounds', 'attrs'), limit ('capped at 500'), and tab_id ('defaults to active'). It omits the limit default of 50 declared in the schema, leaving that one detail slightly ambiguous.

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 (Extract) and resource (multiple fields from every element matching a CSS selector), and explicitly contrasts itself with the sibling browser_js. An agent can tell this apart from browser_dom, browser_find, or browser_html without opening any 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?

Gives a clear reason to prefer this over browser_js ('much faster and cheaper than calling browser_js per element'), which is a real routing decision. It stops short of naming the other extraction siblings (browser_dom, browser_find, browser_page_text) or stating when this is the wrong choice.

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

Deploy Server

Other Tools