todo_list
Retrieve recent todo snapshots to track tasks and manage project workflows, with options to filter by project path and limit results.
Instructions
List recent todo snapshots
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results | |
| project_path | No | Filter by project path |
Implementation Reference
- src/mcp_server/server.py:482-487 (handler)Handler logic for the 'todo_list' tool call. Retrieves todo snapshots from storage using the provided limit and optional project_path filter, formats the list, and returns it as formatted text.if name == "todo_list": limit = arguments.get("limit", 20) project_path = arguments.get("project_path") snapshots = self.storage.list_todo_snapshots(project_path=project_path, limit=limit) result = self._format_todo_snapshots_response(snapshots) return [TextContent(type="text", text=result)]
- src/mcp_server/server.py:233-249 (registration)Registration of the 'todo_list' tool in the list_tools() method, defining its name, description, and input schema.name="todo_list", description="List recent todo snapshots", inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Maximum number of results", "default": 20, }, "project_path": { "type": "string", "description": "Filter by project path", }, }, }, ),
- src/mcp_server/server.py:688-709 (helper)Helper function to format the list of todo snapshots into a human-readable string response for the todo_list tool.def _format_todo_snapshots_response(self, snapshots: list[Any]) -> str: """Format a list of todo snapshots for response.""" from models import TodoListSnapshot if not snapshots: return "No todo snapshots found." lines = [f"Found {len(snapshots)} todo snapshots:\n"] for snapshot in snapshots: if isinstance(snapshot, TodoListSnapshot): active_icon = "★" if snapshot.is_active else "○" completed = sum(1 for t in snapshot.todos if t.status == "completed") total = len(snapshot.todos) context_str = f" - {snapshot.context}" if snapshot.context else "" lines.append( f"{active_icon} {snapshot.timestamp.isoformat()}\n" f" ID: {snapshot.id}\n" f" Project: {snapshot.project_path}\n" f" Progress: {completed}/{total} completed{context_str}\n" ) return "\n".join(lines)
- src/models.py:45-64 (schema)Pydantic schema definitions for Todo item and TodoListSnapshot used in todo_list tool's data handling and storage.class Todo(BaseModel): """Represents a single todo item.""" content: str status: str # "pending" | "in_progress" | "completed" activeForm: str # noqa: N815 - matches Claude Code TodoWrite tool format class TodoListSnapshot(BaseModel): """Represents a saved snapshot of a todo list.""" id: str = Field(default_factory=lambda: str(uuid4())) timestamp: datetime = Field(default_factory=datetime.now) project_path: str git_branch: str | None = None todos: list[Todo] context: str | None = None session_context_id: str | None = None is_active: bool = False metadata: dict[str, Any] = Field(default_factory=dict)