Skip to main content
Glama

assert_condition

Verify an expected browser condition and fail when not met, treating failed expectations as errors. Use for explicit verification of element presence, visibility, text, title, or URL.

Instructions

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

Use this tool for explicit verification. Unlike check_for_condition, which simply reports True or False on the current state, assert_condition treats a failed expectation as an error. Unlike wait_for, URL/title checks do not wait.

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.

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_for_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
Install Server

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 burden. It discloses the assertion-failure exception path, the early-return vs timeout behavior, and the exact-match option for text_visible, and it clarifies no waiting for URL/title checks.

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 long because it compensates for absent schema parameter docs, but it is front-loaded with the summary and sibling differentiation. The Args and Tool selection sections are organized and mostly non-redundant, though a slight trim of repeated selection guidance would make it tighter.

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?

For a five-parameter tool with no annotations and zero schema coverage, the description covers what eachn parameter means, when to choose the tool, what it returns, and what exception path to expect. The output schema handles return-value details, so nothing essential is missing.

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% for the five parameters, so the description must document them all, and it does. It explains each check enum value and the role of selector, expected, exact, and timeout, including optionality context.

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 opening sentence uses a specific verb (Verify) and resource (browser condition) and states the failure behavior ('fail when it is not met'). It explicitly contrasts with sibling tools check_for_condition and wait_for, making the tool's identity unmistakable.

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 gives clear selection rules: use check_for_condition to inspect current state, use wait_for to wait, and use assert_condition to verify a condition. It also warns that unlike wait_for, URL/title checks do not wait, so an agent can choose correctly before calling.

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

Other Tools

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