Query tasks
query_tasksRetrieve tasks from OmniFocus by source—Inbox, Flagged, Forecast, tags, projects, custom perspectives, or ad-hoc filters—with pagination, search, and sorting.
Instructions
Read tasks from Inbox, Flagged, Forecast, tags, projects, custom perspectives, or an ad-hoc filter.
Results are paginated and compact by default. Use count_tasks when you only need totals. Custom perspectives (source=custom) are saved views, not tags.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Forecast horizon in days. Default 7. | |
| limit | No | Page size. Default 50. | |
| cursor | No | nextCursor from a previous page. | |
| output | No | compact omits notes and full tag paths. | compact |
| search | No | Case-insensitive substring in name or note. | |
| source | No | Which task view to read. filter/search use the extra filters below. | filter |
| tag_id | No | Tag id. Use with source=tag or as a filter. | |
| flagged | No | If set, require or exclude flagged tasks. | |
| overdue | No | Past due and incomplete. | |
| sort_by | No | Sort key. library keeps OmniFocus order. | |
| tag_ids | No | Match tasks that have any of these tag ids. | |
| task_id | No | Stable task id. Use with source=id. | |
| has_note | No | If set, require or exclude tasks with notes. | |
| in_inbox | No | If set, require or exclude inbox tasks. | |
| tag_name | No | Tag name. This is a tag, not a perspective. | |
| due_after | No | ISO date/datetime lower bound for due. | |
| due_today | No | Due today (local). | |
| folder_id | No | Only tasks in projects inside this folder. | |
| tag_names | No | Match tasks that have any of these tag names. | |
| task_name | No | Task name. Fails if the name is ambiguous. | |
| due_before | No | ISO date/datetime upper bound for due. | |
| project_id | No | Only tasks in this project. | |
| defer_after | No | ISO date/datetime lower bound for defer. | |
| exact_match | No | For source=tag, require an exact tag name. | |
| task_status | No | Restrict to these OmniFocus task statuses. | |
| defer_before | No | ISO date/datetime upper bound for defer. | |
| estimate_max | No | Maximum estimated minutes. | |
| estimate_min | No | Minimum estimated minutes. | |
| has_estimate | No | If set, require or exclude estimated tasks. | |
| is_repeating | No | If set, require or exclude repeating tasks. | |
| project_name | No | Only tasks in this project name. | |
| due_this_week | No | Due in the next 7 local days. | |
| planned_after | No | ISO date/datetime lower bound for planned. | |
| planned_today | No | Planned date is today. Requires OmniFocus 4.7+. | |
| show_subtasks | No | Nest matching tasks into a JSON tree. | |
| available_only | No | Only Available/Next/DueSoon/Overdue tasks. | |
| due_this_month | No | Due this calendar month. | |
| hide_completed | No | Hide completed and dropped tasks. Forced off for completed_today. | |
| perspective_id | No | Custom perspective identifier. | |
| planned_before | No | ISO date/datetime upper bound for planned. | |
| completed_today | No | Completed today. | |
| perspective_name | No | Custom or built-in perspective name. Use with source=custom. | |
| max_subtask_depth | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||