check_web_task
Monitor the status and progress of background web automation tasks initiated through Gemini Web Automation MCP. Retrieve task summaries or detailed progress reports to track completion, results, or errors.
Instructions
Check progress of a background web browsing task.
Returns a summary of task progress. By default, returns compact format to
avoid filling your context window with verbose progress logs.
IMPORTANT: To prevent context bloat, wait at least 3-5 seconds between
checks. Use the 'recommended_poll_after' timestamp as guidance.
Args:
task_id: Task ID from start_web_task()
compact: Return summary only (default: True). Set to False for full details.
Returns:
Dictionary containing:
- ok: Boolean indicating success
- task_id: Task identifier
- status: "pending", "running", "completed", "failed", or "cancelled"
- progress_summary: Recent actions (compact mode only)
- progress: Full action history (full mode only)
- result: Task results (when completed)
- error: Error message (when failed)
- recommended_poll_after: Timestamp to check again (when running)
- polling_guidance: Message about polling frequency
Examples:
- check_web_task("abc-123-def") # Compact summary
- check_web_task("abc-123-def", compact=False) # Full details
Best Practice:
Only poll every 3-5 seconds to keep your context window clean.
Use the wait() tool to pause between checks if your platform doesn't
support automatic delays.
Recommended workflow:
1. start_web_task("...")
2. wait(5)
3. check_web_task(task_id)
4. If still running, repeat steps 2-3
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| compact | No |
Implementation Reference
- server.py:202-267 (handler)The handler function implementing the 'check_web_task' tool logic. It is registered via the @mcp.tool() decorator. Fetches task status from task_manager, handles not found cases, and adds polling guidance for running tasks.@mcp.tool() async def check_web_task(task_id: str, compact: bool = True) -> dict[str, Any]: """ Check progress of a background web browsing task. Returns a summary of task progress. By default, returns compact format to avoid filling your context window with verbose progress logs. IMPORTANT: To prevent context bloat, wait at least 3-5 seconds between checks. Use the 'recommended_poll_after' timestamp as guidance. Args: task_id: Task ID from start_web_task() compact: Return summary only (default: True). Set to False for full details. Returns: Dictionary containing: - ok: Boolean indicating success - task_id: Task identifier - status: "pending", "running", "completed", "failed", or "cancelled" - progress_summary: Recent actions (compact mode only) - progress: Full action history (full mode only) - result: Task results (when completed) - error: Error message (when failed) - recommended_poll_after: Timestamp to check again (when running) - polling_guidance: Message about polling frequency Examples: - check_web_task("abc-123-def") # Compact summary - check_web_task("abc-123-def", compact=False) # Full details Best Practice: Only poll every 3-5 seconds to keep your context window clean. Use the wait() tool to pause between checks if your platform doesn't support automatic delays. Recommended workflow: 1. start_web_task("...") 2. wait(5) 3. check_web_task(task_id) 4. If still running, repeat steps 2-3 """ logger.info(f"Checking status for task: {task_id}") status = task_manager.get_task_status(task_id, compact=compact) if not status: return { "ok": False, "error": f"Task {task_id} not found" } # Add poll delay guidance for running tasks from datetime import datetime, timedelta, timezone result = { "ok": True, **status } if status.get("status") == "running": next_check = datetime.now(timezone.utc) + timedelta(seconds=5) result["recommended_poll_after"] = next_check.isoformat() result["polling_guidance"] = "Task in progress. Wait 5 seconds before next check to avoid context bloat." return result
- server.py:202-202 (registration)The @mcp.tool() decorator registers the check_web_task function as an MCP tool.@mcp.tool()
- server.py:203-243 (schema)Type hints and docstring define the input schema (task_id: str, compact: bool=True) and output schema (dict with status, progress, etc.).async def check_web_task(task_id: str, compact: bool = True) -> dict[str, Any]: """ Check progress of a background web browsing task. Returns a summary of task progress. By default, returns compact format to avoid filling your context window with verbose progress logs. IMPORTANT: To prevent context bloat, wait at least 3-5 seconds between checks. Use the 'recommended_poll_after' timestamp as guidance. Args: task_id: Task ID from start_web_task() compact: Return summary only (default: True). Set to False for full details. Returns: Dictionary containing: - ok: Boolean indicating success - task_id: Task identifier - status: "pending", "running", "completed", "failed", or "cancelled" - progress_summary: Recent actions (compact mode only) - progress: Full action history (full mode only) - result: Task results (when completed) - error: Error message (when failed) - recommended_poll_after: Timestamp to check again (when running) - polling_guidance: Message about polling frequency Examples: - check_web_task("abc-123-def") # Compact summary - check_web_task("abc-123-def", compact=False) # Full details Best Practice: Only poll every 3-5 seconds to keep your context window clean. Use the wait() tool to pause between checks if your platform doesn't support automatic delays. Recommended workflow: 1. start_web_task("...") 2. wait(5) 3. check_web_task(task_id) 4. If still running, repeat steps 2-3 """