Skip to main content
Glama
vitalio-sh

Enhanced Todoist MCP Server Extended

todoist_get_tasks

Retrieve Todoist tasks with filtering by project, section, label, or parent, and pagination support for efficient task management.

Instructions

Get tasks with comprehensive filtering and pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoFilter tasks by project ID (optional)
sectionIdNoFilter tasks by section ID (optional)
parentIdNoFilter tasks by parent ID (get subtasks) (optional)
labelNoFilter tasks by label name (optional)
idsNoArray of task IDs to retrieve (optional)
cursorNoPagination cursor for next page (optional)
limitNoMaximum number of tasks to return (default: 50, max: 200) (optional)

Implementation Reference

  • Handler for todoist_get_tasks tool: validates args, constructs params, calls todoistClient.getTasks(), handles paginated or array response, formats output using formatTask, returns formatted task list with optional next cursor.
    if (name === "todoist_get_tasks") {
      if (!isGetTasksArgs(args)) {
        throw new Error("Invalid arguments for todoist_get_tasks");
      }
      
      const params: any = {};
      if (args.projectId) params.projectId = args.projectId;
      if (args.sectionId) params.sectionId = args.sectionId;
      if (args.parentId) params.parentId = args.parentId;
      if (args.label) params.label = args.label;
      if (args.ids && args.ids.length > 0) params.ids = args.ids;
      if (args.cursor) params.cursor = args.cursor;
      if (args.limit) params.limit = args.limit;
    
      const tasks = await todoistClient.getTasks(Object.keys(params).length > 0 ? params : {});
      
      // Handle both array and paginated response formats
      let taskList: string;
      let nextCursor: string = '';
      
      if (Array.isArray(tasks)) {
        taskList = tasks.map(formatTask).join('\n\n');
      } else {
        const paginatedTasks = tasks as any;
        taskList = paginatedTasks.results?.map(formatTask).join('\n\n') || 'No tasks found';
        nextCursor = paginatedTasks.nextCursor ? `\n\nNext cursor: ${paginatedTasks.nextCursor}` : '';
      }
      
      return {
        content: [{ 
          type: "text", 
          text: `Tasks:\n${taskList}${nextCursor}` 
        }],
        isError: false,
      };
    }
  • Tool definition object for todoist_get_tasks, including name, description, and detailed input schema for filtering, pagination, and specific task retrieval.
    const GET_TASKS_TOOL: Tool = {
      name: "todoist_get_tasks",
      description: "Get tasks with comprehensive filtering and pagination support",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "string",
            description: "Filter tasks by project ID (optional)"
          },
          sectionId: {
            type: "string",
            description: "Filter tasks by section ID (optional)"
          },
          parentId: {
            type: "string",
            description: "Filter tasks by parent ID (get subtasks) (optional)"
          },
          label: {
            type: "string",
            description: "Filter tasks by label name (optional)"
          },
          ids: {
            type: "array",
            items: { type: "string" },
            description: "Array of task IDs to retrieve (optional)"
          },
          cursor: {
            type: "string",
            description: "Pagination cursor for next page (optional)"
          },
          limit: {
            type: "number",
            description: "Maximum number of tasks to return (default: 50, max: 200) (optional)",
            default: 50
          }
        }
      }
    };
  • src/index.ts:1083-1121 (registration)
    Registration of all tools including todoist_get_tasks (as GET_TASKS_TOOL) in the 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 function isGetTasksArgs used to validate input arguments for the todoist_get_tasks handler.
    function isGetTasksArgs(args: unknown): args is { 
      projectId?: string;
      sectionId?: string;
      parentId?: string;
      label?: string;
      ids?: string[];
      cursor?: string;
      limit?: number;
    } {
      return typeof args === "object" && args !== null;
    }
  • Helper function formatTask used by todoist_get_tasks (and other task tools) to format task details into a readable string.
    function formatTask(task: any): string {
      let taskDetails = `- ID: ${task.id}\n  Content: ${task.content}`;
      if (task.description) taskDetails += `\n  Description: ${task.description}`;
      if (task.due) taskDetails += `\n  Due: ${task.due.string}`;
      if (task.priority && task.priority > 1) taskDetails += `\n  Priority: ${task.priority}`;
      if (task.labels && task.labels.length > 0) taskDetails += `\n  Labels: ${task.labels.join(', ')}`;
      if (task.projectId) taskDetails += `\n  Project ID: ${task.projectId}`;
      if (task.sectionId) taskDetails += `\n  Section ID: ${task.sectionId}`;
      if (task.parentId) taskDetails += `\n  Parent ID: ${task.parentId}`;
      if (task.url) taskDetails += `\n  URL: ${task.url}`;
      if (task.commentCount > 0) taskDetails += `\n  Comments: ${task.commentCount}`;
      if (task.createdAt) taskDetails += `\n  Created At: ${task.createdAt}`;
      if (task.creatorId) taskDetails += `\n  Creator ID: ${task.creatorId}`;
      return taskDetails;
    }
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 mentions 'comprehensive filtering and pagination support' which hints at capabilities but lacks critical behavioral details: it doesn't disclose authentication requirements, rate limits, whether it's read-only (implied by 'get' but not explicit), error handling, or what the return format looks like (no output schema).

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

Conciseness4/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. However, it could be more structured by explicitly separating filtering from pagination aspects, but it earns high marks for zero waste and clarity within its brevity.

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 tool's complexity (7 parameters, no annotations, no output schema, and multiple sibling tools), the description is incomplete. It lacks details on authentication, rate limits, return format, error cases, and differentiation from siblings, making it inadequate for an agent to use confidently without additional context.

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 fully documents all 7 parameters with descriptions. The description adds no additional meaning beyond the schema's details, such as explaining relationships between filters or pagination mechanics. Baseline 3 is appropriate when schema does the heavy lifting.

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 'Get tasks with comprehensive filtering and pagination support' which indicates the verb (get) and resource (tasks) but is vague about scope and differentiation. It doesn't specify whether this retrieves all tasks, tasks for a specific user, or how it differs from sibling tools like 'todoist_get_task' (singular) or 'todoist_search_tasks'.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'todoist_get_task' (singular), 'todoist_search_tasks', and 'todoist_get_projects', the description offers no explicit or implied context for selection, leaving the agent to infer based on tool names alone.

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