complete_todo
Mark todo items as completed by matching their title or keywords, helping users track task progress in the MCP Reminder system.
Instructions
完成待办事项
通过标题关键词匹配待办事项并标记为已完成
Args: title: 待办事项标题或关键词
Returns: 操作结果
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes |
Implementation Reference
- src/mcp_reminder/server_v2.py:324-362 (handler)Implementation of the complete_todo tool in the V2 MCP server.
@mcp.tool() def complete_todo(title: str) -> dict: """ 完成待办事项 通过标题关键词匹配待办事项并标记为已完成 Args: title: 待办事项标题或关键词 Returns: 操作结果 """ if not title: return { "success": False, "error": "请提供待办事项标题或关键词" } # 查找待办事项 todo = storage.find_todo_by_title(title) if not todo: return { "success": False, "error": f"未找到标题包含 '{title}' 的待办事项" } # 标记为已完成 todo.status = "completed" storage.update_todo(todo) logger.info(f"完成待办: {todo.title}") return { "success": True, "todo_id": todo.id, "title": todo.title, "message": f"已完成待办: {todo.title}" }