Skip to main content
Glama

get_project

Retrieve a specific Todoist project by its ID to view project details and manage associated tasks.

Instructions

Get a specific project by ID.

Args:
    project_id: The ID of the project to retrieve

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Implementation Reference

  • The MCP tool handler for 'get_project'. It checks the client, fetches the project using the TodoistClient, and formats the response as a string.
    @mcp.tool()
    async def get_project(project_id: str) -> str:
        """Get a specific project by ID.
        
        Args:
            project_id: The ID of the project to retrieve
        """
        _check_client()
        
        project = await todoist_client.get_project(project_id)
        
        return (
            f"Project: {project.name}\n"
            f"ID: {project.id}\n"
            f"Color: {project.color}\n"
            f"Shared: {project.is_shared}\n"
            f"Favorite: {project.is_favorite}\n"
            f"View Style: {project.view_style}\n"
            f"URL: {project.url}"
        )
  • The TodoistClient helper method that performs the actual API call to retrieve project details and parses it into TodoistProject model.
    async def get_project(self, project_id: str) -> TodoistProject:
        """Get a specific project by ID."""
        data = await self._request("GET", f"/projects/{project_id}")
        return TodoistProject(**data)
  • Pydantic model defining the structure of a TodoistProject used in the tool response.
    class TodoistProject(BaseModel):
        """Represents a Todoist project."""
        id: str
        name: str
        comment_count: int = 0
        order: int = 0
        color: str = "grey"
        is_shared: bool = False
        is_favorite: bool = False
        is_inbox_project: bool = False
        is_team_inbox: bool = False
        view_style: str = "list"
        url: str = ""
        parent_id: Optional[str] = None
  • The @mcp.tool() decorator registers the get_project function as an MCP tool.
    @mcp.tool()

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/dan-bailey/todoist-mcp'

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