Skip to main content
Glama
yfmeii

WeChat Mini Program Dev MCP

by yfmeii

page_waitTimeout

Delay automation by a specified number of milliseconds to allow page elements to load or stabilize in WeChat mini program testing.

Instructions

等待指定的毫秒数。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNo
millisecondsYes

Implementation Reference

  • The handler function for the 'page_waitTimeout' tool. It waits a specified number of milliseconds using page.waitFor().
    function createWaitForTimeoutTool(manager: WeappAutomatorManager): AnyTool {
      return {
        name: "page_waitTimeout",
        description: "等待指定的毫秒数。",
        parameters: waitForTimeoutParameters,
        execute: async (rawArgs, context: ToolContext) =>
          withUserErrorResult(async () => {
          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 for the 'page_waitTimeout' tool. Defines a required 'milliseconds' (nonnegative integer) parameter, plus optional 'connection' overrides.
    const waitForTimeoutParameters = connectionContainerSchema.extend({
      milliseconds: z.coerce.number().int().nonnegative(),
    });
  • Registration of the 'page_waitTimeout' tool among other page tools in the createPageTools factory function.
    export function createPageTools(manager: WeappAutomatorManager): AnyTool[] {
      return [
        createGetElementTool(manager),
        createGetElementsTool(manager),
        createWaitForElementTool(manager),
        createWaitForTimeoutTool(manager),
        createGetPageDataTool(manager),
        createSetPageDataTool(manager),
        createCallPageMethodTool(manager),
      ];
    }
  • The connectionContainerSchema used by the tool's schema for optional connection overrides.
    export const connectionContainerSchema = z.object({
      connection: connectionOverridesSchema.optional(),
    });
  • The toTextResult helper used to format the success message returned by the tool.
    export function toTextResult(text: string): ContentResult {
      return {
        content: [
          {
            type: "text",
            text,
          },
        ],
      };
    }
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It only states the action of waiting and does not cover whether the wait is blocking, cancellable, or how it interacts with page lifecycle. No additional traits are mentioned.

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 a single short sentence, which is concise but lacks structure. It does not front-load key information or use formatting to aid readability. While efficient, it sacrifices necessary detail.

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?

Given the tool has multiple parameters (including a nested connection object) and no annotations or output schema, the description is severely incomplete. It omits return behavior, error conditions, and prerequisites, leaving the agent with insufficient context for correct invocation.

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%, and the description adds no explanation for either parameter. The 'milliseconds' parameter is somewhat self-explanatory from its name, but the complex 'connection' object is completely undocumented. The description fails to provide any semantic value beyond the schema structure.

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 clearly states the tool waits for a specified number of milliseconds. The name 'page_waitTimeout' implies time-based waiting, and the description confirms the unit. However, it does not differentiate from sibling tools like page_waitElement, which wait for a condition rather than a fixed duration.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description does not mention scenarios where a fixed delay is preferable to conditional waits, nor does it provide context on prerequisites or side effects.

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