mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
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:
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
Generated
+1
-1
@@ -1003,7 +1003,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "hanzo-mcp"
|
||||
version = "0.9.15"
|
||||
version = "0.9.16"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "aiofiles" },
|
||||
|
||||
Reference in New Issue
Block a user