Skip to main content
Glama

wait_for_condition

Poll until element visible/hidden, text present, or URL contains; then return last state snapshot without throwing on timeout. Use to wait for success messages after form submission.

Instructions

等待页面条件成立(轮询),超时返回最后一次状态快照、不抛错。condition:element_visible(selector 可见,默认)/element_hidden(selector 不可见或不存在)/element_has_text(selector 可见文本包含 expected_text,exact=True 精确相等)/text_present(目标 iframe 或全部 frame 页面文本出现 expected_text)/url_contains(URL 包含 expected_text)。典型用法:提交表单后 wait_for_condition(condition='text_present', expected_text='新增成功', timeout_ms=10000) 等成功消息出现,再断言收尾。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exactNo
selectorNo
conditionNoelement_visible
timeout_msNo
expected_textNo
iframe_selectorNo
poll_interval_msNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

There are no annotations, so the description carries the full burden of behavioral disclosure. It reveals important behaviors: it polls, returns the last status snapshot on timeout, and does not throw. It also defines condition semantics (element_hidden matches invisible or non-existent, text_present searches iframe or all frames). This goes beyond simple safety hints and adds meaningful context.

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 dense but well-structured: a purpose statement, a colon-separated list of conditions with parameter meanings, and a practical example. Every clause adds value, with no fluff. The front-loaded purpose and clear list make it highly scannable despite the length.

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?

Given the tool's complexity (5 condition types, 7 parameters, no annotations, output schema exists), the description covers critical aspects: use case, condition semantics, timeout behavior, and return value. It does not explain edge cases like invalid conditions or the exact contents of the status snapshot, but the output schema likely handles return structure. Overall it is quite complete for a wait utility.

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?

The input schema has no descriptions (0% coverage), but the description explains the meaning of most parameters. It details condition values and how they interact with selector, expected_text, exact, and timeout_ms. It also implies iframe_selector via 'target iframe' and uses example syntax. However, it omits poll_interval_ms and does not specify the structure of the returned status snapshot, so it is not fully complete.

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 states the tool's function: 'wait for condition to be true (polling)'. It enumerates all supported condition types (element_visible, element_hidden, element_has_text, text_present, url_contains), making the scope explicit. The verb+resource is specific, and the list distinguishes it from sibling automation tools like click_interact or fill_input.

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 provides a concrete typical use case: 'after submitting a form, wait_for_condition(condition='text_present', expected_text='新增成功', ...)' and explains that you should wait for the success message before assertion. It does not explicitly name alternatives or exclusions, but the example conveys clear context for when this tool is appropriate.

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/hooplus1ce/qa-automation-mcp-plugin'

If you have feedback or need assistance with the MCP directory API, please join our Discord server