Skip to main content
Glama
greirson

Todoist MCP Server

todoist_project_create

Create a new project in Todoist with customizable name, color, and favorite status for organizing tasks.

Instructions

Create a new project in Todoist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the project
colorNoColor for the project (optional)
is_favoriteNoWhether to mark the project as favorite (optional)

Implementation Reference

  • The core handler function that implements the todoist_project_create tool logic. It builds the project data object from input arguments and uses the Todoist API client to create the project, then formats and returns a success message with project details.
    export async function handleCreateProject(
      todoistClient: TodoistApi,
      args: CreateProjectArgs
    ): Promise<string> {
      const projectData: TodoistProjectData = {
        name: args.name,
      };
    
      if (args.color) {
        projectData.color = args.color;
      }
    
      if (args.is_favorite !== undefined) {
        projectData.isFavorite = args.is_favorite;
      }
    
      const project = await todoistClient.addProject(projectData);
    
      return `Project created:\nName: ${project.name}\nID: ${project.id}${
        project.color ? `\nColor: ${project.color}` : ""
      }${project.isFavorite ? "\nMarked as favorite" : ""}`;
    }
  • Defines the Tool metadata and input schema (JSON Schema) for the todoist_project_create tool, specifying required 'name' and optional 'color' and 'is_favorite' parameters.
    export const CREATE_PROJECT_TOOL: Tool = {
      name: "todoist_project_create",
      description: "Create a new project in Todoist",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Name of the project",
          },
          color: {
            type: "string",
            description: "Color for the project (optional)",
          },
          is_favorite: {
            type: "boolean",
            description: "Whether to mark the project as favorite (optional)",
          },
        },
        required: ["name"],
      },
    };
  • src/index.ts:198-203 (registration)
    Registers and routes incoming tool calls for 'todoist_project_create' in the main server request handler switch statement, performing argument validation before invoking the handler.
    case "todoist_project_create":
      if (!isCreateProjectArgs(args)) {
        throw new Error("Invalid arguments for todoist_project_create");
      }
      result = await handleCreateProject(apiClient, args);
      break;
  • Runtime type guard function that validates input arguments conform to CreateProjectArgs type for todoist_project_create tool.
    export function isCreateProjectArgs(args: unknown): args is CreateProjectArgs {
      return (
        typeof args === "object" &&
        args !== null &&
        "name" in args &&
        typeof (args as { name: string }).name === "string"
      );
  • Includes the todoist_project_create tool (CREATE_PROJECT_TOOL) in the PROJECT_TOOLS array, which is aggregated into ALL_TOOLS for server registration.
    export const PROJECT_TOOLS = [
      GET_PROJECTS_TOOL,
      GET_SECTIONS_TOOL,
      CREATE_PROJECT_TOOL,
      CREATE_SECTION_TOOL,

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/greirson/mcp-todoist'

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