Skip to main content
Glama

assert_visible

Verifies that a web element becomes visible within a timeout, such as a success banner or cart badge. Passes once displayed; fails if missing or hidden.

Instructions

Test step: check that an element becomes visible within timeoutMs, e.g. a success banner or a cart badge. Passes as soon as it is displayed; fails as a tool error if it is missing or stays hidden. Similar to wait_for_element with visible: true, but phrased as a pass/fail assertion.

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 become visible before failing, 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 become visible before failing, in milliseconds (default 10000)."
  2. First observedv0.1.2

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations present, the description carries the behavioral burden and does so well: it states the pass condition ('passes as soon as it is displayed') and the failure mode ('fails as a tool error if it is missing or stays hidden'). It does not say whether the page/browser state is preserved on failure or whether the error message identifies the selector, leaving a small gap for a mutation-adjacent, blocking assertion tool.

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, zero filler, front-loaded with the purpose, then the pass/fail semantics, then the sibling comparison. Every sentence earns its place.

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, but the description communicates the return-by-exception semantics directly, and the rich input schema covers parameters. What is missing is failure-side context (does the browser stay open, is a screenshot available after the tool error), which matters for an assertion tool inside a test flow.

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%, so the schema already documents the selector shape, locator strategies and timeoutMs bounds/default. The description adds only that the timeout governs 'becomes visible' timing, which is a minor enrichment over the schema's own text. Baseline 3 applies when the schema does the heavy lifting.

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+resource+condition: check that an element becomes visible within timeoutMs. It names concrete examples (success banner, cart badge) and explicitly distinguishes itself from the sibling wait_for_element and from the pass/fail assertion family (assert_text, assert_attribute).

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

Usage Guidelines4/5

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

Frames the tool as a 'test step' and explicitly contrasts it with 'wait_for_element with visible: true, but phrased as a pass/fail assertion', which tells the agent when to pick this over the wait tool. It stops short of spelling out the inverse condition (use wait_for_element when you don't want the run to fail), so selection guidance is clear but not exhaustive.

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