Skip to main content
Glama
KitchenSink4AI

KitchenSink4Web

Official

Find Elements

find_elements
Read-only

Locate web elements by text, role, CSS, XPath, or natural-language description and return actionable references, with ambiguous matches listed and nearest misses shown for quick recovery.

Instructions

Find elements by text, role plus accessible name, natural-language description, CSS, or XPath, and get back refs you can act on plus a note on what was not searched. role='button' narrows any query to one element role (field finding: 'Comment' alone matched 12; with the role filter it matches the one button). This is the cheap targeted follow-up that pairs with get_page_view: the page view tells you what string to look for, and this retrieves it for a fraction of a full read. Ambiguous results are listed rather than resolved, and zero results come back with the nearest misses so a miss is a one-turn recovery. The search covers the main document and every open shadow root in it, and the matches it returns from a shadow root are actable like any Same-origin iframes are searched too and the result says which ones it entered. Two things stay out and the result counts both: cross-origin iframes, which no tool here opens, and closed shadow roots, which no tool can reach. XPath is the one kind that does not enter a shadow root. location={'region': 'r7'} (or a ref, form, or table from a read) narrows the search to that subtree, components inside it included, and the first result line names the scope that was searched.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoauto
pageYes
roleNo
limitNo
queryYes
locationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

With readOnlyHint=true and openWorldHint=true, the annotations cover safety, but the description adds substantial behavioral detail: ambiguous results are listed rather than resolved, zero results return nearest misses, searches cover shadow roots and same-origin iframes, and XPath does not enter shadow roots. This goes far beyond the annotations and helps the agent predict edge-case behavior.

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 long but dense and front-loaded: the core purpose appears in the first sentence, followed by the role-filter example, pairing guidance, ambiguity behavior, scope limitations, and location narrowing. Each sentence earns its place, though the paragraph-style formatting and minor punctuation issues slightly hurt scannability.

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 six-parameter tool with no output schema, the description gives a strong picture of inputs, scope, limitations, and result behavior (refs, notes on what was not searched, nearest misses, scope named in the first result line). Missing details like what 'kind' does and how pagination/limit behaves keep it from being fully complete, but the essential invocation context is present.

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?

The input schema has 0% description coverage, so the description carries the full burden for parameter explanation. It does explain query, role, and location well (including an example for role and a location example), but it never mentions the required 'page' parameter, nor does it explain 'kind' or 'limit' beyond the default. This is a meaningful gap for a tool with two required parameters.

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 a specific verb and resource: 'Find elements by text, role plus accessible name, natural-language description, CSS, or XPath.' It clearly distinguishes this tool from get_page_view by calling it a 'cheap targeted follow-up,' so an agent knows it is a retrieval/search action rather than a comprehensive read.

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 explicitly positions this tool relative to get_page_view: 'the page view tells you what string to look for, and this retrieves it for a fraction of a full read.' It also specifies scope exclusions (cross-origin iframes, closed shadow roots) and when XPath behaves differently, giving the agent concrete guidance on when this tool is appropriate.

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