uncomplete_task
Reopens a completed task to restore it to active status. Supports lookup by task name, ID, series ID, or list ID.
Instructions
Reopen a completed task.
Args: task_name: Task name to search for (searches completed tasks) task_id: Specific task ID taskseries_id: Task series ID list_id: List ID
Returns: Reopened task details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_name | No | ||
| task_id | No | ||
| taskseries_id | No | ||
| list_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/rtm_mcp/tools/tasks.py:229-287 (handler)The uncomplete_task handler function decorated with @mcp.tool(). Accepts task_name, task_id, taskseries_id, and list_id. Searches for a completed task if task_name is provided, then calls rtm.tasks.uncomplete API to reopen it. Returns the reopened task details with a transaction ID for undo.
@mcp.tool() async def uncomplete_task( ctx: Context, task_name: str | None = None, task_id: str | None = None, taskseries_id: str | None = None, list_id: str | None = None, ) -> dict[str, Any]: """Reopen a completed task. Args: task_name: Task name to search for (searches completed tasks) task_id: Specific task ID taskseries_id: Task series ID list_id: List ID Returns: Reopened task details """ client: RTMClient = await get_client() if task_name and not task_id: task = await _find_task(client, task_name, include_completed=True) if not task: return build_response( data={"error": f"Completed task not found: {task_name}"}, ) if not task.get("completed"): return build_response( data={"error": f"Task is not completed: {task_name}"}, ) task_id = task["id"] taskseries_id = task["taskseries_id"] list_id = task["list_id"] if not all([task_id, taskseries_id, list_id]): return build_response( data={"error": "Must provide task_name or all three IDs"}, ) result = await client.call( "rtm.tasks.uncomplete", require_timeline=True, list_id=list_id, taskseries_id=taskseries_id, task_id=task_id, ) tasks = parse_tasks_response(result) task_data = tasks[0] if tasks else {} timezone = await _get_user_timezone(client) return build_response( data={ "task": format_task(task_data, timezone=timezone), "message": f"Reopened: {task_data.get('name', '')}", }, transaction_id=get_transaction_id(result), ) - src/rtm_mcp/tools/tasks.py:236-247 (schema)Docstring/input schema for uncomplete_task defining parameters: task_name (searches completed tasks), task_id, taskseries_id, list_id, and the return value description.
) -> dict[str, Any]: """Reopen a completed task. Args: task_name: Task name to search for (searches completed tasks) task_id: Specific task ID taskseries_id: Task series ID list_id: List ID Returns: Reopened task details """ - src/rtm_mcp/server.py:103-103 (registration)Registration point: register_task_tools(mcp, get_client) is called from server.py, which registers all task tools including uncomplete_task via the @mcp.tool() decorator inside the register_task_tools function.
register_task_tools(mcp, get_client) - src/rtm_mcp/tools/tasks.py:866-892 (helper)The _find_task helper function used by uncomplete_task to search for a task by name with fuzzy matching (exact then partial). Called with include_completed=True to find completed tasks to reopen.
async def _find_task( client: RTMClient, name: str, include_completed: bool = False, ) -> dict[str, Any] | None: """Find a task by name (fuzzy match).""" filter_str = "status:incomplete" if not include_completed else None if filter_str: result = await client.call("rtm.tasks.getList", filter=filter_str) else: result = await client.call("rtm.tasks.getList") tasks = parse_tasks_response(result) name_lower = name.lower() # Exact match first for task in tasks: if task["name"].lower() == name_lower: return task # Partial match for task in tasks: if name_lower in task["name"].lower(): return task return None - src/rtm_mcp/tools/tasks.py:17-17 (helper)The register_task_tools function that wraps all task tool definitions including the @mcp.tool() decorator registrations for uncomplete_task and other task tools.
def register_task_tools(mcp: Any, get_client: Any) -> None: