Skip to main content
Glama
weapp-driver-mcp

weapp-driver-mcp

by Gao12123

Wait for a mini program condition

mp_wait

Waits with a hard deadline until an element appears or disappears, text contains a string, the page reaches a path, or page data equals a value. On timeout it reports the last observation, replacing fixed sleeps before assertions.

Instructions

Wait until an element appears or disappears, an element text contains a string, the page reaches a path, or a page data path equals a value — with a hard deadline. On timeout it reports what was observed last, so you can tell a slow render from a wrong expectation. Use this instead of sleeping a fixed time before an assertion.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "condition": "<condition>"
    },
    "name": "mp_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoPage route for page_path, or the data path for page_data (e.g. "form.submitted").
textNoSubstring the element text must contain, for text_contains.
xpathNoTreat selector as XPath.
poll_msNoInterval between checks. Defaults to 250.
expectedNoValue the data path must equal, for page_data. Compares with strict JSON equality.
selectorNoElement selector, required by selector_present/selector_absent/text_contains.
conditionYesWhat to wait for: selector_present, selector_absent, text_contains, page_path, page_data.
timeout_msNoDeadline for the condition. Defaults to 15000.
container_selectorNoResolve this first and search inside it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key behaviors: blocking until a condition, a hard deadline, and that on timeout it 'reports what was observed last, so you can tell a slow render from a wrong expectation.' That timeout-reporting semantics is genuinely valuable and not inferable from the schema. It leaves unstated whether a timeout is an error or a normal return, and what a successful wait returns (there is no output schema).

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?

Two sentences, zero waste, and the capability statement plus deadline is front-loaded before the timeout-reporting rationale and the usage rule. 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 9-parameter, five-mode polling tool with no output schema, the description covers what is waited for, the deadline concept, and the timeout outcome, which is the information an agent most needs. Minor gaps remain around success return shape and the role of container_selector/xpath, though the schema covers the latter.

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 condition, selector, path, text, expected, timeout_ms, poll_ms, xpath and container_selector in detail. The description reinforces the semantics of four condition types (text contains, page path, page data equals) but adds no meaning for poll_ms, container_selector, xpath, or the strict JSON equality of 'expected'. Baseline 3 applies when the schema does the heavy lifting.

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-plus-resource: 'Wait until an element appears or disappears, an element text contains a string, the page reaches a path, or a page data path equals a value — with a hard deadline.' It enumerates the five wait modes so an agent can match its intent without opening the schema, and the closing clause distinguishes it from a fixed sleep before an assertion.

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?

'Use this instead of sleeping a fixed time before an assertion' gives a clear positive selection rule and names the anti-pattern it replaces. It stops short of naming a specific sibling (e.g. mp_expect or mp_query) as the alternative for non-waiting assertions, and states no explicit when-not conditions.

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