Skip to main content
Glama

assert_condition

Verify an expected browser condition and fail when unmet. Use for explicit checks of element presence, visibility, text, title, or URL, raising an assertion error on failure.

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 changedv4.53.7
    • removedInput schema / properties / timeout / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / timeout / type
      Added value: +"number"
  2. Addedv4.53.5

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral disclosure burden. It clearly states that failed expectations raise an assertion-related SeleniumBase exception, that the MCP error wrapper converts it to a descriptive result, and that URL/title checks ignore the timeout. This gives the agent an accurate model of the tool's control flow and failure modes.

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 well-organized with clear sections for purpose, arguments, return, exceptions, and tool selection. It is slightly redundant in places, such as repeating the verify-vs-wait distinction, but the structure makes the important information easy to find and the length is justified by the tool's complexity.

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 covers purpose, parameters, return value, exception behavior, timing caveats, and sibling-tool routing. Given the absence of annotations and complete lack of schema-level descriptions, this description alone is sufficient for an agent to select and invoke the tool correctly across all check types.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 fully explain all five parameters. It does so comprehensively: each check enum value is described, expected is mapped to the relevant check types, selector is scoped to element/text checks, exact is explained for text_visible, and timeout's conditional applicability is called out.

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's purpose: verify an expected browser condition and fail when it is not met. It explicitly differentiates assert_condition from check_condition by noting that a failed expectation is treated as an error, not a boolean result.

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?

The description provides explicit tool-selection guidance: use check_condition for inspecting current state, wait_for for waiting on a condition, and assert_condition for verifying an expected condition. It also notes the important exception that URL/title checks do not wait for the timeout, giving agents a clear operational boundary.

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'

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