| 1 | --- |
| 2 | name: cron |
| 3 | description: Schedule reminders and recurring tasks. |
| 4 | --- |
| 5 | |
| 6 | # Cron |
| 7 | |
| 8 | Use the `cron` tool to schedule reminders or recurring tasks. |
| 9 | |
| 10 | ## Three Modes |
| 11 | |
| 12 | 1. **Reminder** - message is sent directly to user |
| 13 | 2. **Task** - message is a task description, agent executes and sends result |
| 14 | 3. **One-time** - runs once at a specific time, then auto-deletes |
| 15 | |
| 16 | ## Examples |
| 17 | |
| 18 | Fixed reminder: |
| 19 | ``` |
| 20 | cron(action="add", message="Time to take a break!", every_seconds=1200) |
| 21 | ``` |
| 22 | |
| 23 | Dynamic task (agent executes each time): |
| 24 | ``` |
| 25 | cron(action="add", message="Check HKUDS/nanobot GitHub stars and report", every_seconds=600) |
| 26 | ``` |
| 27 | |
| 28 | One-time scheduled task (compute ISO datetime from current time): |
| 29 | ``` |
| 30 | cron(action="add", message="Remind me about the meeting", at="<ISO datetime>") |
| 31 | ``` |
| 32 | |
| 33 | Timezone-aware cron: |
| 34 | ``` |
| 35 | cron(action="add", message="Morning standup", cron_expr="0 9 * * 1-5", tz="America/Vancouver") |
| 36 | ``` |
| 37 | |
| 38 | List/remove: |
| 39 | ``` |
| 40 | cron(action="list") |
| 41 | cron(action="remove", job_id="abc123") |
| 42 | ``` |
| 43 | |
| 44 | ## Time Expressions |
| 45 | |
| 46 | | User says | Parameters | |
| 47 | |-----------|------------| |
| 48 | | every 20 minutes | every_seconds: 1200 | |
| 49 | | every hour | every_seconds: 3600 | |
| 50 | | every day at 8am | cron_expr: "0 8 * * *" | |
| 51 | | weekdays at 5pm | cron_expr: "0 17 * * 1-5" | |
| 52 | | 9am Vancouver time daily | cron_expr: "0 9 * * *", tz: "America/Vancouver" | |
| 53 | | at a specific time | at: ISO datetime string (compute from current time) | |
| 54 | |
| 55 | ## Timezone |
| 56 | |
| 57 | Use `tz` with `cron_expr` to schedule in a specific IANA timezone. Without `tz`, the server's local timezone is used. |
| 58 |