dismiss_alarm
Cancel or delete scheduled alarms in the MCP Reminder system by providing the alarm ID to stop notifications and remove pending reminders.
Instructions
关闭/删除闹钟
Args: alarm_id: 闹钟ID
Returns: 操作结果
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"alarm_id": "<alarm_id>"
},
"name": "dismiss_alarm"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alarm_id | Yes |
Implementation Reference
- src/mcp_reminder/server.py:114-139 (handler)The handler function `dismiss_alarm` manages the logic for dismissing an alarm by updating its status in the storage.
def dismiss_alarm(alarm_id: str) -> dict: """ 关闭/删除闹钟 Args: alarm_id: 闹钟ID Returns: 操作结果 """ alarm = storage.get_alarm_by_id(alarm_id) if not alarm: return { "success": False, "error": f"未找到ID为 {alarm_id} 的闹钟" } alarm.status = "dismissed" storage.update_alarm(alarm) logger.info(f"关闭闹钟: {alarm_id}") return { "success": True, "message": "闹钟已关闭" }