Skip to main content
Glama
yfmeii

WeChat Mini Program Dev MCP

by yfmeii

page_waitTimeout

Pauses execution for a specified duration in milliseconds during WeChat Mini Program automation, allowing synchronization with page loading or element rendering.

Instructions

等待指定的毫秒数。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNo
millisecondsYes

Implementation Reference

  • Creates the 'page_waitTimeout' tool, including its handler (execute function) that parses arguments, acquires the page via manager, and calls page.waitFor(milliseconds) to wait the specified time.
    function createWaitForTimeoutTool(manager: WeappAutomatorManager): AnyTool {
      return {
        name: "page_waitTimeout",
        description: "等待指定的毫秒数。",
        parameters: waitForTimeoutParameters,
        execute: async (rawArgs, context: ToolContext) => {
          const args = waitForTimeoutParameters.parse(rawArgs ?? {});
          return manager.withPage<ContentResult>(
            context.log,
            { overrides: args.connection },
            async (page) => {
              await page.waitFor(args.milliseconds);
              return toTextResult(`已等待 ${args.milliseconds}ms。`);
            }
          );
        },
      };
    }
  • Zod schema defining the input parameters for the 'page_waitTimeout' tool: milliseconds as a non-negative integer.
    const waitForTimeoutParameters = connectionContainerSchema.extend({
      milliseconds: z.coerce.number().int().nonnegative(),
    });
  • Registers the 'page_waitTimeout' tool (via createWaitForTimeoutTool(manager)) in the array of page tools returned by createPageTools.
    export function createPageTools(manager: WeappAutomatorManager): AnyTool[] {
      return [
        createGetElementTool(manager),
        createWaitForElementTool(manager),
        createWaitForTimeoutTool(manager),
        createGetPageDataTool(manager),
        createSetPageDataTool(manager),
        createCallPageMethodTool(manager),
      ];
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states it waits for milliseconds, offering no information about what happens during the wait (e.g., whether it blocks execution, handles interruptions, or affects page state), what happens after the wait, or any side effects. This is inadequate for a tool with complex parameters like 'connection'.

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

Conciseness4/5

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

The description is extremely concise - a single Chinese sentence. While this is efficient, it's arguably too brief given the tool's complexity. However, it doesn't waste words and gets straight to a basic statement of function.

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

Completeness1/5

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

This is a timeout/waiting tool with no annotations, no output schema, and 2 parameters (one being a complex nested object with 12 properties). The description is completely inadequate - it doesn't explain what the tool actually does beyond the basic wait concept, doesn't document parameters, doesn't describe behavior or side effects, and provides no context about how this integrates with the other page/element tools.

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

Parameters1/5

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

Schema description coverage is 0%, meaning the schema provides no parameter descriptions. The description mentions 'milliseconds' but doesn't explain the 'connection' parameter at all, which has 12 nested properties. For a tool with 2 parameters (one complex nested object), the description fails to compensate for the complete lack of schema documentation.

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

Purpose2/5

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

The description '等待指定的毫秒数' (Wait for the specified number of milliseconds) is a tautology that essentially restates the tool name 'page_waitTimeout' in different words. It doesn't specify what resource or context this waiting applies to, nor does it distinguish this tool from potential alternatives like 'page_waitElement' among the sibling tools.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'page_waitElement' that also involve waiting, there's no indication of when to choose a timeout-based wait versus an element-based wait, nor any mention of prerequisites or typical use cases.

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/yfmeii/weapp-dev-mcp'

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