Skip to main content
Glama
vitalio-sh

Enhanced Todoist MCP Server Extended

todoist_get_sections

Retrieve sections from Todoist projects, with options to filter by project ID and manage pagination for organized task management.

Instructions

Get all sections, or sections for a specific project. Supports pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoFilter sections by project ID (optional).
cursorNoPagination cursor for next page (optional).
limitNoMaximum number of sections to return (default: 50) (optional).

Implementation Reference

  • The main handler logic for executing the 'todoist_get_sections' tool. It validates arguments using isSectionArgs, calls todoistClient.getSections with optional projectId, cursor, limit parameters, formats the results into a readable list, and handles pagination cursor.
    if (name === "todoist_get_sections") {
      if (!isSectionArgs(args)) {
        throw new Error("Invalid arguments for todoist_get_sections");
      }
      
      const params: any = {};
      if (args.projectId) params.projectId = args.projectId;
      if (args.cursor) params.cursor = args.cursor;
      if (args.limit) params.limit = args.limit;
    
      const sectionsResponse = await todoistClient.getSections(params);
      
      const sectionList = sectionsResponse.results?.map((section: any) => 
        `- ${section.name} (ID: ${section.id}, Project ID: ${section.projectId})`
      ).join('\n') || 'No sections found';
      
      const nextCursorMessage = sectionsResponse.nextCursor ? `\n\nNext cursor for more sections: ${sectionsResponse.nextCursor}` : '';
      
      return {
        content: [{ 
          type: "text", 
          text: `Sections:\n${sectionList}${nextCursorMessage}` 
        }],
        isError: false,
      };
    }
  • The Tool object definition including name, description, and inputSchema for 'todoist_get_sections'.
    const GET_SECTIONS_TOOL: Tool = {
      name: "todoist_get_sections",
      description: "Get all sections, or sections for a specific project. Supports pagination.",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "string",
            description: "Filter sections by project ID (optional)."
          },
          cursor: {
            type: "string",
            description: "Pagination cursor for next page (optional)."
          },
          limit: {
            type: "number",
            description: "Maximum number of sections to return (default: 50) (optional)."
          }
        }
      }
    };
  • src/index.ts:1083-1121 (registration)
    Registration of the todoist_get_sections tool (as GET_SECTIONS_TOOL) in the list of tools returned by ListToolsRequestSchema handler.
    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 helper function isSectionArgs used in the handler to validate input arguments for todoist_get_sections.
    function isSectionArgs(args: unknown): args is {
      projectId?: string;
      cursor?: string;
      limit?: number;
    } {
      // Allows empty object or object with optional projectId, cursor, limit
      return typeof args === "object" && args !== null;
    }
Behavior3/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 discloses key behavioral traits: it supports pagination (via cursor and limit) and optional project filtering. However, it doesn't mention rate limits, authentication needs, error handling, or what the return format looks like (e.g., list of sections with fields). This leaves gaps for a read operation tool.

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, efficient sentence that front-loads the core purpose ('Get all sections, or sections for a specific project') and adds key context ('Supports pagination') without any waste. Every word earns its place, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is partially complete. It covers the basic purpose and pagination support but lacks details on return values, error cases, or integration with sibling tools. Without an output schema, the description should ideally hint at the response structure, but it doesn't, leaving room for improvement.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters (projectId, cursor, limit) with descriptions. The description adds minimal value beyond the schema by implying that projectId filters sections and pagination is supported, but doesn't provide additional syntax, format details, or examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('sections'), specifying scope ('all sections, or sections for a specific project'). It distinguishes from siblings like todoist_get_projects (which gets projects) and todoist_get_tasks (which gets tasks), but doesn't explicitly differentiate from other section-related tools like todoist_create_section or todoist_update_section, which is why it's not a 5.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'sections for a specific project' and 'pagination,' suggesting when to use it (e.g., for filtered or paginated retrieval). However, it lacks explicit guidance on when to use this versus alternatives like todoist_get_projects for project data or todoist_search_tasks for task-based queries, and no exclusions are provided.

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/vitalio-sh/todoist-mcp-server-ext'

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