wait_for_task
Poll FortiManager task status until completion or timeout so you know when installation or provisioning operations finish before proceeding.
Instructions
Wait for a task to complete.
Polls the task status until it completes or times out. Useful for waiting on installation or provisioning operations.
Args: task_id: Task ID number timeout: Maximum wait time in seconds (default: 300, capped at 3600) poll_interval: Seconds between status checks (default: 5)
Returns: dict: Final task status with keys: - status: "success" (task ended done or warning) or "error" (error, cancelled, aborted, timeout) - task: Final task object - task_state: Decoded end state (done, warning, error, cancelled, aborted) - completed: Whether task completed (vs timeout) - message: Status or error message
A "warning" task finished; its lines (get_task) say what was
skipped, e.g. an install that found nothing to push.Example: >>> # Wait for policy installation >>> result = await wait_for_task(12345, timeout=600) >>> if result['completed']: ... print("Installation finished!")
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task_id": "<task_id>"
},
"name": "wait_for_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| timeout | No | ||
| poll_interval | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||