fix(todo): add missing read_todos/write_todos methods to TodoTool

The TodoTool was calling self.read_todos() and self.write_todos() but
these methods were not defined in either TodoTool or TodoBaseTool.
Added the methods using TodoStorage with a default session ID.
This commit is contained in:
2025-12-24 18:10:40 -08:00
parent fa82e6aced
commit cb714532f2
3 changed files with 15 additions and 3 deletions
+13 -1
View File
@@ -4,6 +4,7 @@ import uuid
from typing import (
Any,
Dict,
List,
Unpack,
Optional,
Annotated,
@@ -16,9 +17,12 @@ from datetime import datetime
from pydantic import Field
from mcp.server.fastmcp import Context as MCPContext
from hanzo_mcp.tools.todo.base import TodoBaseTool
from hanzo_mcp.tools.todo.base import TodoBaseTool, TodoStorage
from hanzo_mcp.tools.common.auto_timeout import auto_timeout
# Default session ID for the unified todo tool
DEFAULT_SESSION_ID = "default-session"
# Parameter types
Action = Annotated[
str,
@@ -84,6 +88,14 @@ class TodoParams(TypedDict, total=False):
class TodoTool(TodoBaseTool):
"""Unified todo management tool."""
def read_todos(self) -> list[Dict[str, Any]]:
"""Read todos from storage using default session."""
return TodoStorage.get_todos(DEFAULT_SESSION_ID)
def write_todos(self, todos: list[Dict[str, Any]]) -> None:
"""Write todos to storage using default session."""
TodoStorage.set_todos(DEFAULT_SESSION_ID, todos)
@property
@override
def name(self) -> str:
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "hanzo-mcp"
version = "0.9.17"
version = "0.9.18"
description = "The Zen of Hanzo MCP: One server to rule them all. The ultimate MCP that orchestrates all others."
readme = "README.md"
requires-python = ">=3.12"
+1 -1
View File
@@ -1003,7 +1003,7 @@ wheels = [
[[package]]
name = "hanzo-mcp"
version = "0.9.15"
version = "0.9.16"
source = { editable = "." }
dependencies = [
{ name = "aiofiles" },