Skip to main content
Glama

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
NameRequiredDescriptionDefault
task_idYesThe ID of the task to uncomplete

Implementation Reference

  • 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'
              }`,
            },
          ],
        };
      }
    },
  • 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,
  • Registration of the uncomplete_task handler in the toolsWithArgs dispatch registry for handling tool calls.
    complete_task: completeTaskTool.handler,
    uncomplete_task: uncompleteTaskTool.handler,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bkotos/todoist-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server