Skip to main content
Glama
kydycode

Enhanced Todoist MCP Server Extended

todoist_create_section

Use this tool to create a new section in a Todoist project by specifying the section name and project ID. Optionally, set the section order for better task organization.

Instructions

Create a new section in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the section
orderNoOrder of the section (optional)
projectIdYesThe project ID where the section will be created

Implementation Reference

  • Executes the tool: validates input with isCreateSectionArgs type guard, builds section data object, calls Todoist API's addSection method, formats and returns success response with new section details.
    if (name === "todoist_create_section") { if (!isCreateSectionArgs(args)) { throw new Error("Invalid arguments for todoist_create_section"); } const sectionData: any = { name: args.name, projectId: args.projectId }; if (args.order !== undefined) sectionData.order = args.order; const section = await todoistClient.addSection(sectionData); return { content: [{ type: "text", text: `Section created successfully:\nID: ${section.id}\nName: ${section.name}\nProject: ${section.projectId}` }], isError: false, }; }
  • Tool schema definition including name, description, and inputSchema with properties for name (required string), projectId (required string), and optional order (number).
    const CREATE_SECTION_TOOL: Tool = { name: "todoist_create_section", description: "Create a new section in a project", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name of the section" }, projectId: { type: "string", description: "The project ID where the section will be created" }, order: { type: "number", description: "Order of the section (optional)" } }, required: ["name", "projectId"] } };
  • src/index.ts:1104-1107 (registration)
    Registration of the todoist_create_section tool (as CREATE_SECTION_TOOL) in the array of tools returned by the ListToolsRequestSchema handler.
    GET_SECTIONS_TOOL, CREATE_SECTION_TOOL, UPDATE_SECTION_TOOL, DELETE_SECTION_TOOL,
  • Type guard function used in the handler to validate arguments for todoist_create_section, ensuring presence and string types for name and projectId.
    function isCreateSectionArgs(args: unknown): args is { name: string; projectId: string; order?: number; } { return ( typeof args === "object" && args !== null && "name" in args && "projectId" in args && typeof (args as { name: string; projectId: string }).name === "string" && typeof (args as { name: string; projectId: string }).projectId === "string" ); }

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