get_projects
Retrieve all projects from Todoist to view and manage your task organization structure.
Instructions
Get all projects from Todoist.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- todoist_mcp/server.py:235-254 (handler)The main MCP tool handler for 'get_projects'. It calls the TodoistClient's get_projects method and formats the results into a human-readable string list.@mcp.tool() async def get_projects() -> str: """Get all projects from Todoist.""" _check_client() projects = await todoist_client.get_projects() if not projects: return "No projects found." project_list = [] for project in projects: project_info = f"• [{project.id}] {project.name}" if project.is_shared: project_info += " (Shared)" if project.is_favorite: project_info += " ⭐" project_list.append(project_info) return f"Found {len(projects)} projects:\n" + "\n".join(project_list)
- todoist_mcp/server.py:235-235 (registration)The @mcp.tool() decorator registers the get_projects function as an MCP tool.@mcp.tool()
- todoist_mcp/client.py:154-157 (helper)TodoistClient helper method that performs the actual API call to retrieve projects from Todoist and parses them into TodoistProject models.async def get_projects(self) -> List[TodoistProject]: """Get all projects.""" data = await self._request("GET", "/projects") return [TodoistProject(**project) for project in data]
- todoist_mcp/client.py:27-41 (schema)Pydantic schema/model for TodoistProject used in parsing API responses.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