check_all_reminders
Check all expired alarms and todo items to identify pending notifications and overdue tasks for timely follow-up.
Instructions
一次性检查所有到期的提醒(闹钟和待办事项)
这是一个便捷工具,小智可以定期调用此接口来检查是否有需要提醒的内容
Returns: 包含所有到期闹钟和待办的汇总信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_reminder/server_v2.py:407-482 (handler)The tool 'check_all_reminders' is registered using @mcp.tool() and implemented to aggregate both alarms and todo items from the storage.
@mcp.tool() def check_all_reminders() -> dict: """ 一次性检查所有到期的提醒(闹钟和待办事项) 这是一个便捷工具,小智可以定期调用此接口来检查是否有需要提醒的内容 Returns: 包含所有到期闹钟和待办的汇总信息 """ # 获取到期闹钟 pending_alarms = storage.get_pending_alarms() # 获取到期待办 pending_todos = storage.get_pending_todos() total_count = len(pending_alarms) + len(pending_todos) logger.info(f"检查所有提醒,找到 {len(pending_alarms)} 个闹钟和 {len(pending_todos)} 个待办") if total_count == 0: return { "success": True, "has_reminders": False, "total_count": 0, "alarms": [], "todos": [], "message": "当前没有到期的提醒" } # 构建闹钟数据 alarms_data = [ { "id": alarm.id, "time": alarm.time, "description": alarm.description, "type": "alarm" } for alarm in pending_alarms ] # 构建待办数据 todos_data = [ { "id": todo.id, "title": todo.title, "description": todo.description, "remind_time": todo.remind_time, "type": "todo" } for todo in pending_todos ] # 生成提醒消息 messages = [] if pending_alarms: for alarm in pending_alarms: msg = f"闹钟提醒: {alarm.description if alarm.description else '时间到了'}" messages.append(msg) if pending_todos: for todo in pending_todos: msg = f"待办提醒: {todo.title}" messages.append(msg) return { "success": True, "has_reminders": True, "total_count": total_count, "alarm_count": len(pending_alarms), "todo_count": len(pending_todos), "alarms": alarms_data, "todos": todos_data, "messages": messages, "message": f"有 {total_count} 个提醒到期" }