Skip to main content
Glama

create_task

Add tasks to Todoist with title, description, project, labels, priority, and due date. Manage your to-do list directly through AI assistants.

Instructions

Create a new Todoist task with title, description, project, labels, priority, and due date. Only title is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesThe title/content of the task (required)
descriptionNoDescription for the task
project_idNoThe ID of the project to create the task in
labelsNoArray of label names to assign to the task
priorityNoPriority level (1-4, where 1 is highest priority)
due_dateNoDue date in YYYY-MM-DD format

Implementation Reference

  • Definition of the createTaskTool including schema and handler function that implements the core logic for the 'create_task' MCP tool.
    export const createTaskTool: Tool = {
      schema: {
        name: 'create_task',
        description:
          'Create a new Todoist task with title, description, project, labels, priority, and due date. Only title is required.',
        inputSchema: {
          type: 'object',
          properties: {
            title: {
              type: 'string',
              description: 'The title/content of the task (required)',
            },
            description: {
              type: 'string',
              description: 'Description for the task',
            },
            project_id: {
              type: 'string',
              description: 'The ID of the project to create the task in',
            },
            labels: {
              type: 'array',
              items: {
                type: 'string',
              },
              description: 'Array of label names to assign to the task',
            },
            priority: {
              type: 'number',
              description: 'Priority level (1-4, where 1 is highest priority)',
            },
            due_date: {
              type: 'string',
              description: 'Due date in YYYY-MM-DD format',
            },
          },
          required: ['title'],
        },
      },
      handler: async (args: {
        title: string;
        description?: string;
        project_id?: string;
        labels?: string[];
        priority?: number;
        due_date?: string;
      }): Promise<{
        content: Array<{
          type: 'text';
          text: string;
        }>;
      }> => {
        console.error('Executing create_task...');
        const { title, description, project_id, labels, priority, due_date } = args;
    
        if (!title) {
          throw new Error('title is required');
        }
    
        try {
          // Build service parameters with only provided fields
          const serviceParams: any = {
            title,
          };
    
          if (description !== undefined) {
            serviceParams.description = description;
          }
    
          if (project_id !== undefined) {
            serviceParams.projectId = project_id;
          }
    
          if (labels !== undefined) {
            serviceParams.labels = labels;
          }
    
          if (priority !== undefined) {
            serviceParams.priority = priority;
          }
    
          if (due_date !== undefined) {
            serviceParams.dueDate = due_date;
          }
    
          const result = await createTask(serviceParams);
          console.error('create_task completed successfully');
    
          return {
            content: [
              {
                type: 'text',
                text: result,
              },
            ],
          };
        } catch (error) {
          console.error('create_task error:', error);
          return {
            content: [
              {
                type: 'text',
                text: `Error: ${
                  error instanceof Error ? error.message : 'Unknown error'
                }`,
              },
            ],
          };
        }
      },
    };
  • Registration of the create_task handler in the toolsWithArgs registry used by handleToolRequest.
    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:94-94 (registration)
    Registration of createTaskTool.schema in the list of tools returned by ListToolsRequestHandler.
    createTaskTool.schema,
  • The underlying service function createTask that performs the actual Todoist API call to create the task.
    export async function createTask(params: CreateTaskParams): Promise<string> {
      const client = getTodoistClient();
    
      try {
        const createPayload = buildCreatePayload(params);
    
        if (!client.post) {
          throw new Error('POST method not available on client');
        }
    
        const response = await client.post<{ content: string }>(
          '/tasks',
          createPayload
        );
    
        return `Task created successfully: ${response.data.content}`;
      } catch (error) {
        throw new Error(`Failed to create task: ${getErrorMessage(error)}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this creates a task but doesn't mention authentication requirements, rate limits, whether the task becomes immediately active, what happens on duplicate titles, or what the return value looks like (since no output schema exists). The description provides minimal behavioral context beyond the basic action.

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 perfectly concise - a single sentence that efficiently communicates the core functionality and key parameter information. Every word earns its place with no redundancy or unnecessary elaboration.

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 and no output schema, the description is insufficient. It doesn't explain what happens after creation, error conditions, authentication needs, or how this differs from similar tools. Given the complexity of task management and rich sibling toolset, more contextual information would be helpful for an agent.

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%, so the schema already documents all 6 parameters thoroughly. The description lists the same parameters (title, description, project, labels, priority, due date) but doesn't add meaningful semantic context beyond what's in the schema. The 'Only title is required' statement is useful but already implied by the schema's required array.

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

Purpose4/5

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

The description clearly states the verb ('Create') and resource ('new Todoist task') along with the key fields that can be set. It distinguishes from siblings like 'update_task' by specifying creation rather than modification. However, it doesn't explicitly differentiate from other creation tools like 'create_project_label' beyond the resource type.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_task_comment' or 'create_project_label'. It mentions that 'Only title is required', which is a basic parameter requirement but doesn't help the agent choose between this and other task-related tools in the sibling list.

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