Skip to main content
Glama
kydycode

Enhanced Todoist MCP Server Extended

todoist_create_project

Create and manage new Todoist projects with customizable options like name, color, view style, and parent project for organized task tracking and productivity.

Instructions

Create a new project

Input Schema

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

Implementation Reference

  • The main handler logic for the 'todoist_create_project' tool within the CallToolRequestSchema request handler. It validates input arguments using isCreateProjectArgs type guard, constructs the project data object, calls todoistClient.addProject to create the project, formats the response using formatProject, and returns a success message.
    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, }; }
  • The Tool object definition for 'todoist_create_project', including the name, description, and detailed inputSchema with properties for project name, parentId, color, isFavorite, and 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:1083-1121 (registration)
    Registration of the tool in the ListToolsRequestSchema handler by including CREATE_PROJECT_TOOL in the array of available tools returned by the server.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ // Task tools CREATE_TASK_TOOL, QUICK_ADD_TASK_TOOL, GET_TASKS_TOOL, GET_TASK_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, COMPLETE_TASK_TOOL, REOPEN_TASK_TOOL, SEARCH_TASKS_TOOL, MOVE_TASK_TOOL, BULK_MOVE_TASKS_TOOL, // Project tools GET_PROJECTS_TOOL, GET_PROJECT_TOOL, CREATE_PROJECT_TOOL, UPDATE_PROJECT_TOOL, DELETE_PROJECT_TOOL, // Section tools GET_SECTIONS_TOOL, CREATE_SECTION_TOOL, UPDATE_SECTION_TOOL, DELETE_SECTION_TOOL, // Label tools CREATE_LABEL_TOOL, GET_LABEL_TOOL, GET_LABELS_TOOL, UPDATE_LABEL_TOOL, DELETE_LABEL_TOOL, // Comment tools CREATE_COMMENT_TOOL, GET_COMMENT_TOOL, GET_COMMENTS_TOOL, UPDATE_COMMENT_TOOL, DELETE_COMMENT_TOOL, ], }));
  • Type guard function isCreateProjectArgs used to validate the input arguments for the todoist_create_project 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 the project details in the tool's response output.
    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