Skip to main content
Glama

find_elements

Locate page elements by visible text, CSS selector, ARIA role, or screen region. Returns compact matches with unique IDs; AND/OR combine criteria.

Instructions

Deterministic search by visible text, CSS selector, ARIA role, and/or screen region → compact uid-keyed matches; anchors include their resolved href, so find_elements{role:'link'} lists the page's links WITH destinations (then navigate to browse them). Criteria are AND-combined by default; pass match:'any' for a union (OR) when over-specifying returns nothing, and visibleOnly:false to include display:none/hidden elements. Use to locate the element a user described in words ('the Subscribe button', 'the header nav') before inspecting it. Prefer this (or page_snapshot) over guessing a selector. For a point in a screenshot use node_at_point; to have the human physically click the element use pick_element.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleNoARIA role: explicit [role] attribute or tag-implied (link, button, heading, navigation, …)
textNoCase-insensitive substring of the element's own text
limitNo
matchNo'all' (default): AND — an element must satisfy every criterion. 'any': OR — union of elements matching any single criterion, de-duplicated. Use any when over-specifying returned nothing.all
regionNoViewport rectangle (CSS px) the element must intersect
selectorNoCSS selector, matched via querySelectorAll
visibleOnlyNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.6.1

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses key behaviors: criteria are AND-combined by default, match:'any' enables OR, visibleOnly:false includes hidden elements, anchors include resolved href. It does not mention potential side-effects (e.g., scrolling) or confirm it is read-only, but as a search tool the transparency is high.

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?

The description is a single dense paragraph with clear logical flow: output statement, example, criteria details, usage recommendation. It is front-loaded with the core purpose. While efficient, it could be slightly more concise by removing one clause, but overall it is well-structured.

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?

The tool has 7 parameters including a nested region object and no output schema. The description covers search criteria, combination modes, visibility, region intersection, and provides usage context. It lacks explicit output format details (beyond 'compact uid-keyed matches') but the overall completeness is high for a search tool.

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 71%, so baseline is 3. The description adds semantic value beyond the schema by explaining the AND/OR combination logic ('Criteria are AND-combined by default; pass match:'any' for a union (OR) when over-specifying returns nothing') and the anchor href inclusion. This provides practical usage context the schema alone does not.

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 clearly states it performs a 'deterministic search' using explicit criteria (visible text, CSS selector, ARIA role, screen region) and outputs 'compact uid-keyed matches'. It distinguishes itself from sibling tools like node_at_point (point in screenshot) and pick_element (physical click) by naming them directly.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'Use to locate the element a user described in words ... before inspecting it. Prefer this (or page_snapshot) over guessing a selector.' It also gives clear exclusions: 'For a point in a screenshot use node_at_point; to have the human physically click the element use pick_element.' This is comprehensive.

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

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/mi60dev/visionaire-engine'

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