drop_task
Remove a specific task from OmniFocus by providing its unique task ID. Part of MCP OmniFocus server for streamlined task automation and management.
Instructions
Drop a task in OmniFocus.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to drop |
Implementation Reference
- Core handler function that executes the drop_task logic by generating and evaluating JavaScript to call task.drop(false) on the specified task in OmniFocus and returns the formatted task details.def drop_task(task_id: str) -> dict[str, str]: """Complete a task in OmniFocus. Args: task_id: The ID of the task to complete. Returns: A dictionary containing the dropped task's details. """ script = Template( dedent(""" ${__common_functions__} (() => { let task = Task.byIdentifier("${task_id}"); if (!task) { throw "Could not find task: " + task_id.toString(); } task.drop(false); return formatTask(task); })(); """) ) return evaluate_javascript(script.substitute(__common_functions__=__common_functions__, task_id=task_id))
- src/mcp_omnifocus/server.py:108-111 (registration)MCP tool registration for 'drop_task', including input schema (Annotated task_id) and docstring, which delegates execution to the omnifocus.drop_task function.@mcp.tool def drop_task(task_id: Annotated[str, Field(description="The ID of the task to drop")]) -> dict[str, str]: """Drop a task in OmniFocus.""" return omnifocus.drop_task(task_id)