list_tasks
Retrieve FortiManager background jobs ordered by recency, filter by state or recent hours, and cap results to monitor policy installs, provisioning, and long-running operations without bulky payloads.
Instructions
List FortiManager tasks, newest first.
Tasks represent background operations like policy installation, device provisioning, and other long-running processes.
Changed in 1.13.0: returns the newest limit tasks (default 100;
total says how many matched) and drops each task's line list
unless include_lines is set. It used to return every task with its
lines, which can reach hundreds of KB per call. Raise limit
or narrow with since_hours to see further back.
Args: filter_state: Filter by task state (optional): - "pending": Not started - "running": Currently executing - "done": Completed - "error": Failed - "cancelling": Being cancelled - "cancelled": Cancelled limit: Maximum number of tasks to return (default: 100) since_hours: Only tasks started in the last N hours (optional) include_lines: Include each task's per-device lines and history (default: False, they can reach hundreds of KB; get_task reads them for one task)
Returns:
dict: Task list with keys:
- status: "success" or "error"
- count: Number of tasks returned
- total: Number of tasks matching before limit
- tasks: List of task objects with id, state, progress, etc.
- message: Error message if failed
Example: >>> # Get all tasks >>> result = await list_tasks()
>>> # Get only running tasks
>>> result = await list_tasks(filter_state="running")
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_tasks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| since_hours | No | ||
| filter_state | No | ||
| include_lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||