activate_task
Reactivate a dropped or completed task in OmniFocus by providing the task ID, enabling users to restore tasks for continued use or management.
Instructions
Activate (un-drop or un-complete) a task in OmniFocus.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to activate |
Implementation Reference
- src/mcp_omnifocus/server.py:114-117 (handler)MCP tool handler for 'activate_task'. Includes input schema via Annotated Field, docstring description, and delegates to omnifocus.activate_task helper. Automatically registered via @mcp.tool decorator.@mcp.tool def activate_task(task_id: Annotated[str, Field(description="The ID of the task to activate")]) -> dict[str, str]: """Activate (un-drop or un-complete) a task in OmniFocus.""" return omnifocus.activate_task(task_id)
- Core helper function implementing task activation via JavaScript execution in OmniFocus. Retrieves task by ID, sets task.active = true, formats and returns task details.def activate_task(task_id: str) -> dict[str, str]: """Activate a task in OmniFocus. Args: task_id: The ID of the task to activate. Returns: A dictionary containing the activated 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.active = true; return formatTask(task); })(); """) ) return evaluate_javascript(script.substitute(__common_functions__=__common_functions__, task_id=task_id))