Skip to main content
Glama
KitchenSink4AI

KitchenSink4Web

Official

find_elements

Read-only

Locate web page elements by text, role, CSS, XPath, or natural language, with filters for role and location, covering shadow DOM and same-origin iframes to get actionable refs.

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.8/5.0
Behavior5/5

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

The description goes far beyond the readOnlyHint annotation by detailing search scope (main document, shadow roots, same-origin iframes), exclusions (cross-origin iframes, closed shadow roots), behavior for ambiguous and zero results, and how location narrowing works. This provides rich behavioral transparency that annotations alone could not convey.

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 lengthy but information-dense, with each sentence contributing value. It opens with the core purpose, then adds a concrete example, usage guidance, and detailed behavioral notes in a logical flow. While slightly long, it is well-structured and front-loaded with the most critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is comprehensive for a read-only element-finding tool: it explains output (refs and notes on what wasn't searched), ambiguity handling, scope of search, limitations, and how to narrow via location. Despite no output schema, the agent receives enough information to call the tool correctly and interpret results.

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?

With schema description coverage at 0%, the description compensates by explaining the 'role' parameter ('narrows any query to one element role'), the 'location' parameter (region, ref, form, table narrowing), and implying 'kind' via the listed search methods. It does not explicitly define the 'kind' enum values or explain 'page' and 'limit', but the core parameters are meaningfully clarified beyond the bare schema.

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 the tool finds elements via text, role, natural-language description, CSS, or XPath, and returns actionable refs plus a note on what wasn't searched. It also distinguishes itself from sibling get_page_view by positioning it as a cheap targeted follow-up, making its purpose unambiguous.

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?

Explicitly names get_page_view as the complementary tool and specifies when to use this tool ('the cheap targeted follow-up'). It also explains how ambiguity and zero results are handled, giving clear context for expected behavior in common scenarios.

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