Skip to main content
Glama

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
NameRequiredDescriptionDefault
itemsYes

Implementation Reference

  • 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,
        };
    }
  • 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',
    });
  • 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(),
    },

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

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