| omnifocus_readA | Query OmniFocus data with flexible filtering. Returns tasks, projects, tags, perspectives, folders, or exports. COMMON QUERIES: Inbox: { query: { type: "tasks", filters: { project: null } } } Tasks in a specific project (by ID, fast): { query: { type: "tasks", filters: { projectId: "" } } } Overdue: { query: { type: "tasks", mode: "overdue" } } Today perspective: { query: { type: "tasks", mode: "today" } } Flagged: { query: { type: "tasks", mode: "flagged" } } Upcoming (7 days): { query: { type: "tasks", mode: "upcoming", daysAhead: 7 } } Smart suggestions: { query: { type: "tasks", mode: "smart_suggest", limit: 10 } } Count only (fast): { query: { type: "tasks", filters: { flagged: true }, countOnly: true } } Export tasks: { query: { type: "export", exportType: "tasks", format: "json" } }
MODES (tasks queries ONLY — not valid on type:"projects"): today: Due soon (≤3 days) OR flagged, matching OmniFocus Today perspective overdue: Tasks past their due date flagged: Flagged tasks upcoming: Tasks due in next N days (set daysAhead, default 14) inbox, available, blocked, search, smart_suggest, all To SEARCH projects (or tasks) use filters, not mode: filters: { name: { contains: "..." } } or filters: { text: { matches: "regex" } }
FILTER OPERATORS: tags: { any: [...] } (has any), { all: [...] } (has all), { none: [...] } (has none) dates (dueDate, deferDate, plannedDate, added): { before: "YYYY-MM-DD" }, { after: "..." }, { between: ["...", "..."] } text: { contains: "..." }, { matches: "regex" } boolean: flagged, blocked, available, inInbox logic: { OR: [...] }, { AND: [...] }, { NOT: {...} }
RESPONSE CONTROL: Default returns minimal fields (id, name, flagged, completed, dueDate, deferDate, tags, project, available) details: true returns all fields with full notes fields: [...] returns exactly those fields (note truncated to 200 chars unless details: true) ID lookup always returns all fields with full notes fields are type-specific; requesting a field of the other type (e.g. reviewInterval on tasks) returns a guided error fields (tasks): id, name, completed, flagged, blocked, available, estimatedMinutes, dueDate, deferDate, plannedDate, completionDate, added, modified, dropDate, note, projectId, project, tags, repetitionRule, parentTaskId, parentTaskName, inInbox fields (projects): id, name, status, flagged, note, dueDate, deferDate, completionDate, folder, folderPath, folderId, sequential, lastReviewDate, nextReviewDate, reviewInterval, defaultSingletonActionHolder, tags, plannedDate sort: [{ field: "dueDate", direction: "asc" }] limit/offset: Pagination (default limit: 25, max: 500) countOnly: true returns only count (33x faster for "how many" questions) — tasks only
COMPLETED TASKS: Use filters: { completed: true } or filters: { status: "completed" } to query completed tasks includeCompleted is for export operations only (type: "export"); honored by exportType: "tasks" and exportType: "all"
EXPORT TO DISK: outputDirectory: when set with exportType: "tasks", writes tasks. to disk (raises the implicit cap to 5000); required for exportType: "all" A response-path export (no outputDirectory) caps at 1000 by default and emits summary.truncated when the cap fires; override with limit
PERFORMANCE: Use countOnly for counting questions Use fields to select only needed data Use modes instead of raw filters when available Default queries are token-efficient (9 fields, no notes)
|
| omnifocus_writeA | Create, update, complete, or delete OmniFocus tasks and projects. OPERATIONS: create: New task/project with data create_folder: New folder (name required, optional parentFolder for nesting) update: Modify existing (provide id + changes; "data" accepted as an alias for "changes"; target defaults to "task" if omitted) complete: Mark done (provide id; target defaults to "task" if omitted) delete: Remove permanently (provide id, or its alias target_id) batch: Multiple operations in one call bulk_delete: Delete multiple items by IDs tag_manage: Manage tag hierarchy (create, rename, delete, merge, nest, unnest, reparent)
FOLDER CREATION: operation: "create_folder" data.name: Folder name (required) data.parentFolder: Parent folder name, path ("Parent : Child"), or ID (optional, omit for top-level) Supports nested path lookup with " : " syntax (parent must already exist)
BATCH OPERATIONS: operations: Array of create, update, complete, and delete operations Execution order: creates first, then updates, completes, deletes last Put tempId and parentTempId inside data (not at operation level) Updates/completes can reference tempIds from creates in the same batch createSequentially: true (respects dependencies) returnMapping: true (returns tempId → realId map) stopOnError: true (halt on first failure) Example with subtasks:
{ "mutation": { "operation": "batch", "operations": [
{ "operation": "create", "target": "task", "data": { "name": "Parent", "tempId": "p1", "project": "My Project" } },
{ "operation": "create", "target": "task", "data": { "name": "Subtask", "tempId": "s1", "parentTempId": "p1" } }
] } }
REPETITION RULES (in data.repetitionRule): frequency: "daily"|"weekly"|"monthly"|"yearly" (required) interval: number (default 1) method: "fixed"|"due-after-completion"|"defer-after-completion" (default "fixed") daysOfWeek: [{ day: "SU"|"MO"|"TU"|"WE"|"TH"|"FR"|"SA", position?: number }] (for weekly) daysOfMonth: [1-31] (for monthly, -1 = last day)
REVIEW INTERVAL (project-only, in data.reviewInterval or changes.reviewInterval): Number of days: 7 (weekly), 14 (biweekly), 30 (monthly) Object form: { steps: 1, unit: "weeks" } or { steps: 2, unit: "months" } Valid units: "days", "weeks", "months", "years" (singular also accepted) Both forms are accepted; object form matches OmniFocus read output
TAG OPERATIONS: tags: [...] - Replace all tags addTags: [...] - Add to existing removeTags: [...] - Remove from existing Nested tags use " : " path syntax: "Parent : Child : Leaf" (creates hierarchy, assigns leaf)
TAG MANAGEMENT (tag_manage operation): create: Create new tag (tagName required). Supports " : " path syntax for nested hierarchies. rename: Rename tag (tagName + newName required) delete: Delete tag (tagName required) merge: Merge source into target (tagName + targetTag required) nest: Move tag under parent (tagName + parentTag required) unnest: Move tag to root level (tagName required) reparent: Move tag to different parent (tagName + parentTag required)
DATE FORMATS: Date only: "YYYY-MM-DD" (defaults: due=5pm, defer=8am, planned=8am) Date+time: "YYYY-MM-DD HH:mm" (local time) Clear date: null or clearDueDate/clearDeferDate/clearPlannedDate: true
MOVE TO INBOX: Set project: null SAFETY: |