create_sections
Organize Todoist projects by adding structured sections to categorize and group related tasks effectively.
Instructions
Create new sections in Todoist
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes |
Implementation Reference
- src/utils/handlers.ts:311-332 (handler)Core execution logic for the 'create_sections' tool (create mode): POSTs each item to Todoist API at '/sections' with parameters name, project_id, and optional order, returning the created item.// Create mode else { finalPath = options.path || options.basePath || ''; let result; switch (options.method) { case 'GET': result = await todoistApi.get(finalPath, apiParams); break; case 'POST': result = await todoistApi.post(finalPath, apiParams); break; case 'DELETE': result = await todoistApi.delete(finalPath); break; } return { success: true, created_item: result, }; }
- src/tools/sections.ts:14-25 (registration)Registers the 'create_sections' MCP tool using createBatchApiHandler, specifying the schema, HTTP method, path, and create mode for batch section creation in Todoist.createBatchApiHandler({ name: 'create_sections', description: 'Create new sections in Todoist', itemSchema: { name: z.string(), project_id: z.string(), order: z.number().int().optional(), }, method: 'POST', path: '/sections', mode: 'create', });
- src/tools/sections.ts:17-21 (schema)Zod schema definition for individual section creation input: requires name and project_id, optional order.itemSchema: { name: z.string(), project_id: z.string(), order: z.number().int().optional(), },