Skip to main content
Glama

assert_condition

Verify expected browser conditions like element visibility, text, title, or URL, and fail the test when they aren't met. Use for explicit verification instead of passive checks.

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 burden and handles it well. It discloses that failed expectations are treated as errors, that raises an assertion-related SeleniumBase exception, and that the MCP error wrapper converts it to a descriptive result. It also clarifies that URL/title checks do not wait while element/text checks have a timeout, which is important behavioral nuance.

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 longer than minimal but well-structured with a clear intro, behavior distinctions, an Args block, and a Tool selection section. Nearly every sentence adds value; minor redundancy exists because 'URL/title checks do not wait' appears before being implicitly repeated in the wait_for selection bullet. Overall it is appropriately sized for 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?

Given five parameters, diverse check types, no annotations, and rich sibling relationships, the description covers all necessary input semantics, return behavior, and error behavior. The presence of an output schema means return value details need not be repeated, while the description still states there is a confirmation on success. An agent can correctly invoke this tool in the intended scenarios.

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%, but the Args section fully documents every parameter. Each check enum value has a behavioral explanation, conditional dependencies are specified (e.g., selector used for element/text checks, expected used for text/title/url checks), and the exact parameter is explained. The description fully compensates for the missing schema descriptions.

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 opens with a specific verb and resource: 'Verify an expected browser condition and fail when it is not met.' It clearly distinguishes itself from check_for_condition and wait_for, and the check enum values enumerate exactly which conditions are supported. An agent can understand what this tool does and how it differs from siblings.

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 explicit selection guidance: 'Just inspect current state -> use check_for_condition', 'Wait for a condition to become true -> use wait_for', and 'Verify that an expected condition is true -> use assert_condition.' It also notes that unlike wait_for, URL/title checks do not wait. This leaves no ambiguity about when to use the tool versus alternatives.

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-mcp'

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