wait_for_task
Wait for an ongoing MCP Task to complete, fail, or be canceled by specifying a task ID or batch ID. Set timeout and return options to manage monitoring of complex AI workflows effectively.
Instructions
Wait for a task or any task in a batch to complete, fail, or be cancelled. Only waits for tasks that complete AFTER this call is made - ignores tasks that were already completed.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
batch_id | No | Wait for any task in this batch to complete (required if task_id not provided) | |
return_all | No | For batch_id: return all completed tasks instead of just the first one (default: false) | |
task_id | No | Wait for this specific task to complete (required if batch_id not provided) | |
timeout_seconds | No | Maximum seconds to wait before timing out (default: 300, max: 600) |
Input Schema (JSON Schema)
{
"properties": {
"batch_id": {
"description": "Wait for any task in this batch to complete (required if task_id not provided)",
"type": "string"
},
"return_all": {
"default": false,
"description": "For batch_id: return all completed tasks instead of just the first one (default: false)",
"type": "boolean"
},
"task_id": {
"description": "Wait for this specific task to complete (required if batch_id not provided)",
"type": "string"
},
"timeout_seconds": {
"default": 300,
"description": "Maximum seconds to wait before timing out (default: 300, max: 600)",
"maximum": 600,
"type": "number"
}
},
"required": [],
"type": "object"
}