Skip to main content
Glama
kydycode

Enhanced Todoist MCP Server Extended

todoist_create_project

Create a new Todoist project with customizable name, color, view style, and optional sub-project structure to organize tasks effectively.

Instructions

Create a new project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the project
parentIdNoParent project ID for creating a sub-project (optional)
colorNoProject color (optional)
isFavoriteNoWhether to mark as favorite (optional)
viewStyleNoProject view style: 'list' or 'board' (optional)

Implementation Reference

  • Handler implementation for the todoist_create_project tool. Validates input using isCreateProjectArgs, constructs project data, calls todoistClient.addProject(), and returns formatted success response with project details.
    if (name === "todoist_create_project") { if (!isCreateProjectArgs(args)) { throw new Error("Invalid arguments for todoist_create_project"); } const projectData: any = { name: args.name }; if (args.parentId) projectData.parentId = args.parentId; if (args.color) projectData.color = args.color; if (args.isFavorite !== undefined) projectData.isFavorite = args.isFavorite; if (args.viewStyle) projectData.viewStyle = args.viewStyle; const project = await todoistClient.addProject(projectData); return { content: [{ type: "text", text: `Project created successfully:\nID: ${project.id}\n${formatProject(project)}` }], isError: false, }; }
  • Tool schema definition for todoist_create_project, including input schema with properties like name (required), parentId, color, isFavorite, viewStyle.
    const CREATE_PROJECT_TOOL: Tool = { name: "todoist_create_project", description: "Create a new project", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name of the project" }, parentId: { type: "string", description: "Parent project ID for creating a sub-project (optional)" }, color: { type: "string", description: "Project color (optional)" }, isFavorite: { type: "boolean", description: "Whether to mark as favorite (optional)" }, viewStyle: { type: "string", description: "Project view style: 'list' or 'board' (optional)", enum: ["list", "board"] } }, required: ["name"] } };
  • src/index.ts:1098-1102 (registration)
    Registration of todoist_create_project tool (as CREATE_PROJECT_TOOL) in the tools array returned by ListToolsRequestSchema handler.
    GET_PROJECTS_TOOL, GET_PROJECT_TOOL, CREATE_PROJECT_TOOL, UPDATE_PROJECT_TOOL, DELETE_PROJECT_TOOL,
  • Type guard helper function isCreateProjectArgs used to validate arguments in the tool handler.
    function isCreateProjectArgs(args: unknown): args is { name: string; parentId?: string; color?: string; isFavorite?: boolean; viewStyle?: string; } { return ( typeof args === "object" && args !== null && "name" in args && typeof (args as { name: string }).name === "string" ); }
  • Helper function formatProject used to format project details in tool responses.
    function formatProject(project: any): string { return `- ${project.name}${project.color ? `\n Color: ${project.color}` : ''}${project.isFavorite ? `\n Favorite: Yes` : ''}${project.viewStyle ? `\n View: ${project.viewStyle}` : ''}${project.parentId ? `\n Parent: ${project.parentId}` : ''}${project.id ? ` (ID: ${project.id})` : ''}`; }

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/kydycode/todoist-mcp-server-ext'

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