Skip to main content
Glama
Johnxjp

Todoist Python MCP Server

by Johnxjp

get_projects

Retrieve all project folders from Todoist to organize and manage tasks effectively.

Instructions

Get all todo projects. These are like folders for tasks in Todoist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_projects' MCP tool. Decorated with @mcp.tool() for registration. Fetches projects from the Todoist API, maps them to Project dataclasses, and returns the list. Handles exceptions by returning an error message.
    @mcp.tool() def get_projects() -> list[Project]: """Get all todo projects. These are like folders for tasks in Todoist""" try: projects: TodoistProjectResponse = todoist_api.get_projects() return [Project(p.id, p.name) for p in projects] except Exception as e: return f"Error: Couldn't fetch projects {str(e)}"
  • Dataclass defining the Project schema used as the return type for get_projects tool.
    @dataclass class Project: id: str name: str
  • Helper function that uses get_projects to find a project ID by name.
    def get_project_id_by_name(project_name: str) -> str: """Search for a project by name and return its ID""" projects = get_projects() for project in projects: if project.name.lower() == project_name.lower(): return project.id return None

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

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