Skip to main content
Glama

Todoist Python MCP Server

by Johnxjp

get_projects

Retrieve all Todoist projects to organize and manage task folders efficiently using the Python MCP Server.

Instructions

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

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "title": "get_projectsArguments", "type": "object" }

Implementation Reference

  • The main handler function for the 'get_projects' tool, decorated with @mcp.tool() for registration and execution. It fetches projects from the Todoist API and returns a list of Project objects.
    @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 schema/structure of each project returned by the get_projects tool.
    @dataclass class Project: id: str name: str
  • Internal dataclass used for typing the response from todoist_api.get_projects().
    class TodoistProjectResponse: id: str name: str
  • Helper function that calls 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

Other Tools

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

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