Skip to main content
Glama

find_elements

Locate web elements by CSS selector or visible text, returning their tag names, text, and optional outer HTML for easier DOM inspection and browser automation.

Instructions

Find element(s) matching a CSS selector or visible text, and return their tag name, text, and outer HTML (optional). Args: selector: CSS selector, or text to search for (CDP mode can match elements by visible text as well as by selector, e.g. 'a:contains("Sign in")'). timeout: Seconds to wait for at least one match to appear. include_html: Whether to include the html with each matching element. Returns a dict with 'count' (total matches found) and 'matches' (a list of {tag_name, text, html} dicts, or {tag_name, text} dicts if not including html).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNo
selectorYes
include_htmlNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the waiting behavior (timeout), the selector flexibility (CSS or visible text with CDP example), and the return structure (count and matches). A notable gap is that it does not state what happens when no element matches after timeout (e.g., empty list vs. error), but overall it provides meaningful behavioral detail beyond a simple one-liner.

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-organized with a concise summary sentence followed by a structured Args section and a clear Returns explanation. Every sentence contributes information, and the example selector adds practical value without unnecessary verbosity.

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 find operation, the description covers the main invocation details: selector, timeout, include_html, and return format. It does not mention error handling or explicit non-mutating behavior, but those are less critical given the tool's find-oriented purpose and the presence of an output schema. Overall it is sufficiently complete for correct use.

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 description must fully compensate, and it does. Each parameter is explained with purpose and examples: selector supports CSS/text and includes a usage example, timeout specifies seconds to wait, and include_html clarifies the output shape. This adds substantial meaning beyond the bare schema property names.

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 clearly identifies the operation: 'Find element(s) matching a CSS selector or visible text' and specifies the returned data (tag name, text, outer HTML). This is a specific verb and resource, and it differentiates from siblings like get_page_content or get_attributes by focusing on selector-based element lookup. However, it does not explicitly name or compare itself to sibling tools, so it stops short of full sibling differentiation.

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?

The Args section provides clear context for when to use the tool, explaining selector matching modes, timeout behavior, and optional HTML inclusion. There is no explicit 'when not to use' or named alternative, but the purpose is clear enough for an agent to infer appropriate usage. It lacks explicit exclusions, so it does not reach a 5.

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/seleniumbase/seleniumbase-mcp'

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