Skip to main content
Glama

assert_condition

Verify expected browser conditions (element presence, visibility, text, title, URL) and raise an assertion error when the expectation fails.

Instructions

Verify an expected browser condition and fail when it is not met.

Use this tool for explicit verification. Unlike check_condition, which simply reports True or False on the current state, assert_condition treats a failed expectation as an error. (Note that URL/title checks do not wait for the 'timeout'.)

Args: check: - "element_present": Verify selector identifies a present element. - "element_visible": Verify selector identifies a visible element. - "text_visible": Verify expected text is visible within selector, or within the whole HTML document when selector is omitted. - "title": Verify the exact page title. - "url": Verify the exact current URL. - "url_contains": Verify that the current URL contains expected. selector: Element selector for element_present, element_visible, and text_visible checks. expected: Expected text/title/URL value for text_visible, title, url, and url_contains. exact: For check="text_visible", require exact text rather than a substring. timeout: Maximum seconds to wait for element/text checks. (Ignored for title and URL checks.)

Returns: A confirmation when the expectation passes.

Raises: An assertion-related SeleniumBase exception when the expectation fails; the MCP error wrapper converts it to a descriptive result.

Tool selection: - Just inspect current state -> use check_condition. - Wait for a condition to become true -> use wait_for. - Verify that an expected condition is true -> use assert_condition.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
checkNoelement_visible
exactNo
timeoutNo
expectedNo
selectorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv1.2.5
    • removedInput schema / properties / timeout / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / timeout / type
      Added value: +"number"
  2. Addedv1.2.3

TDQS

A4.8/5.0
Behavior5/5

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

Because no annotations are present, the description carries the full disclosure burden and succeeds. It states that failed expectations raise an error, that URL/title checks ignore the timeout, that text_visible can fall back to searching the whole document, and that failures surface as a descriptive MCP error wrapper.

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?

The definition is moderately long but tightly organized into Intro, Args, Returns, Raises, and Tool selection sections. It front-loads the core behavior and sibling differentiation before details, and every section contributes actionable information without 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?

For its complexity, the description covers invocation semantics, per-check behavior, error/return behavior, and alternative-tool routing—enough for an agent to select and call it correctly. Residual gaps are the under-defined exact and timeout parameters, and the timeout note is never expanded into a full argument description.

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 0% schema coverage, the description enriches parameter meaning well: the check enum is fully explained, selector is scoped to three check types, and expected is mapped to four checks. However, 'exact' is described only by which checks it applies to, not what it does, and 'timeout' is never listed in Args—it appears only in a parenthetical caveat—so two of five parameters remain under-specified.

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 first sentence states a specific action and resource: 'Verify an expected browser condition and fail when it is not met.' It immediately contrasts with check_condition, which 'simply reports True or False on the current state,' so an agent can distinguish it from the most similar sibling without opening the 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?

A dedicated 'Tool selection' section provides explicit routing: use check_condition for inspecting current state, wait_for for waiting, and assert_condition for verifying an expected condition. This names alternatives and their exact trigger conditions, leaving no ambiguity.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seleniumbase/seleniumbase-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server