Skip to main content
Glama
greirson

Todoist MCP Server

todoist_project_get

Retrieve all Todoist projects with their IDs and names to manage tasks and organize workflows effectively.

Instructions

Get a list of all projects from Todoist with their IDs and names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool: fetches all Todoist projects using the API and returns a formatted list of project names and IDs.
    export async function handleGetProjects(
      todoistClient: TodoistApi
    ): Promise<string> {
      const result = await todoistClient.getProjects();
    
      // Handle the new API response format with 'results' property
      const projects = extractArrayFromResponse<TodoistProject>(result);
    
      const projectList = projects
        .map((project: TodoistProject) => `- ${project.name} (ID: ${project.id})`)
        .join("\n");
    
      return projects.length > 0
        ? `Projects:\n${projectList}`
        : "No projects found";
    }
  • Tool schema definition: specifies the name, description, and empty input schema (no parameters required).
    export const GET_PROJECTS_TOOL: Tool = {
      name: "todoist_project_get",
      description:
        "Get a list of all projects from Todoist with their IDs and names",
      inputSchema: {
        type: "object",
        properties: {},
      },
    };
  • src/index.ts:184-189 (registration)
    Tool registration in the main server request handler: switch case that validates arguments and calls the project handler.
    case "todoist_project_get":
      if (!isGetProjectsArgs(args)) {
        throw new Error("Invalid arguments for todoist_project_get");
      }
      result = await handleGetProjects(apiClient);
      break;

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