Skip to main content
Glama

ui.wait_for

Wait for a UI element to appear or disappear to handle loading, popups, or page transitions. Returns ok=false if the timeout expires.

Instructions

轮询等待选择器出现/消失(等弹窗、加载完成、页面跳转),超时返回 ok=false

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pkgNo包名(id 短名补全用)
goneNotrue=等待其消失
timeoutNo最长等待秒数
selectorYesGKD 选择器

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses failure semantics ('超时返回 ok=false'), which is real value, but says nothing about polling interval, blocking behavior, or whether it throws versus returns. Adequate but incomplete for an annotation-free tool.

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?

A single compact sentence front-loads purpose, adds concrete use cases, and closes with failure behavior. Zero waste; every clause earns its place.

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 no-annotation, no-output-schema tool with four well-documented params, the description covers purpose, typical scenarios, and timeout outcome. It could do slightly more (e.g., polling cadence or selector format), but an agent has enough to call it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all four parameters (pkg, gone, timeout, selector) with defaults and meaning. The description only mirrors the appear/disappear concept already captured by the 'gone' parameter, adding no syntax or format detail beyond the schema. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb+resource ('轮询等待选择器出现/消失' – poll-wait for selector appear/disappear), which is more precise than the bare name. It doesn't explicitly contrast with close siblings like app.wait_idle, events.wait, or ui2.wait_change, so it stops short of full differentiation.

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

Usage Guidelines3/5

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

The parenthetical scenarios ('等弹窗、加载完成、页面跳转' – popups, loading complete, page navigation) give concrete when-to-use context. However, no alternatives or when-not conditions are given, so an agent must infer the choice between this and app.wait_idle/ui2.wait_change.

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