Skip to main content
Glama

find_element

Waits for a selector to exist, then returns the element's tag, visible text, and whether it is displayed and enabled. Use it to verify a selector or inspect an element before acting.

Instructions

Look up one element and describe it: tag, visible text, and whether it is displayed and enabled. Waits for it to exist. Use it to confirm a selector matches the intended element, or to inspect an element before acting. To discover elements without knowing a selector, use capture_page; to wait for something to appear, use wait_for_element.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesHow to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector.
timeoutMsNoHow long to wait for the element to exist, in milliseconds (default 10000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.0
    • addedInput schema / properties / selector / description
      Added value: +"How to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector."
    • addedInput schema / properties / selector / properties / by / description
      Added value: +"Locator strategy: css, xpath, id, name, class/className, tag/tagName, linkText, or partialLinkText."
    • addedInput schema / properties / selector / properties / value / description
      Added value: +"The locator for that strategy, e.g. '#login-button' for css, 'user-name' for id, or //button[@type=\"submit\"] for xpath."
    • addedInput schema / properties / timeoutMs / description
      Added value: +"How long to wait for the element to exist, in milliseconds (default 10000)."
  2. First observedv0.1.2

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose two non-obvious behaviors: it blocks until the element exists, and it reports existence state plus displayed/enabled flags. It does not say what happens when the element never appears (error type, mention of timeoutMs as the bound), which is the one meaningful gap for a waiting lookup.

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?

Three sentences, all load-bearing: what it returns first, then when to use it, then the two sibling alternatives. No restatement of the name or filler.

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?

No output schema exists, so the description usefully enumerates the returned fields, which is the right compensation. For a selector-based lookup with a fully documented schema, the only unstated item is failure behavior on timeout, a minor completeness gap.

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 100% and both parameters (nested selector with by/value, timeoutMs) are fully documented in the schema itself. The description only implicitly touches timeoutMs via 'waits for it to exist' and adds no locator-strategy guidance beyond what the schema already gives.

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?

States a specific verb and resource ('look up one element') plus the exact return fields (tag, visible text, displayed/enabled), which no sibling provides. It also names the two siblings an agent might confuse it with, so the tool is distinguishable without opening any schema.

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?

Gives explicit use cases ('confirm a selector matches the intended element, or inspect an element before acting') and explicit alternatives with the condition that selects them: capture_page when no selector is known, wait_for_element when only waiting is needed. Nothing is left to inference.

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