Skip to main content
Glama

find_elements

Read-onlyIdempotent

Find elements matching a CSS selector and return count plus details for up to 20 matches, helping debug selector issues and inspect page structure; optionally include hidden elements.

Instructions

[Agent Browser] Find elements matching a selector and return details about each. Useful for debugging selector issues or understanding page structure. Returns: count, and details about each matching element (max 20). When include_hidden=False, only visible elements are counted and returned.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "find_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorYes
include_hiddenNo

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuine behavior beyond that: a hard cap of 20 returned elements and the fact that hidden elements are excluded from both the count and the results when include_hidden=False.

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?

Four short lines, front-loaded with purpose followed by use case, return shape, and flag semantics. No filler; slight redundancy between 'matching' in line one and the visibility rule in line four.

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?

An output schema exists, so return values need not be spelled out, and the description nonetheless states the return shape and the 20-item truncation. For a two-parameter read-only lookup this is nearly complete, with selector syntax the only meaningful omission.

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?

Schema description coverage is 0%, so the description must compensate. It fully explains include_hidden's default-false filtering semantics, but says nothing about what selector syntax is accepted (CSS, XPath, text), which is the single most important parameter to get right.

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?

States a specific verb and resource ('Find elements matching a selector') plus what it returns ('details about each'), which is clear on its own. It does not differentiate against close siblings such as count or find_relative, so an agent must infer the boundary itself.

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

Usage Guidelines3/5

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

'Useful for debugging selector issues or understanding page structure' gives a real when-to-use signal. However, it never says when not to use it and names no alternative for counting or relative lookup, so guidance is implied rather than explicit.

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