diff --git a/src/fabledassistant/services/tools.py b/src/fabledassistant/services/tools.py index 0810239..85db213 100644 --- a/src/fabledassistant/services/tools.py +++ b/src/fabledassistant/services/tools.py @@ -740,6 +740,10 @@ async def execute_tool(user_id: int, tool_name: str, arguments: dict) -> dict: if tool_name == "create_task": task_title = arguments.get("title", "Untitled Task") task_body = arguments.get("body", "") + if not isinstance(task_title, str): + return {"success": False, "error": "title must be a string. Call create_task once per task."} + if not isinstance(task_body, str): + task_body = "" note = await create_note( user_id=user_id, title=task_title, @@ -767,6 +771,12 @@ async def execute_tool(user_id: int, tool_name: str, arguments: dict) -> dict: note_title = arguments.get("title", "Untitled Note") note_body = arguments.get("body", "") note_tags = arguments.get("tags", []) + if not isinstance(note_title, str): + return {"success": False, "error": "title must be a string. Call create_note once per note."} + if not isinstance(note_body, str): + note_body = "" + if not isinstance(note_tags, list): + note_tags = [] note = await create_note( user_id=user_id, title=note_title,