Skip to main content
Glama

wait

Read-only

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,
        },
      },
    ];
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, indicating a safe, non-destructive operation. The description adds useful context about its purpose in UI workflows but doesn't disclose additional behavioral traits like whether it blocks other operations, handles interruptions, or has side effects. With annotations covering safety, a 3 is appropriate as the description adds some value but not rich behavioral context.

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?

The description is two concise sentences with zero waste: the first states the purpose, and the second provides usage context. It's appropriately sized and front-loaded, making it easy to understand quickly.

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?

Given the tool's low complexity (single parameter, no output schema) and rich annotations, the description is mostly complete. It covers purpose and usage context but could benefit from mentioning potential impacts like execution blocking or integration with other tools. However, it's sufficient for basic understanding.

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%, with the parameter 'duration_ms' fully documented in the schema including type, range, and default. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage.

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 clearly states the tool's purpose with a specific verb ('Pause execution') and resource ('for a specified duration'), distinguishing it from sibling tools like click, type_text, or move_mouse which perform actions rather than waiting. It effectively communicates that this tool introduces a delay in execution.

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?

The description provides clear context for usage ('Useful for waiting between UI operations'), indicating when to use it. However, it doesn't explicitly state when not to use it or name alternatives (e.g., using timeouts in other tools), which prevents a perfect score.

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

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