Skip to main content
Glama
mikemc

Todoist MCP Server

by mikemc

todoist_get_project

Retrieve a specific project from Todoist using its unique project ID. Enables users to access and manage project details directly through the Todoist MCP Server.

Instructions

Get a single project from Todoist

Args: project_id: ID of the project to retrieve

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Implementation Reference

  • The core handler function for the 'todoist_get_project' tool. It retrieves a specific Todoist project by its ID using the shared Todoist API client from the request context, handles errors, and returns the project data as JSON.
    def todoist_get_project(ctx: Context, project_id: str) -> str:
        """Get a single project from Todoist
    
        Args:
            project_id: ID of the project to retrieve
        """
        todoist_client = ctx.request_context.lifespan_context.todoist_client
    
        try:
            logger.info(f"Getting project with ID: {project_id}")
    
            project = todoist_client.get_project(project_id=project_id)
    
            if not project:
                logger.info(f"No project found with ID: {project_id}")
                return f"No project found with ID: {project_id}"
    
            logger.info(f"Retrieved project: {project.id}")
            return json.dumps(project.to_dict(), indent=2, default=str)
        except Exception as error:
            logger.error(f"Error getting project: {error}")
            return f"Error getting project: {str(error)}"
  • src/main.py:73-73 (registration)
    Registration of the 'todoist_get_project' tool using the FastMCP decorator, which automatically generates schema from the function signature and registers it with the MCP server.
    mcp.tool()(todoist_get_project)
  • src/main.py:12-18 (registration)
    Import of the 'todoist_get_project' handler function from the projects module into main.py for registration.
    from .projects import (
        todoist_get_projects,
        todoist_get_project,
        todoist_add_project,
        todoist_update_project,
        todoist_delete_project,
    )

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/mikemc/todoist-mcp-server'

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