Skip to main content
Glama

check_condition

Check whether an element is present or visible, or whether text is visible, returning an immediate true/false for current page state.

Instructions

Check the current state of an element or text without waiting for the condition to become true.

Use this tool when you need an immediate boolean observation of the current page state. Use wait_for when the condition may become true later and the workflow should wait for it. Use assert_condition when the condition is an expected requirement and failure should be treated as an assertion error.

Args: check: The element state to inspect when text is not provided: - "present": Return True when at least one matching element exists. - "visible": Return True when the matching element is visible. Defaults to "visible". check is ignored when text is provided.

selector:
    CSS selector or SeleniumBase selector identifying the element to
    inspect. Defaults to "body". When `text` is provided, this also
    identifies the element whose visible text is checked.

text:
    Optional text to check for visibility within `selector`. When
    provided, this takes precedence over `check`; the tool checks text
    visibility instead of element presence or visibility. Use this when
    the question is "Is this text currently visible?" rather than
    whether the element itself is present or visible.

Returns: True or False indicating whether the requested condition is currently satisfied. Missing elements return False rather than raising an exception.

Tool selection: - Immediate boolean observation -> use check_condition. - Wait for an element or text condition to become true/false -> use wait_for. - Verify an expected condition and fail when it is not met -> use assert_condition. - Need the number or details of matching elements -> use find_elements. - Need to read the actual page or element content -> use get_content.

Notes: This tool does not intentionally wait for elements or text to appear. It is intended for checking the current state only. If page timing or asynchronous loading matters, use wait_for instead.

When `text` is provided, `check` is ignored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
checkNovisible
selectorNobody
Install Server

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly states that the tool does not intentionally wait, is for current-state checks only, and that text takes precedence over check. It could more explicitly state that a non-match returns False, but the 'boolean observation' phrasing and 'Return True when...' conditions make this largely clear.

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 front-loaded with the core purpose and then organizes usage guidance, arguments, and notes logically. It is slightly redundant because the note 'When text is provided, check is ignored' repeats the same statement from the parameter documentation, but every other sentence adds distinct value.

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 a simple boolean-observation tool with no output schema, the description covers parameters, return semantics, no-wait behavior, and sibling alternatives. It could be more complete by explicitly stating what happens when the selector matches no elements or by defining the returned value for the false case, but the coverage is strong overall.

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 fully compensates. It explains the check enum values ('present', 'visible') with return conditions, describes selector as a CSS or SeleniumBase selector defaulting to 'body', and clarifies that text is optional, takes precedence over check, and scopes the visibility check.

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 identifies the tool's purpose: checking the current state of an element or text and returning an immediate boolean observation. It names specific verbs and resources ('check', 'element', 'text') and distinguishes itself from wait_for and assert_condition, so an agent can differentiate it 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 provides explicit routing guidance: use wait_for when a condition may become true later, use assert_condition when failure should raise an assertion error, use find_elements for counts/details, and use get_content for reading actual content. This is comprehensive and leaves little to inference.

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