Skip to main content
Glama

check_for_condition

Check an element's current state immediately: presence, visibility, visible text, or count. Returns a clear yes/no or number without waiting for page changes.

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

A5/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 immediate behavior, the 1-second wait exception for count, that missing elements do not throw exceptions, and the return type per check. This goes well beyond the schema and informs the agent of important runtime semantics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with a one-line summary, usage guidance, parameter docs, return semantics, and sibling comparisons. It is longer than some definitions, but every section earns its place by addressing a distinct decision or behavioral question.

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 3-parameter tool with no annotations and no output schema, the description is complete: it covers purpose, parameter semantics, return values, exception behavior, and tool selection relative to siblings. An agent has everything needed to invoke it 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?

Schema coverage is 0%, so the description compensates by explaining every field. It defines each enum value for check, documents selector's default 'body', and clarifies that text is required only when check='text_visible'. This adds meaning that the bare input schema lacks.

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: 'Immediately inspect the current state of an element or page.' It further differentiates itself from wait_for and assert_condition by framing this as an immediate observation tool, so an agent can distinguish it from its siblings without inspecting 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?

Usage guidance is explicit: 'Use this tool when you need an observation... do NOT want to wait' and it names alternatives ('For waiting behavior, use wait_for', 'For an expectation... assert_condition'). The Tool selection section reinforces these decision rules, giving clear when-to-use and when-not-to-use guidance.

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