Skip to main content
Glama

check_for_condition

Inspect the current state of an element or page immediately. Returns boolean status for presence, visibility, or visible text, or an integer count of matching elements, without waiting for conditions.

Instructions

Immediately inspect the current state of an element or page.

Use this tool when you need an observation of the current state and do NOT want to wait for a condition. For waiting behavior, use wait_for. For an expectation that should fail as an assertion, use assert_condition.

Args: check: - "present": Return whether at least one matching element exists. - "visible": Return whether the matching element is visible. - "count": Return the number of matching elements. This check may wait up to 1 second for a match. - "text_visible": Return whether the specified text is visible within the selected element. Requires text. selector: CSS selector or SeleniumBase selector for the element. Defaults to "body". text: Text to check when check="text_visible".

Returns: A boolean for present/visible/text_visible, or an integer count for count. Missing elements do not cause an exception for these checks.

Tool selection: - Immediate yes/no/count observation -> use check_for_condition. - Wait until a state becomes true/false -> use wait_for. - Verify an expected condition and fail when it is not met -> use assert_condition.

Note: Except for count's short lookup, this tool does not wait for elements to appear. Use wait_for when page timing matters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
checkNovisible
selectorNobody
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 it delivers: it discloses that this tool does not wait for elements (except count's 1-second lookup), that missing elements do not raise exceptions, and that results are booleans or an integer. It also clarifies the return semantics per check type.

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 and front-loads the key differentiator. However, the guidance not to wait is repeated in the opening summary, the tool-selection bullet, and the final note, which is slightly redundant even though it emphasizes the point.

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?

There is no output schema, but the description explicitly states the return type for each check and covers edge behavior like missing elements. Combined with the parameter explanations and sibling routing, an agent has everything needed to invoke this tool correctly.

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?

The schema descriptions provide 0% coverage, but the tool description fully compensates: it defines each check enum value, explains the selector default ('body'), and notes that text is required for text_visible. This adds semantic meaning well beyond the raw JSON schema.

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 action—'Immediately inspect the current state of an element or page'—and enumerates the concrete check modes (present, visible, count, text_visible). It also names sibling tools wait_for and assert_condition, making the tool's distinct purpose immediately clear.

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 explicitly maps immediate checks to this tool, waiting behavior to wait_for, and assertion-style checks to assert_condition. The note about count's short wait further clarifies when timing matters, leaving no ambiguity about 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