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
| Name | Required | Description | Default |
|---|---|---|---|
| duration_ms | Yes | Duration to wait in milliseconds (0–10000, default 500) |
Implementation Reference
- src/tools/utility.ts:147-165 (handler)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 }), }, ], }; } - src/tools/utility.ts:37-45 (schema)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)"), }); - src/tools/utility.ts:60-70 (registration)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, }, }, ];