Skip to main content
Glama

browser_query_elements

Extract webpage elements using CSS selectors to analyze structure, locate interactive components, and inspect form fields with tag names, text content, and HTML attributes.

Instructions

[Disabled] Query all elements matching a CSS selector and return their tag names, trimmed text content (first 200 chars), and specified HTML attributes. Useful for understanding page structure, finding interactive elements, and inspecting forms. Returns up to limit elements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYesTab ID of the page to query
selectorYesCSS selector to query
limitNoMax elements to return — defaults to 100
attributesNoAttribute names to extract — defaults to id, class, href, src, type, name, value, placeholder
Behavior4/5

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

With no annotations, the description carries full disclosure burden. It successfully flags the disabled status upfront, specifies the 200-character text truncation limit, and notes the limit-based pagination ('Returns up to limit elements'). Missing minor details like behavior on zero matches or specific return format structure (array vs object).

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?

Three tightly constructed sentences with zero waste. Critical information (disabled status, core function, truncation limit) is front-loaded. Each sentence serves a distinct purpose: capability definition, use case guidance, and output constraints.

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 4-parameter tool with 100% schema coverage and no output schema, the description adequately covers return value structure (tag names, text, attributes) and quantity limits. The disabled status is prominently noted. Could be improved by specifying the return format (e.g., 'array of element objects') but sufficient for agent operation.

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%, establishing a baseline of 3. The description references parameters ('limit', 'attributes', 'CSS selector') but adds minimal semantic detail beyond the schema's own descriptions ('Max elements to return', 'Attribute names to extract'). It connects 'limit' to output behavior ('Returns up to limit elements'), which provides slight value-add.

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 opens with '[Disabled]' status, then specifies the exact action (query elements by CSS selector) and return data (tag names, trimmed text content limited to 200 chars, specified attributes). It clearly distinguishes this from siblings like browser_click_element (inspection vs. interaction) and browser_get_tab_content (selective querying vs. full content retrieval).

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?

Provides explicit use cases: 'understanding page structure, finding interactive elements, and inspecting forms.' This implies when to use it (discovery/inspection phase) but lacks explicit 'when not to use' guidance or direct sibling comparisons (e.g., 'use browser_click_element to interact after querying').

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/opentabs-dev/opentabs'

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