Skip to main content
Glama

complete_task

Mark Todoist tasks as completed using their unique ID to track progress and manage your to-do list.

Instructions

Complete a task by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe ID of the task to complete

Implementation Reference

  • The completeTaskTool object defines the 'complete_task' tool, including its schema and handler function. The handler calls the completeTask service with the task_id argument, handles errors, and returns the result in MCP content format.
    export const completeTaskTool: Tool = {
      schema: {
        name: 'complete_task',
        description: 'Complete a task by its ID',
        inputSchema: {
          type: 'object',
          properties: {
            task_id: {
              type: 'string',
              description: 'The ID of the task to complete',
            },
          },
          required: ['task_id'],
        },
      },
      handler: async (args: { task_id: string }) => {
        try {
          const result = await completeTask(args.task_id);
          return {
            content: [
              {
                type: 'text',
                text: result,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error: ${
                  error instanceof Error ? error.message : 'Unknown error'
                }`,
              },
            ],
          };
        }
      },
    };
  • Input schema for the 'complete_task' tool, defining the required 'task_id' parameter.
    schema: {
      name: 'complete_task',
      description: 'Complete a task by its ID',
      inputSchema: {
        type: 'object',
        properties: {
          task_id: {
            type: 'string',
            description: 'The ID of the task to complete',
          },
        },
        required: ['task_id'],
      },
    },
  • Registration of the 'complete_task' handler in the toolsWithArgs map used by handleToolRequest to dispatch tool calls.
    const toolsWithArgs: Record<string, (args: any) => Promise<ToolResponse>> = {
      get_task_comments: getTaskCommentsTool.handler,
      create_project_label: createProjectLabelTool.handler,
      create_task_comment: createTaskCommentTool.handler,
      update_task: updateTaskTool.handler,
      create_task: createTaskTool.handler,
      move_task: moveTaskTool.handler,
      get_tasks_with_label: getTasksWithLabelTool.handler,
      complete_task: completeTaskTool.handler,
      uncomplete_task: uncompleteTaskTool.handler,
      search_tasks: searchTasksTool.handler,
      search_tasks_using_and: searchTasksUsingAndTool.handler,
      search_tasks_using_or: searchTasksUsingOrTool.handler,
      complete_becky_task: completeBeckyTaskTool.handler,
    };
  • src/index.ts:98-98 (registration)
    The completeTaskTool.schema is included in the list of tools returned by the MCP ListTools handler.
    completeTaskTool.schema,
  • The core completeTask helper function that performs the actual Todoist API call to close the task, after validation.
    export async function completeTask(taskId: string): Promise<string> {
      const client = getTodoistClient();
    
      try {
        // Check if task is in a Brian shared project
        await throwIfTaskIsFromBecky(taskId);
    
        if (!client.post) {
          throw new Error('POST method not available on client');
        }
    
        await client.post(`/tasks/${taskId}/close`);
        return 'Task completed successfully';
      } catch (error) {
        throw new Error(`Failed to complete task: ${getErrorMessage(error)}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the action but doesn't disclose behavioral traits like whether completion is reversible, if it requires specific permissions, what happens to task data, or if there are side effects. For a mutation tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized for a simple tool and front-loaded with the core action, though it could benefit from more detail given the lack of annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations, no output schema, and multiple sibling tools, the description is incomplete. It doesn't explain the outcome, return values, or how it differs from similar operations like 'uncomplete_task'. The agent lacks sufficient context to use this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'task_id' documented in the schema. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Complete a task by its ID' clearly states the action (complete) and target (task), but it's vague about what 'complete' means in this context. It doesn't distinguish from siblings like 'uncomplete_task' or 'update_task', leaving ambiguity about whether this is a status change, archival, or deletion operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'uncomplete_task', 'update_task', and 'move_task', the description offers no context about prerequisites, when this operation is appropriate, or what happens after completion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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