Skip to main content
Glama

wait

Pause execution for a specified duration to wait between UI operations in macOS automation workflows.

Instructions

Pause execution for a specified duration. Useful for waiting between UI operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
duration_msYesDuration to wait in milliseconds (0–10000, default 500)

Implementation Reference

  • The handler function for the "wait" tool, which pauses execution for the specified duration.
    async function handleWait(
      args: Record<string, unknown>,
    ): Promise<CallToolResult> {
      const parsed = WaitInputSchema.parse(args);
      const duration = parsed.duration_ms;
    
      await new Promise<void>((resolve) => {
        setTimeout(resolve, duration);
      });
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify({ waited_ms: duration }),
          },
        ],
      };
    }
  • The input schema for the "wait" tool, defining the duration_ms field.
    const WaitInputSchema = z.object({
      duration_ms: z
        .number()
        .int()
        .min(0)
        .max(WAIT_MAX_MS)
        .default(WAIT_DEFAULT_MS)
        .describe("Duration to wait in milliseconds (0–10000, default 500)"),
    });
  • Registration of the "wait" tool definition.
      {
        name: "wait",
        description:
          "Pause execution for a specified duration. Useful for waiting between UI operations.",
        inputSchema: zodToToolInputSchema(WaitInputSchema),
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
        },
      },
    ];

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/antbotlab/mac-use-mcp'

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