wait
Pause web automation workflows for specified seconds to manage timing between operations, handle rate limiting, and allow external processes to complete.
Instructions
Wait for a specified number of seconds before continuing.
Use this when you need to pause between operations, such as:
- Waiting between status checks to avoid rapid polling
- Giving a web task time to make progress
- Rate limiting your requests
- Waiting for external processes to complete
Args:
seconds: Number of seconds to wait (1-60)
Returns:
Dictionary containing:
- ok: Boolean indicating success
- waited_seconds: How long the wait lasted
- message: Confirmation message
Examples:
- wait(5) # Wait 5 seconds
- wait(10) # Wait 10 seconds
Best Practice:
Use this instead of immediately polling check_web_task multiple times.
Recommended wait time between status checks: 3-5 seconds.
Note: Maximum wait time is 60 seconds to prevent timeout issues.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seconds | Yes |
Implementation Reference
- server.py:311-366 (handler)The core handler function for the 'wait' tool, decorated with @mcp.tool() for automatic registration. Validates input (1-60 seconds), performs asynchronous sleep, and returns execution result.@mcp.tool() async def wait(seconds: int) -> dict[str, Any]: """ Wait for a specified number of seconds before continuing. Use this when you need to pause between operations, such as: - Waiting between status checks to avoid rapid polling - Giving a web task time to make progress - Rate limiting your requests - Waiting for external processes to complete Args: seconds: Number of seconds to wait (1-60) Returns: Dictionary containing: - ok: Boolean indicating success - waited_seconds: How long the wait lasted - message: Confirmation message Examples: - wait(5) # Wait 5 seconds - wait(10) # Wait 10 seconds Best Practice: Use this instead of immediately polling check_web_task multiple times. Recommended wait time between status checks: 3-5 seconds. Note: Maximum wait time is 60 seconds to prevent timeout issues. """ # Validate input if seconds < 1: return { "ok": False, "error": "Wait time must be at least 1 second" } if seconds > 60: return { "ok": False, "error": "Wait time cannot exceed 60 seconds. For longer waits, call this tool multiple times." } logger.info(f"Waiting for {seconds} seconds...") # Use anyio sleep for async compatibility import time await anyio.sleep(seconds) logger.info(f"Wait completed: {seconds} seconds") return { "ok": True, "waited_seconds": seconds, "message": f"Successfully waited {seconds} seconds" }