get_pending_todos
Retrieve all overdue and incomplete reminders from the MCP Reminder server to check for pending notifications.
Instructions
获取所有到期且未完成的待办事项
小智会定期调用此接口检查是否有需要提醒的待办
Returns: 包含到期待办列表的字典
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_reminder/server.py:196-224 (handler)The MCP tool handler for 'get_pending_todos' in server.py, which calls the storage backend to retrieve pending tasks.
@mcp.tool() def get_pending_todos() -> dict: """ 获取所有到期且未完成的待办事项 小智会定期调用此接口检查是否有需要提醒的待办 Returns: 包含到期待办列表的字典 """ pending_todos = storage.get_pending_todos() logger.info(f"查询到期待办,找到 {len(pending_todos)} 个") if not pending_todos: return { "success": True, "count": 0, "todos": [], "message": "当前没有到期的待办事项" } todos_data = [ { "id": todo.id, "title": todo.title, "description": todo.description, "remind_time": todo.remind_time } - src/mcp_reminder/storage.py:135-138 (helper)The underlying storage method that performs the actual logic to filter for due/pending todos.
def get_pending_todos(self) -> List[Todo]: """获取所有到期且未完成的待办事项""" todos = self.load_todos() return [todo for todo in todos if todo.is_due()]