Skip to main content
Glama

check_condition

Check the current state of an element or text, returning true or false for presence or visibility without waiting for conditions to change.

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.9/5.0
Behavior5/5

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

With no annotations, the description fully carries behavioral disclosure. It states that the tool does not wait, returns True or False, treats missing elements as False rather than raising, and ignores check when text is provided. These details go far beyond a generic 'check condition' summary.

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-structured with clear sections (Args, Returns, Tool selection, Notes) and the core purpose is front-loaded. However, it repeats 'check is ignored when text is provided' three times and restates the wait_for advice in multiple places, so it is slightly less concise than it could be.

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?

Despite having no output schema or annotations, the description covers the return value, error behavior for missing elements, defaults for all parameters, parameter interactions, and sibling routing. An agent has everything needed to choose and invoke the 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 has 0% description coverage, so the description must fully explain the parameters. It does: check defines both enum values and the default, selector defines the default and connection to text, and text explains precedence over check and the intended question it answers ('Is this text currently visible?').

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: 'Check the current state of an element or text without waiting' and frames itself as an 'immediate boolean observation.' It also explicitly differentiates from sibling tools by naming wait_for, assert_condition, find_elements, and get_content, so an agent can distinguish it without opening schemas.

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 direct when-to-use guidance ('Use this tool when you need an immediate boolean observation') and explicit alternatives: wait_for for conditions that may become true later, assert_condition for expected requirements, find_elements for counts/details, get_content for reading content. It also specifies when text should be used instead of element checks.

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