uncomplete_task
Reopen a completed Todoist task by providing its ID to restore it to active status for continued management.
Instructions
Uncomplete (reopen) a task by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to uncomplete |
Implementation Reference
- src/tools/task-operations.ts:364-387 (handler)The handler function for the 'uncomplete_task' MCP tool. It calls the uncompleteTask service function with the provided task_id and returns a success or error message.handler: async (args: { task_id: string }) => { try { await uncompleteTask(args.task_id); return { content: [ { type: 'text', text: 'Task uncompleted successfully', }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error: ${ error instanceof Error ? error.message : 'Unknown error' }`, }, ], }; } },
- src/tools/task-operations.ts:350-363 (schema)The schema definition for the 'uncomplete_task' tool, specifying the name, description, and input schema requiring task_id.schema: { name: 'uncomplete_task', description: 'Uncomplete (reopen) a task by its ID', inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'The ID of the task to uncomplete', }, }, required: ['task_id'], }, },
- The core helper function uncompleteTask that uses the Todoist client to reopen (uncomplete) the task via the /reopen API endpoint.export async function uncompleteTask(taskId: string): Promise<void> { const client = getTodoistClient(); try { await client.post!(`/tasks/${taskId}/reopen`); } catch (error) { throw new Error(`Failed to uncomplete task: ${getErrorMessage(error)}`); } }
- src/index.ts:98-99 (registration)Registration of the uncompleteTaskTool.schema in the MCP server's ListTools response.completeTaskTool.schema, uncompleteTaskTool.schema,
- src/handlers/tool-request-handler.ts:58-59 (registration)Registration of the uncomplete_task handler in the toolsWithArgs dispatch registry for handling tool calls.complete_task: completeTaskTool.handler, uncomplete_task: uncompleteTaskTool.handler,