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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"project_id": {
"title": "Project Id",
"type": "string"
}
},
"required": [
"project_id"
],
"title": "todoist_get_projectArguments",
"type": "object"
}
Implementation Reference
- src/projects.py:38-59 (handler)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, )