Skip to main content
Glama

check_state

Check whether a page element is present, visible, or matches text, or count matching elements. Returns the result immediately without waiting or raising errors.

Instructions

Check the current state of the page or an element. Unless setting 'count', where it may wait up to 1 second, this never waits. Never raises exceptions — use wait_for if you want to wait for a state. For 'count', if there are no matching elements, then it waits up to 1 second for a single match to appear. If no matches after 1 second, then 'count' returns 0. Args: check: 'present', 'visible', 'count', 'text_visible'. (text_visible requires value for text.) selector: The CSS Selector for the chosen check. text: The text to use for the text_visible check.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
checkNovisible
selectorNobody
Behavior4/5

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

With no annotations, the description carries the behavioral burden, and it discloses non-waiting behavior, exception-free behavior, and the count timeout semantics. It does not state the return value for the other check modes, which is a meaningful gap for a check tool.

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

Conciseness3/5

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

The description is front-loaded and uses a compact Args list, but the count-waiting behavior is explained twice: once as 'Unless setting count...' and again in the detailed 'For count' passage. This redundancy makes it less tight than it could be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only check with no annotations or output schema, it covers parameter meanings and exception/timeout behavior well. However, the lack of a return-value contract for non-count checks means an agent cannot fully predict what the tool will produce.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Since schema descriptions cover 0% of the parameters, the description compensates by explaining all three: check values, selector as a CSS selector, and text used for text_visible. It also notes the dependency that text_visible requires text, though it does not precisely define 'present' versus '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 first sentence names a specific operation, 'Check the current state of the page or an element', and the Args list enumerates concrete state types: present, visible, count, text_visible. It also contrasts with wait_for, making the intended use clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'this never waits' except for count and 'Never raises exceptions — use wait_for if you want to wait for a state', which is strong routing to an alternative. However, it does not address when to use sibling tools like assert_that or find_elements, so the guidance is not fully exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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