Skip to main content
Glama

update_sections

Modify existing sections in Todoist projects to reorganize tasks and improve workflow structure.

Instructions

Update sections in Todoist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Implementation Reference

  • Executes the update logic for the update_sections tool: validates item ID, secures path parameter, removes ID from body, performs POST to Todoist API /sections/{id} with update params (e.g. name), returns per-item result.
    if (options.mode !== 'create' && options.idField) {
        let itemId = item[options.idField];
        let matchedName = null;
        let matchedContent = null;
    
        // If no ID but name is provided, search by name
        if (!itemId && item[options.nameField!] && options.findByName) {
            const searchName = item[options.nameField!];
            const matchedItem = options.findByName(searchName, allItems);
    
            if (!matchedItem) {
                return {
                    success: false,
                    error: `Item not found with name: ${searchName}`,
                    item,
                };
            }
    
            itemId = matchedItem.id;
            matchedName = searchName;
            matchedContent = matchedItem.content;
        }
    
        if (!itemId) {
            return {
                success: false,
                error: `Either ${options.idField} or ${options.nameField} must be provided`,
                item,
            };
        }
    
        // Apply security validation to itemId before using in path
        const safeItemId = validatePathParameter(itemId, options.idField || 'id');
    
        if (options.basePath && options.pathSuffix) {
            finalPath = `${options.basePath}${options.pathSuffix.replace('{id}', safeItemId)}`;
        } else if (options.path) {
            finalPath = options.path.replace('{id}', safeItemId);
        }
    
        delete apiParams[options.idField];
        if (options.nameField) {
            delete apiParams[options.nameField];
        }
    
        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;
        }
    
        const response: any = {
            success: true,
            id: itemId,
            result,
        };
    
        if (matchedName) {
            response.found_by_name = matchedName;
            response.matched_content = matchedContent;
        }
    
        return response;
    }
  • Zod input schema for individual items in update_sections batch call: requires section ID, optional new name.
    itemSchema: {
        id: z.string(),
        name: z.string().optional(),
    },
  • Registers the MCP tool 'update_sections' with batch handler creator, defining name, description, schema, API endpoint, method, mode, and ID field.
    createBatchApiHandler({
        name: 'update_sections',
        description: 'Update sections in Todoist',
        itemSchema: {
            id: z.string(),
            name: z.string().optional(),
        },
        method: 'POST',
        path: '/sections/{id}',
        mode: 'update',
        idField: 'id',
    });
  • TodoistClient.post method invoked to perform the actual HTTP POST request to update the section in Todoist API.
    async post(endpoint: string, data: Record<string, any> = {}): Promise<any> {
        const url = `${API_BASE_URL}${endpoint}`;
    
        log(`Making POST request to: ${url} with data:`, JSON.stringify(data, null, 2));
    
        const response = await fetch(url, {
            method: 'POST',
            headers: this.getHeaders(true),
            body: JSON.stringify(data),
        });
    
        return this.handleResponse(response);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'Update' which implies mutation, but doesn't disclose behavioral traits such as required permissions, whether updates are reversible, rate limits, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded and efficiently conveys the core action and resource, making it appropriately concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It lacks details on parameters, behavior, error handling, and output, leaving significant gaps for the agent to understand and use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides no parameter information, and schema description coverage is 0%. The input schema defines an 'items' array with 'id' and 'name' properties, but the description doesn't explain what these represent (e.g., that 'id' identifies sections to update and 'name' sets new names). This fails to compensate for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Update') and resource ('sections in Todoist'), which provides a basic understanding of what the tool does. However, it doesn't specify what aspects of sections can be updated or how this differs from sibling tools like 'create_sections' or 'delete_sections', making it somewhat vague.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing sections to update), contrast with 'create_sections' for new sections, or specify scenarios where updates are appropriate, leaving the agent without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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