Skip to main content
Glama
vitalio-sh

Enhanced Todoist MCP Server Extended

todoist_get_projects

Retrieve all active Todoist projects with pagination control to manage large project lists efficiently.

Instructions

Get all active projects with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor for next page (optional)
limitNoMaximum number of projects to return (default: 50, max: 200) (optional)

Implementation Reference

  • Handler implementation for the 'todoist_get_projects' tool. Validates input with isProjectArgs, fetches projects from Todoist API using todoistClient.getProjects with pagination params, formats output with formatProject, and returns formatted list with next cursor.
    if (name === "todoist_get_projects") {
      if (!isProjectArgs(args)) {
        throw new Error("Invalid arguments for todoist_get_projects");
      }
      
      const params: any = {};
      if (args.cursor) params.cursor = args.cursor;
      if (args.limit) params.limit = args.limit;
    
      const projectsResponse = await todoistClient.getProjects(params);
      
      const projectList = projectsResponse.results?.map(formatProject).join('\n\n') || 'No projects found';
      const nextCursor = projectsResponse.nextCursor ? `\n\nNext cursor: ${projectsResponse.nextCursor}` : '';
      
      return {
        content: [{ 
          type: "text", 
          text: `Projects:\n${projectList}${nextCursor}` 
        }],
        isError: false,
      };
    }
  • Schema definition for the 'todoist_get_projects' tool, specifying name, description, and input schema for optional pagination parameters (cursor and limit).
    const GET_PROJECTS_TOOL: Tool = {
      name: "todoist_get_projects",
      description: "Get all active projects with pagination support",
      inputSchema: {
        type: "object",
        properties: {
          cursor: {
            type: "string",
            description: "Pagination cursor for next page (optional)"
          },
          limit: {
            type: "number",
            description: "Maximum number of projects to return (default: 50, max: 200) (optional)",
            default: 50
          }
        }
      }
    };
  • src/index.ts:1083-1121 (registration)
    Registration of the 'todoist_get_projects' tool (as GET_PROJECTS_TOOL) in the list of available 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,
      ],
    }));
  • Helper function formatProject used in the handler to format individual project details for output.
    function formatProject(project: any): string {
      return `- ${project.name}${project.color ? `\n  Color: ${project.color}` : ''}${project.isFavorite ? `\n  Favorite: Yes` : ''}${project.viewStyle ? `\n  View: ${project.viewStyle}` : ''}${project.parentId ? `\n  Parent: ${project.parentId}` : ''}${project.id ? ` (ID: ${project.id})` : ''}`;
    }
  • Type guard helper isProjectArgs used in the handler to validate input arguments for pagination.
    function isProjectArgs(args: unknown): args is {
      cursor?: string;
      limit?: number;
    } {
      // Allows empty object or object with optional cursor/limit
      return typeof args === "object" && args !== null;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it retrieves 'all active projects' (implying it excludes archived/inactive ones) and has 'pagination support'. However, it doesn't cover other important aspects like authentication requirements, rate limits, error handling, or the format of returned data (e.g., what fields are included).

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 active projects') and adds essential behavioral detail ('with pagination support'). There is no wasted wording, and every part of the sentence provides value.

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 (list operation with pagination), no annotations, and no output schema, the description is minimally adequate. It covers the scope ('active projects') and pagination, but lacks details on authentication, rate limits, error cases, or return format. For a read-only list tool, this is acceptable but leaves gaps an agent might need to infer.

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 the two parameters (cursor and limit) with their types, optionality, and defaults. The description adds no additional parameter semantics beyond implying pagination through 'cursor' and 'limit', which is already clear from the schema. 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 action ('Get') and resource ('all active projects'), making the purpose immediately understandable. It distinguishes from siblings like 'todoist_get_project' (singular) by specifying 'all active projects' with pagination, though it doesn't explicitly contrast with other list tools like 'todoist_get_labels' or 'todoist_get_comments'.

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. It doesn't mention when to prefer this over 'todoist_get_project' for a single project, or how it relates to other list tools like 'todoist_get_tasks' or 'todoist_get_labels'. The description lacks context about 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/vitalio-sh/todoist-mcp-server-ext'

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