Skip to main content
Glama

find_element

Identify elements using visible text, tag, ARIA role, or nearby element, and retrieve the best CSS selector for reliable automation.

Instructions

Find elements by text content, tag, ARIA role, and/or proximity to another element, ranked by match quality. Returns {found, elements} with the best CSS selector for each. Use it to get a reliable selector from what you can see (e.g. a button's text) instead of guessing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagNoHTML tag filter (e.g. 'button', 'a', 'input')
nearNoCSS selector of a nearby element (find elements near this one)
roleNoARIA role filter (e.g. 'button', 'link', 'textbox')
textNoText content to search for (partial match)
session_idYesSession ID
max_resultsNoMax results (default: 5)
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It states that elements are 'ranked by match quality' and returns both a found flag and elements with best CSS selectors. It implies a read-only operation but does not elaborate on error cases or non-matching scenarios.

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?

Two sentences, first defines functionality, second provides usage rationale. Every word earns its place. No redundancy or fluff.

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?

Given the tool has 6 parameters and no output schema, the description covers the main purpose, return structure, and usage guidance. It lacks details on ranking order or max_results default, but is sufficient for basic use.

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 coverage is 100%, but the description adds value beyond schema by explaining that results are ranked and the best CSS selector is returned. It integrates the parameters into the purpose, adding context not present in the schema descriptions.

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 specific verb 'Find' and resource 'elements' with criteria (text, tag, ARIA role, proximity). It distinguishes from sibling tools by focusing on selector generation from visible attributes, stating 'use it to get a reliable selector from what you can see'.

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 description says to use this tool when you have visible cues like button text to avoid guessing selectors. It provides clear context but does not explicitly say when not to use it or mention alternatives among siblings.

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/segentic-lab/periscope-mcp'

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