Skip to main content
Glama
greirson

Todoist MCP Server

todoist_section_get

Retrieve sections within Todoist projects to organize tasks by category or workflow stage, using project IDs to filter results.

Instructions

Get a list of sections within a project from Todoist with their IDs and names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoProject ID to get sections for (optional - if not provided, gets sections for all projects)

Implementation Reference

  • The core handler function that implements the todoist_section_get tool. It calls the Todoist API's getSections method, processes the response, and formats the list of sections for output.
    export async function handleGetSections(
      todoistClient: TodoistApi,
      args: GetSectionsArgs
    ): Promise<string> {
      // Use getSections with proper type handling
      const result = await todoistClient.getSections(
        args as Parameters<typeof todoistClient.getSections>[0]
      );
    
      // Handle the new API response format with 'results' property
      const sections = extractArrayFromResponse<TodoistSection>(result);
    
      const sectionList = sections
        .map(
          (section: TodoistSection) =>
            `- ${section.name} (ID: ${section.id}, Project ID: ${section.projectId})`
        )
        .join("\n");
    
      return sections.length > 0
        ? `Sections:\n${sectionList}`
        : "No sections found";
    }
  • Defines the tool schema for todoist_section_get, including name, description, and input schema with optional project_id parameter.
    export const GET_SECTIONS_TOOL: Tool = {
      name: "todoist_section_get",
      description:
        "Get a list of sections within a project from Todoist with their IDs and names",
      inputSchema: {
        type: "object",
        properties: {
          project_id: {
            type: "string",
            description:
              "Project ID to get sections for (optional - if not provided, gets sections for all projects)",
          },
        },
      },
    };
  • src/index.ts:191-196 (registration)
    Registers and dispatches the todoist_section_get tool in the main server request handler switch statement, performing argument validation and calling the handler.
    case "todoist_section_get":
      if (!isGetSectionsArgs(args)) {
        throw new Error("Invalid arguments for todoist_section_get");
      }
      result = await handleGetSections(apiClient, args);
      break;
  • Includes the todoist_section_get tool (via PROJECT_TOOLS) in the complete list of available tools served by the MCP server.
    export const ALL_TOOLS = [
      ...TASK_TOOLS,
      ...PROJECT_TOOLS,
      ...COMMENT_TOOLS,
      ...LABEL_TOOLS,
      ...SUBTASK_TOOLS,
      ...TEST_TOOLS,
    ];
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a 'Get' operation (implying read-only) but doesn't disclose behavioral traits like authentication requirements, rate limits, error conditions, or what happens when project_id is invalid. The description is minimal and lacks important operational context.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core functionality, making it easy for an agent to quickly understand what the tool does.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the return format looks like (structure of the list, pagination, error responses) or important behavioral aspects. For a tool that retrieves data, more context about the response would be helpful to the agent.

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%, with the parameter fully documented in the schema. The description doesn't add any meaningful parameter semantics beyond what's already in the schema (that project_id is optional and gets sections for all projects if not provided). This meets the baseline for high schema coverage.

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 'list of sections within a project from Todoist' with specific attributes 'IDs and names'. It distinguishes from sibling tools like todoist_project_get (which gets projects) and todoist_section_create (which creates sections), though it doesn't explicitly mention these distinctions.

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 when needing sections for a project, but provides no explicit guidance on when to use this tool versus alternatives like todoist_project_get (for projects) or todoist_task_get (for tasks). It mentions the optional parameter behavior but doesn't give context about typical use cases or prerequisites.

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

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