Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(reminders): reminders AI toolset (#5620)

Evan Hutnik083077d6d273
diff --git a/Cargo.lock b/Cargo.lock
index e84cdc74ed..fc6b3d8a06 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12641,6 +12641,9 @@ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
name = "reminders"
version = "0.1.0"
dependencies = [
+ "ai_toolset",
+ "anyhow",
+ "async-trait",
"aws-sdk-sqs",
"axum",
"chrono",
@@ -12658,6 +12661,7 @@ dependencies = [
"model_user",
"notification",
"rootcause",
+ "schemars 1.2.1",
"serde",
"serde_json",
"sqlx",
diff --git a/apps/docs/AI/mcp/tools/create-calendar-event.mdx b/apps/docs/AI/mcp/tools/create-calendar-event.mdx
new file mode 100644
index 0000000000..71d71216ea
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/create-calendar-event.mdx
@@ -0,0 +1,23 @@
+---
+title: CreateCalendarEvent
+description: "Create an event on the user's calendar, inviting any listed attendees through Google Calendar. The event is written to Google immediately, so attendees receive invitations the moment it is created — confirm details with the user before creating events with attendees. The event lands on the user's primary calendar unless `calendarId` (from ListCalendars) targets another one. For recurring events pass RFC 5545 lines in `recurrenceLines`, e.g. [\"RRULE:FREQ=WEEKLY;BYDAY=MO\"]. Returns the created event with its `eventId` for later updates or deletion. Fails if the user has no writable calendar connected."
+---
+
+# CreateCalendarEvent
+
+Create an event on the user's calendar, inviting any listed attendees through Google Calendar. The event is written to Google immediately, so attendees receive invitations the moment it is created — confirm details with the user before creating events with attendees.
+
+The event lands on the user's primary calendar unless `calendarId` (from ListCalendars) targets another one. For recurring events pass RFC 5545 lines in `recurrenceLines`, e.g. ["RRULE:FREQ=WEEKLY;BYDAY=MO"]. Returns the created event with its `eventId` for later updates or deletion. Fails if the user has no writable calendar connected.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `title` | string | Yes | The event title. |
+| `time` | EventTimeInput | Yes | The mutually exclusive time shape supplied to calendar tools. |
+| `description` | string | No | Optional event body/description. |
+| `location` | string | No | Optional physical or virtual location label. |
+| `attendees` | AttendeeInput[] | No | Attendees to invite by email. They are notified by Google Calendar as soon as the event is created. Omit for a solo event. |
+| `recurrenceLines` | string[] | No | Raw RFC 5545 recurrence lines (RRULE, RDATE, EXDATE), e.g. ["RRULE:FREQ=WEEKLY;BYDAY=MO,WE"]. Omit for a one-off event. |
+| `calendarId` | string | No | Calendar to create the event on, from ListCalendars. Omit to use the user's primary calendar. |
+| `addGoogleMeet` | boolean | No | Attach a freshly generated Google Meet video conference to the event. |
diff --git a/apps/docs/AI/mcp/tools/create-reminder.mdx b/apps/docs/AI/mcp/tools/create-reminder.mdx
new file mode 100644
index 0000000000..e7587cf863
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/create-reminder.mdx
@@ -0,0 +1,46 @@
+---
+title: CreateReminder
+description: "Schedule a reminder for the current user. At `remindAt` it is delivered to their Macro inbox as a notification and stays there until they mark it done. A reminder is either attached to one Macro item — so clicking it opens that item — or standalone. Attached is the common case (\"remind me to reply to this email tomorrow\"); standalone is for everything else (\"remind me to book a flight\"). Reminders are private: one is only ever delivered to its owner, and there is no way to set one for somebody else. Only one-off reminders can be created — if the user asks for a repeating one, say so rather than creating a single reminder and implying it repeats. ## Times are UTC — convert both ways Timestamps are absolute instants, in and out, while the user asks in their own timezone. Getting this wrong silently sets the reminder to the wrong hour. - **In:** resolve their wording against their local time, then convert. For America/New_York (UTC-4 in August), \"3pm tomorrow\" on 2026-08-12 is `\"2026-08-13T19:00:00Z\"`, not `\"2026-08-13T15:00:00Z\"`. - **Out:** report the response's UTC value back in their timezone — `\"2026-08-13T19:00:00Z\"` is \"3:00 PM tomorrow\". Ask for their timezone rather than assuming UTC. ## Attaching to an item Pass `entityType` and `entityId` together, using ids from ListEntities, GetThread, or search. The user must already have access to what you attach. `entityType` accepts exactly these values, and a type not on the list cannot be attached even if ListEntities returns it: - `document` — a Macro document - `ai_chat` — an AI chat conversation - `project` — a project, shown as a folder in the app - `email` — an email thread - `channel` — a chat channel - `call` — a call record - `calendar_event` — a calendar event **A channel thread needs its parent channel's id.** `channel` is on the list; `channel_thread` is not. For a thread row, pass `entityType: \"channel\"` with the row's `channelId` — never the thread's own `id`, which will not resolve. Put what the thread is about in the description, since that is what tells two reminders on the same channel apart. For any other unattachable type, create a standalone reminder naming the thing in the description rather than guessing at a type."
+---
+
+# CreateReminder
+
+Schedule a reminder for the current user. At `remindAt` it is delivered to their Macro inbox as a notification and stays there until they mark it done.
+
+A reminder is either attached to one Macro item — so clicking it opens that item — or standalone. Attached is the common case ("remind me to reply to this email tomorrow"); standalone is for everything else ("remind me to book a flight").
+
+Reminders are private: one is only ever delivered to its owner, and there is no way to set one for somebody else. Only one-off reminders can be created — if the user asks for a repeating one, say so rather than creating a single reminder and implying it repeats.
+
+## Times are UTC — convert both ways
+
+Timestamps are absolute instants, in and out, while the user asks in their own timezone. Getting this wrong silently sets the reminder to the wrong hour.
+
+- **In:** resolve their wording against their local time, then convert. For America/New_York (UTC-4 in August), "3pm tomorrow" on 2026-08-12 is `"2026-08-13T19:00:00Z"`, not `"2026-08-13T15:00:00Z"`.
+- **Out:** report the response's UTC value back in their timezone — `"2026-08-13T19:00:00Z"` is "3:00 PM tomorrow".
+
+Ask for their timezone rather than assuming UTC.
+
+## Attaching to an item
+
+Pass `entityType` and `entityId` together, using ids from ListEntities, GetThread, or search. The user must already have access to what you attach. `entityType` accepts exactly these values, and a type not on the list cannot be attached even if ListEntities returns it:
+
+- `document` — a Macro document
+- `ai_chat` — an AI chat conversation
+- `project` — a project, shown as a folder in the app
+- `email` — an email thread
+- `channel` — a chat channel
+- `call` — a call record
+- `calendar_event` — a calendar event
+
+**A channel thread needs its parent channel's id.** `channel` is on the list; `channel_thread` is not. For a thread row, pass `entityType: "channel"` with the row's `channelId` — never the thread's own `id`, which will not resolve. Put what the thread is about in the description, since that is what tells two reminders on the same channel apart.
+
+For any other unattachable type, create a standalone reminder naming the thing in the description rather than guessing at a type.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `description` | string | Yes | What to remind the user about, written as the reminder text they will read — e.g. "Reply to Dana about the Q3 budget". Max 2000 characters. |
+| `remindAt` | string | Yes | When to fire, as an RFC 3339 timestamp in UTC (e.g. "2026-08-08T14:00:00Z"). Must be in the future. Seconds are dropped, so a reminder fires on the minute. Convert from the user's local timezone before sending — see "Times are UTC" in the tool description. |
+| `entityType` | `"document"` \| `"ai_chat"` \| `"project"` \| `"email"` \| `"channel"` \| `"call"` \| `"calendar_event"` | No | Type of the thing the reminder is about — one of document, ai_chat, project, email, channel, call, calendar_event. Requires entityId; omit both for a standalone reminder. |
+| `entityId` | string | No | Id of the thing the reminder is about, as a UUID. Must be the id of an entity of entityType — for a channel_thread row that means its channelId, not its own id. Requires entityType. |
diff --git a/apps/docs/AI/mcp/tools/delete-calendar-event.mdx b/apps/docs/AI/mcp/tools/delete-calendar-event.mdx
new file mode 100644
index 0000000000..087e704f8c
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/delete-calendar-event.mdx
@@ -0,0 +1,18 @@
+---
+title: DeleteCalendarEvent
+description: "Delete an event from the user's calendar. The deletion is written to Google immediately and attendees are notified, so confirm with the user before deleting — it cannot be undone. Get the `eventId` from ListCalendarEvents. For recurring events, `scope` controls how much is removed: \"all\" (default) removes the whole series, \"this_event\" removes one occurrence, and \"this_and_following\" ends the series from an occurrence onward. The scoped variants require `recurrenceId` from the targeted occurrence's ListCalendarEvents entry."
+---
+
+# DeleteCalendarEvent
+
+Delete an event from the user's calendar. The deletion is written to Google immediately and attendees are notified, so confirm with the user before deleting — it cannot be undone. Get the `eventId` from ListCalendarEvents.
+
+For recurring events, `scope` controls how much is removed: "all" (default) removes the whole series, "this_event" removes one occurrence, and "this_and_following" ends the series from an occurrence onward. The scoped variants require `recurrenceId` from the targeted occurrence's ListCalendarEvents entry.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `eventId` | string | Yes | The event's id, from ListCalendarEvents or CreateCalendarEvent. |
+| `scope` | `"all"` \| `"this_event"` \| `"this_and_following"` | No | How much of a recurring series a deletion removes. |
+| `recurrenceId` | string | No | The `recurrenceId` of the targeted occurrence, from its ListCalendarEvents entry. Required for "this_event" and "this_and_following". |
diff --git a/apps/docs/AI/mcp/tools/delete-reminder.mdx b/apps/docs/AI/mcp/tools/delete-reminder.mdx
new file mode 100644
index 0000000000..90f3df2061
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/delete-reminder.mdx
@@ -0,0 +1,16 @@
+---
+title: DeleteReminder
+description: "Permanently delete one of the current user's reminders, along with any notification it already produced. Get the `reminderId` from ListReminders or CreateReminder. This cannot be undone, and it is not the usual way to clear a reminder. When the user has simply dealt with one, use UpdateReminder with `completed: true` instead: that takes it off their active list but keeps it, still readable with ListReminders `completed: true` and restorable with `completed: false`. Delete is for reminders they want gone rather than finished — one set by mistake, or for something that is no longer happening. If it is not clear which they mean, mark it done."
+---
+
+# DeleteReminder
+
+Permanently delete one of the current user's reminders, along with any notification it already produced. Get the `reminderId` from ListReminders or CreateReminder.
+
+This cannot be undone, and it is not the usual way to clear a reminder. When the user has simply dealt with one, use UpdateReminder with `completed: true` instead: that takes it off their active list but keeps it, still readable with ListReminders `completed: true` and restorable with `completed: false`. Delete is for reminders they want gone rather than finished — one set by mistake, or for something that is no longer happening. If it is not clear which they mean, mark it done.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `reminderId` | string | Yes | The id of the reminder to delete. |
diff --git a/apps/docs/AI/mcp/tools/index.mdx b/apps/docs/AI/mcp/tools/index.mdx
index e75474a2c9..f2365b8c46 100644
--- a/apps/docs/AI/mcp/tools/index.mdx
+++ b/apps/docs/AI/mcp/tools/index.mdx
@@ -12,11 +12,15 @@ These pages are generated from Macro's Rust MCP tool registry.
- [BashCodeExecution](/AI/mcp/tools/bash-code-execution)
- [BulkSetEntityPropertyOptions](/AI/mcp/tools/bulk-set-entity-property-options)
- [ContentSearch](/AI/mcp/tools/content-search)
+- [CreateCalendarEvent](/AI/mcp/tools/create-calendar-event)
- [CreateDocument](/AI/mcp/tools/create-document)
- [CreateImportEntity](/AI/mcp/tools/create-import-entity)
- [CreateProject](/AI/mcp/tools/create-project)
+- [CreateReminder](/AI/mcp/tools/create-reminder)
- [CreateTag](/AI/mcp/tools/create-tag)
+- [DeleteCalendarEvent](/AI/mcp/tools/delete-calendar-event)
- [DeleteImportEntity](/AI/mcp/tools/delete-import-entity)
+- [DeleteReminder](/AI/mcp/tools/delete-reminder)
- [DeleteTag](/AI/mcp/tools/delete-tag)
- [DisplayResults](/AI/mcp/tools/display-results)
- [EditDocument](/AI/mcp/tools/edit-document)
@@ -25,12 +29,15 @@ These pages are generated from Macro's Rust MCP tool registry.
- [GetEntityProperties](/AI/mcp/tools/get-entity-properties)
- [GetThread](/AI/mcp/tools/get-thread)
- [ImportNotionPage](/AI/mcp/tools/import-notion-page)
+- [ListCalendarEvents](/AI/mcp/tools/list-calendar-events)
+- [ListCalendars](/AI/mcp/tools/list-calendars)
- [ListCompanies](/AI/mcp/tools/list-companies)
- [ListEntities](/AI/mcp/tools/list-entities)
- [ListImportEntities](/AI/mcp/tools/list-import-entities)
- [ListInboxes](/AI/mcp/tools/list-inboxes)
- [ListLabels](/AI/mcp/tools/list-labels)
- [ListNotifications](/AI/mcp/tools/list-notifications)
+- [ListReminders](/AI/mcp/tools/list-reminders)
- [ListSkills](/AI/mcp/tools/list-skills)
- [ListTags](/AI/mcp/tools/list-tags)
- [ListTeamMembers](/AI/mcp/tools/list-team-members)
@@ -57,6 +64,8 @@ These pages are generated from Macro's Rust MCP tool registry.
- [SetEntityProperty](/AI/mcp/tools/set-entity-property)
- [Subagent](/AI/mcp/tools/subagent)
- [TextEditorCodeExecution](/AI/mcp/tools/text-editor-code-execution)
+- [UpdateCalendarEvent](/AI/mcp/tools/update-calendar-event)
+- [UpdateReminder](/AI/mcp/tools/update-reminder)
- [UpdateThreadLabels](/AI/mcp/tools/update-thread-labels)
- [WebFetch](/AI/mcp/tools/web-fetch)
- [WebSearch](/AI/mcp/tools/web-search)
diff --git a/apps/docs/AI/mcp/tools/list-calendar-events.mdx b/apps/docs/AI/mcp/tools/list-calendar-events.mdx
new file mode 100644
index 0000000000..5ed4f2a7e4
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/list-calendar-events.mdx
@@ -0,0 +1,17 @@
+---
+title: ListCalendarEvents
+description: "List the user's calendar events between two instants, across every calendar they have connected. Returns one entry per occurrence (a recurring event appears once per instance in the window), soonest first, with the `eventId` needed by UpdateCalendarEvent and DeleteCalendarEvent. Use this to answer questions about the user's schedule (\"what's on my calendar tomorrow?\"), to find an event the user wants changed or removed, and to check for conflicts before creating an event. Keep the window as narrow as the request allows — a day or a week — since wide windows truncate at 200 occurrences. The window must be at most 370 days and within one year past to two years future. If `syncStatus` is `syncing`, tell the user results may still be incomplete."
+---
+
+# ListCalendarEvents
+
+List the user's calendar events between two instants, across every calendar they have connected. Returns one entry per occurrence (a recurring event appears once per instance in the window), soonest first, with the `eventId` needed by UpdateCalendarEvent and DeleteCalendarEvent.
+
+Use this to answer questions about the user's schedule ("what's on my calendar tomorrow?"), to find an event the user wants changed or removed, and to check for conflicts before creating an event. Keep the window as narrow as the request allows — a day or a week — since wide windows truncate at 200 occurrences. The window must be at most 370 days and within one year past to two years future. If `syncStatus` is `syncing`, tell the user results may still be incomplete.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `start` | string | Yes | Inclusive window start, RFC 3339 UTC (e.g. 2026-08-20T00:00:00Z). |
+| `end` | string | Yes | Exclusive window end, RFC 3339 UTC. Must be after start. |
diff --git a/apps/docs/AI/mcp/tools/list-calendars.mdx b/apps/docs/AI/mcp/tools/list-calendars.mdx
new file mode 100644
index 0000000000..09c21807e1
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/list-calendars.mdx
@@ -0,0 +1,10 @@
+---
+title: ListCalendars
+description: "List the calendars the user can see across their connected inboxes, with each calendar's `calendarId`, display name, owning inbox address, and whether it is primary and writable. Use this before CreateCalendarEvent when the user wants an event on a specific non-default calendar (e.g. \"add it to my work calendar\") so you can pass the exact `calendarId`. Most users have a single primary calendar, in which case CreateCalendarEvent targets it by default and you do not need this tool. An empty result means no calendar is connected."
+---
+
+# ListCalendars
+
+List the calendars the user can see across their connected inboxes, with each calendar's `calendarId`, display name, owning inbox address, and whether it is primary and writable.
+
+Use this before CreateCalendarEvent when the user wants an event on a specific non-default calendar (e.g. "add it to my work calendar") so you can pass the exact `calendarId`. Most users have a single primary calendar, in which case CreateCalendarEvent targets it by default and you do not need this tool. An empty result means no calendar is connected.
diff --git a/apps/docs/AI/mcp/tools/list-reminders.mdx b/apps/docs/AI/mcp/tools/list-reminders.mdx
new file mode 100644
index 0000000000..09b4c05b5f
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/list-reminders.mdx
@@ -0,0 +1,30 @@
+---
+title: ListReminders
+description: "Read the current user's reminders, soonest first. **Filtered by default: only reminders the user has not marked done**, which is what \"what are my reminders\" means. Pass `completed: true` for the ones they have dealt with. To re-read a reminder you already have the id for, pass it in `reminderIds`. Filters: - `overdue: true` / `false` — already fired and waiting on the user, or still upcoming - `completed: true` / `false` — dealt with, or still outstanding - `entityType` + `entityId` — reminders about one specific thing. `entityType` takes the same values CreateReminder accepts: document, ai_chat, project, email, channel, call, calendar_event The two flags are independent and compose: firing does not complete a reminder, so overdue and not completed is the needs-attention case, and a completed reminder never fires whether or not its time has passed. Each reminder comes back with its `id` (pass to UpdateReminder or DeleteReminder), `description`, `nextRunAt`, `overdue`, and what it is attached to. `nextRunAt` is UTC, so convert before quoting it: for America/New_York (UTC-4 in August), `\"2026-08-13T19:00:00Z\"` is \"3:00 PM tomorrow\". A `recurrence` field means the reminder repeats — rare, and currently broken: nothing in the app creates one and the dispatcher never fires them, so it sits at its `nextRunAt` without arriving. Say that rather than implying it is scheduled."
+---
+
+# ListReminders
+
+Read the current user's reminders, soonest first. **Filtered by default: only reminders the user has not marked done**, which is what "what are my reminders" means. Pass `completed: true` for the ones they have dealt with. To re-read a reminder you already have the id for, pass it in `reminderIds`.
+
+Filters:
+- `overdue: true` / `false` — already fired and waiting on the user, or still upcoming
+- `completed: true` / `false` — dealt with, or still outstanding
+- `entityType` + `entityId` — reminders about one specific thing. `entityType` takes the same values CreateReminder accepts: document, ai_chat, project, email, channel, call, calendar_event
+
+The two flags are independent and compose: firing does not complete a reminder, so overdue and not completed is the needs-attention case, and a completed reminder never fires whether or not its time has passed.
+
+Each reminder comes back with its `id` (pass to UpdateReminder or DeleteReminder), `description`, `nextRunAt`, `overdue`, and what it is attached to. `nextRunAt` is UTC, so convert before quoting it: for America/New_York (UTC-4 in August), `"2026-08-13T19:00:00Z"` is "3:00 PM tomorrow".
+
+A `recurrence` field means the reminder repeats — rare, and currently broken: nothing in the app creates one and the dispatcher never fires them, so it sits at its `nextRunAt` without arriving. Say that rather than implying it is scheduled.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `reminderIds` | string[] | No | Return only these reminders, by id. Use this to re-read a reminder you already know the id of. Omit to list all of them. |
+| `entityType` | `"document"` \| `"ai_chat"` \| `"project"` \| `"email"` \| `"channel"` \| `"call"` \| `"calendar_event"` | No | Return only reminders attached to a thing of this type. Requires entityId. |
+| `entityId` | string | No | Return only reminders attached to the thing with this id. Requires entityType. |
+| `completed` | boolean | No | Filter on whether the user has marked the reminder done. Defaults to false — only reminders still outstanding. Set true for ones already dealt with. |
+| `overdue` | boolean | No | Filter on whether the reminder has already fired. True returns only reminders past their time, false only ones still upcoming. Omit for both. |
+| `limit` | integer | No | Maximum number of reminders to return. Defaults to 20, capped at 100. |
diff --git a/apps/docs/AI/mcp/tools/update-calendar-event.mdx b/apps/docs/AI/mcp/tools/update-calendar-event.mdx
new file mode 100644
index 0000000000..56b1b284b7
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/update-calendar-event.mdx
@@ -0,0 +1,23 @@
+---
+title: UpdateCalendarEvent
+description: "Update an existing calendar event. Only the supplied fields change; omitted fields keep their current values. The change is written to Google immediately and attendees are notified of it, so confirm details with the user first. Get the `eventId` from ListCalendarEvents. Passing `attendees` replaces the full attendee list — include everyone who should remain, not just additions. An empty string for `description` or `location` clears it. Updating a recurring event changes the whole series. Fails on events from calendars the user cannot edit."
+---
+
+# UpdateCalendarEvent
+
+Update an existing calendar event. Only the supplied fields change; omitted fields keep their current values. The change is written to Google immediately and attendees are notified of it, so confirm details with the user first. Get the `eventId` from ListCalendarEvents.
+
+Passing `attendees` replaces the full attendee list — include everyone who should remain, not just additions. An empty string for `description` or `location` clears it. Updating a recurring event changes the whole series. Fails on events from calendars the user cannot edit.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `eventId` | string | Yes | The event's id, from ListCalendarEvents or CreateCalendarEvent. |
+| `title` | string | No | Replacement title. Omit to keep the current title. |
+| `description` | string | No | Replacement event body/description. An empty string clears it; omit to keep the current one. |
+| `location` | string | No | Replacement location label. An empty string clears it; omit to keep the current one. |
+| `time` | EventTimeInput | No | Replacement time: a timed span with `kind` "timed" (startsAt, endsAt, optional timeZone) or whole days with `kind` "allDay" (startDate, exclusive endDate). Omit to keep the current time. |
+| `attendees` | AttendeeInput[] | No | Replacement attendee list — replaces all current attendees, so include everyone who should remain. Omit to leave attendees unchanged. |
+| `recurrenceLines` | string[] | No | Replacement RFC 5545 recurrence lines. An empty list makes the event one-off; omit to keep the current recurrence. |
+| `conference` | `"google_meet"` \| `"remove"` | No | Change the event's video conference: "google_meet" attaches a fresh Google Meet, "remove" detaches the current conference. Omit to leave it untouched. |
diff --git a/apps/docs/AI/mcp/tools/update-reminder.mdx b/apps/docs/AI/mcp/tools/update-reminder.mdx
new file mode 100644
index 0000000000..45db199f80
--- /dev/null
+++ b/apps/docs/AI/mcp/tools/update-reminder.mdx
@@ -0,0 +1,37 @@
+---
+title: UpdateReminder
+description: "Change one of the current user's reminders: reword it, move when it fires, or mark it done. Get the `reminderId` from ListReminders or CreateReminder. Pass only the fields you are changing; anything omitted is left alone. At least one must be given. - Snooze or reschedule: set `remindAt` - Mark done: `completed: true` — the user has dealt with it and it leaves their active list - Reopen: `completed: false` - Reword: set `description` Marking done is the normal way to clear a reminder the user has handled, and it is reversible: the reminder drops out of the default ListReminders results but is still there, readable with `completed: true` and restorable with `completed: false`. Reach for DeleteReminder only when the user wants the reminder not to exist; that cannot be undone. Two things this tool will not do. It cannot change what a reminder is attached to — create a new reminder and delete this one instead. And setting `remindAt` on a repeating reminder replaces the repetition with that single firing, so only do it if the user asked to stop it repeating. ## Times are UTC — convert both ways Timestamps are absolute instants, in and out, while the user asks in their own timezone. Getting this wrong silently sets the reminder to the wrong hour. - **In:** resolve their wording against their local time, then convert. For America/New_York (UTC-4 in August), \"3pm tomorrow\" on 2026-08-12 is `\"2026-08-13T19:00:00Z\"`, not `\"2026-08-13T15:00:00Z\"`. - **Out:** report the response's UTC value back in their timezone — `\"2026-08-13T19:00:00Z\"` is \"3:00 PM tomorrow\". Ask for their timezone rather than assuming UTC."
+---
+
+# UpdateReminder
+
+Change one of the current user's reminders: reword it, move when it fires, or mark it done. Get the `reminderId` from ListReminders or CreateReminder.
+
+Pass only the fields you are changing; anything omitted is left alone. At least one must be given.
+
+- Snooze or reschedule: set `remindAt`
+- Mark done: `completed: true` — the user has dealt with it and it leaves their active list
+- Reopen: `completed: false`
+- Reword: set `description`
+
+Marking done is the normal way to clear a reminder the user has handled, and it is reversible: the reminder drops out of the default ListReminders results but is still there, readable with `completed: true` and restorable with `completed: false`. Reach for DeleteReminder only when the user wants the reminder not to exist; that cannot be undone.
+
+Two things this tool will not do. It cannot change what a reminder is attached to — create a new reminder and delete this one instead. And setting `remindAt` on a repeating reminder replaces the repetition with that single firing, so only do it if the user asked to stop it repeating.
+
+## Times are UTC — convert both ways
+
+Timestamps are absolute instants, in and out, while the user asks in their own timezone. Getting this wrong silently sets the reminder to the wrong hour.
+
+- **In:** resolve their wording against their local time, then convert. For America/New_York (UTC-4 in August), "3pm tomorrow" on 2026-08-12 is `"2026-08-13T19:00:00Z"`, not `"2026-08-13T15:00:00Z"`.
+- **Out:** report the response's UTC value back in their timezone — `"2026-08-13T19:00:00Z"` is "3:00 PM tomorrow".
+
+Ask for their timezone rather than assuming UTC.
+
+## Parameters
+
+| Parameter | Type | Required | Description |
+| --- | --- | --- | --- |
+| `reminderId` | string | Yes | The id of the reminder to change. |
+| `description` | string | No | Replacement reminder text. Max 2000 characters. |
+| `remindAt` | string | No | Reschedule to this RFC 3339 timestamp in UTC (e.g. "2026-08-08T14:00:00Z"). Must be in the future — to move a reminder that has already fired, give it a new future time. Convert from the user's local timezone before sending; see "Times are UTC" in the tool description. |
+| `completed` | boolean | No | Mark the reminder as dealt with (true) or put it back on the active list (false). |
diff --git a/apps/docs/config/tool-pages.json b/apps/docs/config/tool-pages.json
index 1c137ab315..70a4b95ed4 100644
--- a/apps/docs/config/tool-pages.json
+++ b/apps/docs/config/tool-pages.json
@@ -3,11 +3,15 @@
"AI/mcp/tools/bash-code-execution",
"AI/mcp/tools/bulk-set-entity-property-options",
"AI/mcp/tools/content-search",
+ "AI/mcp/tools/create-calendar-event",
"AI/mcp/tools/create-document",
"AI/mcp/tools/create-import-entity",
"AI/mcp/tools/create-project",
+ "AI/mcp/tools/create-reminder",
"AI/mcp/tools/create-tag",
+ "AI/mcp/tools/delete-calendar-event",
"AI/mcp/tools/delete-import-entity",
+ "AI/mcp/tools/delete-reminder",
"AI/mcp/tools/delete-tag",
"AI/mcp/tools/display-results",
"AI/mcp/tools/edit-document",
@@ -16,12 +20,15 @@
"AI/mcp/tools/get-entity-properties",
"AI/mcp/tools/get-thread",
"AI/mcp/tools/import-notion-page",
+ "AI/mcp/tools/list-calendar-events",
+ "AI/mcp/tools/list-calendars",
"AI/mcp/tools/list-companies",
"AI/mcp/tools/list-entities",
"AI/mcp/tools/list-import-entities",
"AI/mcp/tools/list-inboxes",
"AI/mcp/tools/list-labels",
"AI/mcp/tools/list-notifications",
+ "AI/mcp/tools/list-reminders",
"AI/mcp/tools/list-skills",
"AI/mcp/tools/list-tags",
"AI/mcp/tools/list-team-members",
@@ -48,6 +55,8 @@
"AI/mcp/tools/set-entity-property",
"AI/mcp/tools/subagent",
"AI/mcp/tools/text-editor-code-execution",
+ "AI/mcp/tools/update-calendar-event",
+ "AI/mcp/tools/update-reminder",
"AI/mcp/tools/update-thread-labels",
"AI/mcp/tools/web-fetch",
"AI/mcp/tools/web-search"
diff --git a/apps/docs/docs.json b/apps/docs/docs.json
index 18a47010c3..83978423e9 100644
--- a/apps/docs/docs.json
+++ b/apps/docs/docs.json
@@ -72,11 +72,15 @@
"AI/mcp/tools/bash-code-execution",
"AI/mcp/tools/bulk-set-entity-property-options",
"AI/mcp/tools/content-search",
+ "AI/mcp/tools/create-calendar-event",
"AI/mcp/tools/create-document",
"AI/mcp/tools/create-import-entity",
"AI/mcp/tools/create-project",
+ "AI/mcp/tools/create-reminder",
"AI/mcp/tools/create-tag",
+ "AI/mcp/tools/delete-calendar-event",
"AI/mcp/tools/delete-import-entity",
+ "AI/mcp/tools/delete-reminder",
"AI/mcp/tools/delete-tag",
"AI/mcp/tools/display-results",
"AI/mcp/tools/edit-document",
@@ -85,12 +89,15 @@
"AI/mcp/tools/get-entity-properties",
"AI/mcp/tools/get-thread",
"AI/mcp/tools/import-notion-page",
+ "AI/mcp/tools/list-calendar-events",
+ "AI/mcp/tools/list-calendars",
"AI/mcp/tools/list-companies",
"AI/mcp/tools/list-entities",
"AI/mcp/tools/list-import-entities",
"AI/mcp/tools/list-inboxes",
"AI/mcp/tools/list-labels",
"AI/mcp/tools/list-notifications",
+ "AI/mcp/tools/list-reminders",
"AI/mcp/tools/list-skills",
"AI/mcp/tools/list-tags",
"AI/mcp/tools/list-team-members",
@@ -117,6 +124,8 @@
"AI/mcp/tools/set-entity-property",
"AI/mcp/tools/subagent",
"AI/mcp/tools/text-editor-code-execution",
+ "AI/mcp/tools/update-calendar-event",
+ "AI/mcp/tools/update-reminder",
"AI/mcp/tools/update-thread-labels",
"AI/mcp/tools/web-fetch",
"AI/mcp/tools/web-search"
diff --git a/apps/web/src/lib/core/component/AI/component/tool/Reminders.tsx b/apps/web/src/lib/core/component/AI/component/tool/Reminders.tsx
new file mode 100644
index 0000000000..666db2c845
--- /dev/null
+++ b/apps/web/src/lib/core/component/AI/component/tool/Reminders.tsx
@@ -0,0 +1,213 @@
+import { formatDateAndTime } from '@entity';
+import BellSimple from '@phosphor-icons/core/regular/bell-simple.svg';
+import Check from '@phosphor-icons/core/regular/check.svg';
+import Trash from '@phosphor-icons/core/regular/trash.svg';
+import type { NamedTool } from '@service-cognition/generated/tools/tool';
+import type {
+ ListReminders as ListRemindersTool,
+ ReminderEntityType,
+ UpdateReminder as UpdateReminderTool,
+} from '@service-cognition/generated/tools/types';
+import { createSignal, For, Show } from 'solid-js';
+import { BaseTool } from './BaseTool';
+import { Tool } from './Tool';
+import { createToolRenderer } from './ToolRenderer';
+
+type ToolReminder = NamedTool<
+ 'ListReminders',
+ 'response'
+>['data']['reminders'][number];
+
+const ENTITY_TYPE_LABELS: Record<ReminderEntityType, string> = {
+ document: 'a document',
+ ai_chat: 'a chat',
+ project: 'a project',
+ email: 'an email thread',
+ channel: 'a channel',
+ call: 'a call',
+ calendar_event: 'a calendar event',
+};
+
+/** What the list call asked for, in the same voice as the notification tools. */
+const formatReminderFilters = (filters: ListRemindersTool) => {
+ if (filters.reminderIds?.length) {
+ const count = filters.reminderIds.length;
+ return `${count} reminder${count === 1 ? '' : 's'} by id`;
+ }
+
+ const parts = [filters.completed ? 'done' : 'not done'];
+ if (filters.overdue != null) {
+ parts.push(filters.overdue ? 'overdue' : 'upcoming');
+ }
+
+ let text = `filtered by ${parts.join(' and ')}`;
+ if (filters.entityType) {
+ text += ` for ${ENTITY_TYPE_LABELS[filters.entityType]}`;
+ }
+ return text;
+};
+
+/**
+ * What an update actually changed, so the row is readable without expanding
+ * the arguments. Reads off the request rather than the response because the
+ * response is the merged reminder and no longer says which fields moved.
+ */
+const formatReminderUpdate = (update: UpdateReminderTool) => {
+ const changes: string[] = [];
+ if (update.completed === true) changes.push('mark done');
+ if (update.completed === false) changes.push('reopen');
+ if (update.remindAt)
+ changes.push(`move to ${formatDateAndTime(update.remindAt)}`);
+ if (update.description != null) changes.push('reword');
+ return changes.length > 0 ? changes.join(', ') : 'update';
+};
+
+const ReminderList = (props: { reminders: ToolReminder[] }) => (
+ <Tool.List>
+ <div class="max-h-60 overflow-y-auto overscroll-contain">
+ <For each={props.reminders}>
+ {(reminder) => (
+ <Tool.ListItem icon={<BellSimple class="size-4" />}>
+ <div class="flex min-w-0 items-center justify-between gap-3">
+ <span class="min-w-0 truncate text-ink">
+ {reminder.description}
+ </span>
+ <span
+ class="shrink-0 whitespace-nowrap text-xs"
+ classList={{
+ 'text-ink-extra-muted': !reminder.overdue,
+ 'text-ink-muted': reminder.overdue,
+ }}
+ >
+ {reminder.overdue ? 'Overdue · ' : ''}
+ {formatDateAndTime(reminder.nextRunAt)}
+ </span>
+ </div>
+ </Tool.ListItem>
+ )}
+ </For>
+ </div>
+ </Tool.List>
+);
+
+const listRemindersHandler = createToolRenderer({
+ name: 'ListReminders',
+ render: (ctx) => {
+ const [isExpanded, setIsExpanded] = createSignal(false);
+ const reminders = () => ctx.response?.data.reminders ?? [];
+ const hasResults = () => reminders().length > 0;
+ const statusText = () => {
+ if (!ctx.response) return undefined;
+ const count = reminders().length;
+ if (count === 0) return 'No Results';
+ return `${count} reminder${count === 1 ? '' : 's'}`;
+ };
+
+ return (
+ <BaseTool
+ align="start"
+ icon={BellSimple}
+ renderContext={ctx.renderContext}
+ type="call"
+ response={
+ hasResults() && isExpanded() ? (
+ <ReminderList reminders={reminders()} />
+ ) : undefined
+ }
+ >
+ <div class="flex min-w-0 flex-1 flex-col gap-1">
+ <div class="flex min-w-0 items-center justify-between gap-3 overflow-hidden">
+ <span class="min-w-0 truncate">Read reminders</span>
+ <Tool.ResultToggle
+ expanded={isExpanded()}
+ onToggle={() => setIsExpanded((expanded) => !expanded)}
+ showToggle={hasResults()}
+ status={statusText()}
+ />
+ </div>
+ <div class="min-w-0 truncate text-xs text-ink-placeholder">
+ {formatReminderFilters(ctx.tool.data)}
+ </div>
+ </div>
+ </BaseTool>
+ );
+ },
+});
+
+const createReminderHandler = createToolRenderer({
+ name: 'CreateReminder',
+ render: (ctx) => (
+ <BaseTool
+ align="start"
+ icon={BellSimple}
+ renderContext={ctx.renderContext}
+ type="call"
+ >
+ <div class="flex min-w-0 flex-1 flex-col gap-1">
+ <div class="flex min-w-0 items-center gap-1.5 overflow-hidden">
+ <span class="shrink-0">
+ {ctx.response ? 'Created reminder' : 'Create reminder'}
+ </span>
+ <span class="min-w-0 truncate text-ink">
+ {ctx.response?.data.description ?? ctx.tool.data.description}
+ </span>
+ </div>
+ <div class="min-w-0 truncate text-xs text-ink-placeholder">
+ {formatDateAndTime(
+ ctx.response?.data.nextRunAt ?? ctx.tool.data.remindAt
+ )}
+ <Show when={ctx.tool.data.entityType}>
+ {(entityType) => <> · about {ENTITY_TYPE_LABELS[entityType()]}</>}
+ </Show>
+ </div>
+ </div>
+ </BaseTool>
+ ),
+});
+
+const updateReminderHandler = createToolRenderer({
+ name: 'UpdateReminder',
+ render: (ctx) => (
+ <BaseTool
+ align="start"
+ icon={ctx.tool.data.completed === true ? Check : BellSimple}
+ renderContext={ctx.renderContext}
+ type="call"
+ >
+ <div class="flex min-w-0 flex-1 flex-col gap-1">
+ <div class="flex min-w-0 items-center gap-1.5 overflow-hidden">
+ <span class="shrink-0">
+ {ctx.response ? 'Updated reminder' : 'Update reminder'}
+ </span>
+ <Show when={ctx.response?.data.description}>
+ {(description) => (
+ <span class="min-w-0 truncate text-ink">{description()}</span>
+ )}
+ </Show>
+ </div>
+ <div class="min-w-0 truncate text-xs text-ink-placeholder">
+ {formatReminderUpdate(ctx.tool.data)}
+ <Show when={ctx.response?.data.nextRunAt}>
+ {(nextRunAt) => <> · fires {formatDateAndTime(nextRunAt())}</>}
+ </Show>
+ </div>
+ </div>
+ </BaseTool>
+ ),
+});
+
+const deleteReminderHandler = createToolRenderer({
+ name: 'DeleteReminder',
+ render: (ctx) => (
+ <BaseTool icon={Trash} renderContext={ctx.renderContext} type="call">
+ {ctx.response ? 'Deleted reminder' : 'Delete reminder'}
+ </BaseTool>
+ ),
+});
+
+export {
+ createReminderHandler,
+ deleteReminderHandler,
+ listRemindersHandler,
+ updateReminderHandler,
+};
diff --git a/apps/web/src/lib/core/component/AI/component/tool/handler.tsx b/apps/web/src/lib/core/component/AI/component/tool/handler.tsx
index c903cfd096..efd8f0ecf2 100644
--- a/apps/web/src/lib/core/component/AI/component/tool/handler.tsx
+++ b/apps/web/src/lib/core/component/AI/component/tool/handler.tsx
@@ -55,6 +55,12 @@ import { readContentHandler } from './ReadContent';
import { readMetadataHandler } from './ReadMetadata';
import { readProjectHandler } from './ReadProject';
import { readThreadHandler } from './ReadThread';
+import {
+ createReminderHandler,
+ deleteReminderHandler,
+ listRemindersHandler,
+ updateReminderHandler,
+} from './Reminders';
import { renameDocumentHandler } from './RenameDocument';
import { contentSearchHandler, nameSearchHandler } from './Search';
import { listSkillsHandler, searchSkillsHandler } from './SearchSkills';
@@ -93,6 +99,7 @@ const toolHandlers: ToolHandlerMap<RenderContext> = {
ListLabels: listLabelsHandler,
ListSkills: listSkillsHandler,
ListNotifications: listNotificationsHandler,
+ ListReminders: listRemindersHandler,
ListTags: listTagsHandler,
ListTeamMembers: listTeamMembersHandler,
LoadTools: loadToolsHandler,
@@ -104,7 +111,9 @@ const toolHandlers: ToolHandlerMap<RenderContext> = {
ContentSearch: contentSearchHandler,
CreateDocument: createDocumentHandler,
CreateProject: createProjectHandler,
+ CreateReminder: createReminderHandler,
CreateTag: createTagHandler,
+ DeleteReminder: deleteReminderHandler,
DeleteTag: deleteTagHandler,
EditDocument: editDocumentHandler,
EditTag: editTagHandler,
@@ -129,6 +138,7 @@ const toolHandlers: ToolHandlerMap<RenderContext> = {
BulkSetEntityPropertyOptions: bulkSetEntityPropertyOptionsHandler,
Subagent: subagentHandler,
TextEditorCodeExecution: textEditorCodeExecutionHandler,
+ UpdateReminder: updateReminderHandler,
UpdateThreadLabels: updateThreadLabelsHandler,
WebFetch: webFetchHandler,
WebSearch: webSearchHandler,
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts
index 680fc70ee8..f9547d7405 100644
--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts
+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts
@@ -841,6 +841,85 @@ export const CreateProjectResponse = z.object({
projectName: z.string(),
});
+export const CreateReminder = z.object({
+ description: z.string(),
+ entityId: z.union([z.string().uuid(), z.null()]).optional(),
+ entityType: z
+ .union([
+ z.any().superRefine((x, ctx) => {
+ const schemas = [
+ z.literal('document'),
+ z.literal('ai_chat'),
+ z.literal('project'),
+ z.literal('email'),
+ z.literal('channel'),
+ z.literal('call'),
+ z.literal('calendar_event'),
+ ];
+ const errors = schemas.reduce<z.ZodError[]>(
+ (errors, schema) =>
+ ((result) => (result.error ? [...errors, result.error] : errors))(
+ schema.safeParse(x)
+ ),
+ []
+ );
+ if (schemas.length - errors.length !== 1) {
+ ctx.addIssue({
+ path: ctx.path,
+ code: 'invalid_union',
+ unionErrors: errors,
+ message: 'Invalid input: Should pass single schema',
+ });
+ }
+ }),
+ z.null(),
+ ])
+ .optional(),
+ remindAt: z.string().datetime({ offset: true }),
+});
+
+export const ToolReminder = z.object({
+ completed: z.boolean(),
+ description: z.string(),
+ enabled: z.boolean(),
+ entityId: z.union([z.string(), z.null()]).optional(),
+ entityType: z
+ .union([
+ z.any().superRefine((x, ctx) => {
+ const schemas = [
+ z.literal('document'),
+ z.literal('ai_chat'),
+ z.literal('project'),
+ z.literal('email'),
+ z.literal('channel'),
+ z.literal('call'),
+ z.literal('calendar_event'),
+ ];
+ const errors = schemas.reduce<z.ZodError[]>(
+ (errors, schema) =>
+ ((result) => (result.error ? [...errors, result.error] : errors))(
+ schema.safeParse(x)
+ ),
+ []
+ );
+ if (schemas.length - errors.length !== 1) {
+ ctx.addIssue({
+ path: ctx.path,
+ code: 'invalid_union',
+ unionErrors: errors,
+ message: 'Invalid input: Should pass single schema',
+ });
+ }
+ }),
+ z.null(),
+ ])
+ .optional(),
+ id: z.string().uuid(),
+ nextRunAt: z.string().datetime({ offset: true }),
+ overdue: z.boolean(),
+ recurrence: z.union([z.string(), z.null()]).optional(),
+});
+
export const CreateTag = z.object({
color: z.any().superRefine((x, ctx) => {
const schemas = [
@@ -967,6 +1046,13 @@ export const DeleteImportEntityResponse = z.object({
message: z.string(),
});
+export const DeleteReminder = z.object({ reminderId: z.string().uuid() });
+
+export const DeleteReminderResponse = z.object({
+ reminderId: z.string().uuid(),
+ summary: z.string(),
+});
+
export const DeleteTag = z.object({
id: z.string().uuid(),
property_definition_id: z.string().uuid(),
@@ -1916,6 +2002,93 @@ export const ListNotificationsResponse = z.object({
),
});
+export const ListReminders = z.object({
+ completed: z.union([z.boolean(), z.null()]).optional(),
+ entityId: z.union([z.string().uuid(), z.null()]).optional(),
+ entityType: z
+ .union([
+ z.any().superRefine((x, ctx) => {
+ const schemas = [
+ z.literal('document'),
+ z.literal('ai_chat'),
+ z.literal('project'),
+ z.literal('email'),
+ z.literal('channel'),
+ z.literal('call'),
+ z.literal('calendar_event'),
+ ];
+ const errors = schemas.reduce<z.ZodError[]>(
+ (errors, schema) =>
+ ((result) => (result.error ? [...errors, result.error] : errors))(
+ schema.safeParse(x)
+ ),
+ []
+ );
+ if (schemas.length - errors.length !== 1) {
+ ctx.addIssue({
+ path: ctx.path,
+ code: 'invalid_union',
+ unionErrors: errors,
+ message: 'Invalid input: Should pass single schema',
+ });
+ }
+ }),
+ z.null(),
+ ])
+ .optional(),
+ limit: z.union([z.number().int().gte(0), z.null()]).optional(),
+ overdue: z.union([z.boolean(), z.null()]).optional(),
+ reminderIds: z.union([z.array(z.string().uuid()), z.null()]).optional(),
+});
+
+export const ListRemindersResponse = z.object({
+ reminders: z.array(
+ z.object({
+ completed: z.boolean(),
+ description: z.string(),
+ enabled: z.boolean(),
+ entityId: z.union([z.string(), z.null()]).optional(),
+ entityType: z
+ .union([
+ z.any().superRefine((x, ctx) => {
+ const schemas = [
+ z.literal('document'),
+ z.literal('ai_chat'),
+ z.literal('project'),
+ z.literal('email'),
+ z.literal('channel'),
+ z.literal('call'),
+ z.literal('calendar_event'),
+ ];
+ const errors = schemas.reduce<z.ZodError[]>(
+ (errors, schema) =>
+ ((result) =>
+ result.error ? [...errors, result.error] : errors)(
+ schema.safeParse(x)
+ ),
+ []
+ );
+ if (schemas.length - errors.length !== 1) {
+ ctx.addIssue({
+ path: ctx.path,
+ code: 'invalid_union',
+ unionErrors: errors,
+ message: 'Invalid input: Should pass single schema',
+ });
+ }
+ }),
+ z.null(),
+ ])
+ .optional(),
+ id: z.string().uuid(),
+ nextRunAt: z.string().datetime({ offset: true }),
+ overdue: z.boolean(),
+ recurrence: z.union([z.string(), z.null()]).optional(),
+ })
+ ),
+ summary: z.string(),
+});
+
export const ListSkills = z.record(z.any());
export const ListSkillsResponse = z.object({
@@ -3641,6 +3814,15 @@ export const UpdateCalendarEvent = z.object({
title: z.union([z.string(), z.null()]).optional(),
});
+export const UpdateReminder = z.object({
+ completed: z.union([z.boolean(), z.null()]).optional(),
+ description: z.union([z.string(), z.null()]).optional(),
+ remindAt: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
+ reminderId: z.string().uuid(),
+});
+
export const UpdateThreadLabels = z.object({
add: z.boolean(),
label_id: z.string().uuid(),
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts
index afeeafe233..47df625683 100644
--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts
+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/tool.ts
@@ -36,6 +36,7 @@ type ToolParserMap = {
call: types.CreateProject;
response: types.CreateProjectResponse;
};
+ CreateReminder: { call: types.CreateReminder; response: types.ToolReminder };
CreateTag: { call: types.CreateTag; response: types.CreateTagResponse };
DeleteCalendarEvent: {
call: types.DeleteCalendarEvent;
@@ -45,6 +46,10 @@ type ToolParserMap = {
call: types.DeleteImportEntity;
response: types.DeleteImportEntityResponse;
};
+ DeleteReminder: {
+ call: types.DeleteReminder;
+ response: types.DeleteReminderResponse;
+ };
DeleteTag: { call: types.DeleteTag; response: types.DeleteTagResponse };
DisplayResults: {
call: types.DisplayResults;
@@ -91,6 +96,10 @@ type ToolParserMap = {
call: types.ListNotifications;
response: types.ListNotificationsResponse;
};
+ ListReminders: {
+ call: types.ListReminders;
+ response: types.ListRemindersResponse;
+ };
ListSkills: { call: types.ListSkills; response: types.ListSkillsResponse };
ListTags: { call: types.ListTags; response: types.ListTagsResponse };
ListTeamMembers: {
@@ -166,6 +175,7 @@ type ToolParserMap = {
call: types.UpdateCalendarEvent;
response: types.ToolCalendarEvent;
};
+ UpdateReminder: { call: types.UpdateReminder; response: types.ToolReminder };
UpdateThreadLabels: {
call: types.UpdateThreadLabels;
response: types.UpdateThreadLabelsResponse;
@@ -203,6 +213,10 @@ const toolParserMap = {
call: schemas.CreateProject,
response: schemas.CreateProjectResponse,
},
+ CreateReminder: {
+ call: schemas.CreateReminder,
+ response: schemas.ToolReminder,
+ },
CreateTag: { call: schemas.CreateTag, response: schemas.CreateTagResponse },
DeleteCalendarEvent: {
call: schemas.DeleteCalendarEvent,
@@ -212,6 +226,10 @@ const toolParserMap = {
call: schemas.DeleteImportEntity,
response: schemas.DeleteImportEntityResponse,
},
+ DeleteReminder: {
+ call: schemas.DeleteReminder,
+ response: schemas.DeleteReminderResponse,
+ },
DeleteTag: { call: schemas.DeleteTag, response: schemas.DeleteTagResponse },
DisplayResults: {
call: schemas.DisplayResults,
@@ -267,6 +285,10 @@ const toolParserMap = {
call: schemas.ListNotifications,
response: schemas.ListNotificationsResponse,
},
+ ListReminders: {
+ call: schemas.ListReminders,
+ response: schemas.ListRemindersResponse,
+ },
ListSkills: {
call: schemas.ListSkills,
response: schemas.ListSkillsResponse,
@@ -357,6 +379,10 @@ const toolParserMap = {
call: schemas.UpdateCalendarEvent,
response: schemas.ToolCalendarEvent,
},
+ UpdateReminder: {
+ call: schemas.UpdateReminder,
+ response: schemas.ToolReminder,
+ },
UpdateThreadLabels: {
call: schemas.UpdateThreadLabels,
response: schemas.UpdateThreadLabelsResponse,
@@ -402,6 +428,7 @@ type ToolDataMap = {
call: types.CreateProject;
response: types.CreateProjectResponse;
};
+ CreateReminder: { call: types.CreateReminder; response: types.ToolReminder };
CreateTag: { call: types.CreateTag; response: types.CreateTagResponse };
DeleteCalendarEvent: {
call: types.DeleteCalendarEvent;
@@ -411,6 +438,10 @@ type ToolDataMap = {
call: types.DeleteImportEntity;
response: types.DeleteImportEntityResponse;
};
+ DeleteReminder: {
+ call: types.DeleteReminder;
+ response: types.DeleteReminderResponse;
+ };
DeleteTag: { call: types.DeleteTag; response: types.DeleteTagResponse };
DisplayResults: {
call: types.DisplayResults;
@@ -457,6 +488,10 @@ type ToolDataMap = {
call: types.ListNotifications;
response: types.ListNotificationsResponse;
};
+ ListReminders: {
+ call: types.ListReminders;
+ response: types.ListRemindersResponse;
+ };
ListSkills: { call: types.ListSkills; response: types.ListSkillsResponse };
ListTags: { call: types.ListTags; response: types.ListTagsResponse };
ListTeamMembers: {
@@ -532,6 +567,7 @@ type ToolDataMap = {
call: types.UpdateCalendarEvent;
response: types.ToolCalendarEvent;
};
+ UpdateReminder: { call: types.UpdateReminder; response: types.ToolReminder };
UpdateThreadLabels: {
call: types.UpdateThreadLabels;
response: types.UpdateThreadLabelsResponse;
diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts
index cedd945d2e..643b2881c3 100644
--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts
+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts
@@ -181,6 +181,21 @@ export type CreateImportStatus = 'staged' | 'imported';
* Lifecycle of one import entity.
*/
export type ImportStatus = 'staged' | 'importing' | 'imported' | 'discarded';
+/**
+ * Entity types a reminder can be attached to.
+ *
+ * Deliberately narrower than [`EntityType`], which covers plenty of things a
+ * reminder has no business pointing at. The names match the ones `ListEntities`
+ * uses so the model sees one vocabulary across tools.
+ */
+export type ReminderEntityType =
+ | 'document'
+ | 'ai_chat'
+ | 'project'
+ | 'email'
+ | 'channel'
+ | 'call'
+ | 'calendar_event';
/**
* A tag color from the fixed palette.
*/
@@ -1569,6 +1584,56 @@ export interface CreateProjectResponse {
*/
projectName: string;
}
+/**
+ * Schedule a reminder for the current user. At `remindAt` it is delivered to their Macro inbox as a notification and stays there until they mark it done.
+ *
+ * A reminder is either attached to one Macro item — so clicking it opens that item — or standalone. Attached is the common case ("remind me to reply to this email tomorrow"); standalone is for everything else ("remind me to book a flight").
+ *
+ * Reminders are private: one is only ever delivered to its owner, and there is no way to set one for somebody else. Only one-off reminders can be created — if the user asks for a repeating one, say so rather than creating a single reminder and implying it repeats.
+ *
+ * ## Times are UTC — convert both ways
+ *
+ * Timestamps are absolute instants, in and out, while the user asks in their own timezone. Getting this wrong silently sets the reminder to the wrong hour.
+ *
+ * - **In:** resolve their wording against their local time, then convert. For America/New_York (UTC-4 in August), "3pm tomorrow" on 2026-08-12 is `"2026-08-13T19:00:00Z"`, not `"2026-08-13T15:00:00Z"`.
+ * - **Out:** report the response's UTC value back in their timezone — `"2026-08-13T19:00:00Z"` is "3:00 PM tomorrow".
+ *
+ * Ask for their timezone rather than assuming UTC.
+ *
+ * ## Attaching to an item
+ *
+ * Pass `entityType` and `entityId` together, using ids from ListEntities, GetThread, or search. The user must already have access to what you attach. `entityType` accepts exactly these values, and a type not on the list cannot be attached even if ListEntities returns it:
+ *
+ * - `document` — a Macro document
+ * - `ai_chat` — an AI chat conversation
+ * - `project` — a project, shown as a folder in the app
+ * - `email` — an email thread
+ * - `channel` — a chat channel
+ * - `call` — a call record
+ * - `calendar_event` — a calendar event
+ *
+ * **A channel thread needs its parent channel's id.** `channel` is on the list; `channel_thread` is not. For a thread row, pass `entityType: "channel"` with the row's `channelId` — never the thread's own `id`, which will not resolve. Put what the thread is about in the description, since that is what tells two reminders on the same channel apart.
+ *
+ * For any other unattachable type, create a standalone reminder naming the thing in the description rather than guessing at a type.
+ */
+export interface CreateReminder {
+ /**
+ * What to remind the user about, written as the reminder text they will read — e.g. "Reply to Dana about the Q3 budget". Max 2000 characters.
+ */
+ description: string;
+ /**
+ * Id of the thing the reminder is about, as a UUID. Must be the id of an entity of entityType — for a channel_thread row that means its channelId, not its own id. Requires entityType.
+ */
+ entityId?: string | null;
+ /**
+ * Type of the thing the reminder is about — one of document, ai_chat, project, email, channel, call, calendar_event. Requires entityId; omit both for a standalone reminder.
+ */
+ entityType?: ReminderEntityType | null;
+ /**
+ * When to fire, as an RFC 3339 timestamp in UTC (e.g. "2026-08-08T14:00:00Z"). Must be in the future. Seconds are dropped, so a reminder fires on the minute. Convert from the user's local timezone before sending — see "Times are UTC" in the tool description.
+ */
+ remindAt: string;
+}
/**
* Create a new tag — a colored label the user can apply to documents, emails, tasks, AI chats, and projects — in the user's personal set or their team's shared set. The set is provisioned automatically the first time a tag is created. Tags are matched by label, so call ListTags first and avoid creating one whose label duplicates an existing tag in the same set. Returns the new tag's id and its set's propertyDefinitionId, which you can pass straight to SetEntityProperty (add_option_ids) to apply the tag to an item. Use this only to create a brand-new tag; to apply an existing tag to an item, use ListTags then SetEntityProperty instead.
*/
@@ -1720,6 +1785,30 @@ export interface DeleteImportEntityResponse {
*/
message: string;
}
+/**
+ * Permanently delete one of the current user's reminders, along with any notification it already produced. Get the `reminderId` from ListReminders or CreateReminder.
+ *
+ * This cannot be undone, and it is not the usual way to clear a reminder. When the user has simply dealt with one, use UpdateReminder with `completed: true` instead: that takes it off their active list but keeps it, still readable with ListReminders `completed: true` and restorable with `completed: false`. Delete is for reminders they want gone rather than finished — one set by mistake, or for something that is no longer happening. If it is not clear which they mean, mark it done.
+ */
+export interface DeleteReminder {
+ /**
+ * The id of the reminder to delete.
+ */
+ reminderId: string;
+}
+/**
+ * Response from the DeleteReminder tool.
+ */
+export interface DeleteReminderResponse {
+ /**
+ * The id of the reminder that was deleted.
+ */
+ reminderId: string;
+ /**
+ * A human-readable summary of the operation.
+ */
+ summary: string;
+}
/**
* Permanently delete a tag from the user's personal set or their team's shared set. This removes the tag from every item it is currently applied to, so it is destructive and cannot be undone — confirm with the user first. Both ids come from a ListTags result: `id` is the tag's option id, and `property_definition_id` is the propertyDefinitionId of the set that contains it. To simply remove a tag from a single item without deleting the tag itself, use SetEntityProperty with remove_option_ids instead.
*/
@@ -2735,6 +2824,109 @@ export interface NotificationItem {
*/
senderId?: string | null;
}
+/**
+ * Read the current user's reminders, soonest first. **Filtered by default: only reminders the user has not marked done**, which is what "what are my reminders" means. Pass `completed: true` for the ones they have dealt with. To re-read a reminder you already have the id for, pass it in `reminderIds`.
+ *
+ * Filters:
+ * - `overdue: true` / `false` — already fired and waiting on the user, or still upcoming
+ * - `completed: true` / `false` — dealt with, or still outstanding
+ * - `entityType` + `entityId` — reminders about one specific thing. `entityType` takes the same values CreateReminder accepts: document, ai_chat, project, email, channel, call, calendar_event
+ *
+ * The two flags are independent and compose: firing does not complete a reminder, so overdue and not completed is the needs-attention case, and a completed reminder never fires whether or not its time has passed.
+ *
+ * Each reminder comes back with its `id` (pass to UpdateReminder or DeleteReminder), `description`, `nextRunAt`, `overdue`, and what it is attached to. `nextRunAt` is UTC, so convert before quoting it: for America/New_York (UTC-4 in August), `"2026-08-13T19:00:00Z"` is "3:00 PM tomorrow".
+ *
+ * A `recurrence` field means the reminder repeats — rare, and currently broken: nothing in the app creates one and the dispatcher never fires them, so it sits at its `nextRunAt` without arriving. Say that rather than implying it is scheduled.
+ */
+export interface ListReminders {
+ /**
+ * Filter on whether the user has marked the reminder done. Defaults to false — only reminders still outstanding. Set true for ones already dealt with.
+ */
+ completed?: boolean | null;
+ /**
+ * Return only reminders attached to the thing with this id. Requires entityType.
+ */
+ entityId?: string | null;
+ /**
+ * Return only reminders attached to a thing of this type. Requires entityId.
+ */
+ entityType?: ReminderEntityType | null;
+ /**
+ * Maximum number of reminders to return. Defaults to 20, capped at 100.
+ */
+ limit?: number | null;
+ /**
+ * Filter on whether the reminder has already fired. True returns only reminders past their time, false only ones still upcoming. Omit for both.
+ */
+ overdue?: boolean | null;
+ /**
+ * Return only these reminders, by id. Use this to re-read a reminder you already know the id of. Omit to list all of them.
+ */
+ reminderIds?: string[] | null;
+}
+/**
+ * Response from the ListReminders tool.
+ */
+export interface ListRemindersResponse {
+ /**
+ * The matching reminders, soonest firing first.
+ */
+ reminders: ToolReminder[];
+ /**
+ * A human-readable summary of what came back.
+ */
+ summary: string;
+}
+/**
+ * A reminder as the model sees it.
+ */
+export interface ToolReminder {
+ /**
+ * Whether the user has marked the reminder as dealt with.
+ */
+ completed: boolean;
+ /**
+ * What the user wanted to be reminded about.
+ */
+ description: string;
+ /**
+ * Whether the reminder will fire at all. A disabled reminder keeps its
+ * schedule but is skipped by the dispatcher.
+ */
+ enabled: boolean;
+ /**
+ * The id of the thing the reminder is about.
+ */
+ entityId?: string | null;
+ /**
+ * The type of thing the reminder is about, when it is about something and
+ * that type is one these tools name. The app can attach a reminder to
+ * kinds of thing this list does not cover, so `entityId` may be present
+ * with no `entityType` beside it — the reminder is about something, but
+ * not something these tools can name or filter on.
+ */
+ entityType?: ReminderEntityType | null;
+ /**
+ * The reminder's id. Pass this to UpdateReminder or DeleteReminder.
+ */
+ id: string;
+ /**
+ * When the reminder fires next, RFC 3339 in UTC. The user thinks in their
+ * own timezone — convert before quoting this back to them.
+ */
+ nextRunAt: string;
+ /**
+ * Whether `nextRunAt` has already passed, evaluated against the server
+ * clock. An overdue reminder is one the user has been notified about and
+ * has not dealt with yet.
+ */
+ overdue: boolean;
+ /**
+ * For a repeating reminder, its cron expression and timezone. Absent on a
+ * one-shot, which is everything this toolset can create.
+ */
+ recurrence?: string | null;
+}
/**
* List the skills the user can access, most recently updated first. Skills are markdown documents containing instructions for AI to read and follow; after finding a relevant skill, read its instructions with ReadContent using the returned document id. Use this to discover what skills exist; when looking for a specific skill by name, prefer SearchSkills.
*/
@@ -4235,6 +4427,47 @@ export interface UpdateCalendarEvent {
*/
title?: string | null;
}
+/**
+ * Change one of the current user's reminders: reword it, move when it fires, or mark it done. Get the `reminderId` from ListReminders or CreateReminder.
+ *
+ * Pass only the fields you are changing; anything omitted is left alone. At least one must be given.
+ *
+ * - Snooze or reschedule: set `remindAt`
+ * - Mark done: `completed: true` — the user has dealt with it and it leaves their active list
+ * - Reopen: `completed: false`
+ * - Reword: set `description`
+ *
+ * Marking done is the normal way to clear a reminder the user has handled, and it is reversible: the reminder drops out of the default ListReminders results but is still there, readable with `completed: true` and restorable with `completed: false`. Reach for DeleteReminder only when the user wants the reminder not to exist; that cannot be undone.
+ *
+ * Two things this tool will not do. It cannot change what a reminder is attached to — create a new reminder and delete this one instead. And setting `remindAt` on a repeating reminder replaces the repetition with that single firing, so only do it if the user asked to stop it repeating.
+ *
+ * ## Times are UTC — convert both ways
+ *
+ * Timestamps are absolute instants, in and out, while the user asks in their own timezone. Getting this wrong silently sets the reminder to the wrong hour.
+ *
+ * - **In:** resolve their wording against their local time, then convert. For America/New_York (UTC-4 in August), "3pm tomorrow" on 2026-08-12 is `"2026-08-13T19:00:00Z"`, not `"2026-08-13T15:00:00Z"`.
+ * - **Out:** report the response's UTC value back in their timezone — `"2026-08-13T19:00:00Z"` is "3:00 PM tomorrow".
+ *
+ * Ask for their timezone rather than assuming UTC.
+ */
+export interface UpdateReminder {
+ /**
+ * Mark the reminder as dealt with (true) or put it back on the active list (false).
+ */
+ completed?: boolean | null;
+ /**
+ * Replacement reminder text. Max 2000 characters.
+ */
+ description?: string | null;
+ /**
+ * Reschedule to this RFC 3339 timestamp in UTC (e.g. "2026-08-08T14:00:00Z"). Must be in the future — to move a reminder that has already fired, give it a new future time. Convert from the user's local timezone before sending; see "Times are UTC" in the tool description.
+ */
+ remindAt?: string | null;
+ /**
+ * The id of the reminder to change.
+ */
+ reminderId: string;
+}
/**
* Add or remove a single label from every message in a Gmail thread. In Gmail, nearly all inbox operations are just label add/remove operations, so this tool is the primitive for archiving, marking read/unread, starring, trashing, marking important/spam, and applying or removing custom labels.
*
diff --git a/crates/ai_tools/Cargo.toml b/crates/ai_tools/Cargo.toml
index 6760b26d5c..cc5998909d 100644
--- a/crates/ai_tools/Cargo.toml
+++ b/crates/ai_tools/Cargo.toml
@@ -69,7 +69,7 @@ models_soup = { path = "../models_soup" }
rand.workspace = true
reqwest.workspace = true
readonly_pool = { path = "../readonly_pool" }
-reminders = { path = "../reminders", default-features = false, features = ["ports"] }
+reminders = { path = "../reminders", default-features = false, features = ["ai_tools", "postgres"] }
rootcause = { workspace = true }
schemars.workspace = true
search_service_client = { path = "../search_service_client" }
diff --git a/crates/ai_tools/src/build_context.rs b/crates/ai_tools/src/build_context.rs
index a0080ea084..a0d180496e 100644
--- a/crates/ai_tools/src/build_context.rs
+++ b/crates/ai_tools/src/build_context.rs
@@ -405,6 +405,10 @@ pub async fn build_tool_service_context_from_env(
call_tool_context,
calendar_tool_context,
notification_tool_context,
+ reminders_tool_context: crate::tool_context::build_reminders_tool_context(
+ pool.clone(),
+ entity_access_service.clone(),
+ ),
import_tool_context: ToolImportToolContext::unwired(),
chat_tool_context,
channel_tool_context,
diff --git a/crates/ai_tools/src/lib.rs b/crates/ai_tools/src/lib.rs
index 3f97af2a4b..97558927bb 100644
--- a/crates/ai_tools/src/lib.rs
+++ b/crates/ai_tools/src/lib.rs
@@ -30,6 +30,7 @@ use import::inbound::toolset::import_toolset;
use notification::inbound::ai_tool::notification_toolset;
use projects::inbound::toolset::project_toolset;
use properties::inbound::toolset::properties_toolset;
+use reminders::inbound::toolset::reminders_toolset;
use schemas::read;
use search_tools::{LoadTools, SearchTools};
use self_knowledge::SelfKnowledge;
@@ -57,12 +58,13 @@ pub use tool_context::{
ToolForeignEntityService, ToolFrecencyService, ToolImportService, ToolImportToolContext,
ToolMcpSelector, ToolNotificationQueue, ToolNotificationService, ToolNotificationToolContext,
ToolPipedreamConnection, ToolProjectService, ToolProjectToolContext, ToolPropertiesService,
- ToolPropertiesToolContext, ToolServiceContext, ToolSkillService, ToolSkillToolContext,
- ToolSoupService, ToolSystemPropertiesService, ToolTeamService, ToolTeamToolContext,
- ToolUserEmailService, build_calendar_tool_context, build_channel_tool_context_with_dispatcher,
- build_channel_tool_context_with_side_effects, build_channel_tool_context_without_side_effects,
- build_crm_tool_context, build_project_tool_context, build_properties_service,
- build_properties_tool_context, build_skill_tool_context, build_task_properties_adapter,
+ ToolPropertiesToolContext, ToolRemindersService, ToolRemindersToolContext, ToolServiceContext,
+ ToolSkillService, ToolSkillToolContext, ToolSoupService, ToolSystemPropertiesService,
+ ToolTeamService, ToolTeamToolContext, ToolUserEmailService, build_calendar_tool_context,
+ build_channel_tool_context_with_dispatcher, build_channel_tool_context_with_side_effects,
+ build_channel_tool_context_without_side_effects, build_crm_tool_context,
+ build_project_tool_context, build_properties_service, build_properties_tool_context,
+ build_reminders_tool_context, build_skill_tool_context, build_task_properties_adapter,
build_team_repository, build_team_tool_context,
};
pub type AiToolSet = AsyncToolCollection<ToolServiceContext>;
@@ -104,6 +106,7 @@ pub(crate) fn subagent_toolset() -> AiToolSet {
pub fn all_tools() -> ToolSetWithPrompt {
let toolset = subagent_toolset()
.add_subtoolset::<ToolNotificationToolContext>(notification_toolset())
+ .add_subtoolset::<ToolRemindersToolContext>(reminders_toolset())
.add_subtoolset::<ToolEmailToolContext>(email_toolset())
.add_subtoolset::<ToolCalendarToolContext>(calendar_toolset())
.add_subtoolset::<ToolImportToolContext>(import_toolset())
@@ -133,6 +136,7 @@ pub fn all_tool_frontend_schemas() -> FrontendSchemas {
pub fn mcp_tools() -> ToolSetWithPrompt {
let toolset = subagent_toolset()
.add_subtoolset::<ToolNotificationToolContext>(notification_toolset())
+ .add_subtoolset::<ToolRemindersToolContext>(reminders_toolset())
.add_subtoolset::<ToolEmailToolContext>(email_mcp_toolset())
.add_subtoolset::<ToolCalendarToolContext>(calendar_toolset())
.add_subtoolset::<ToolImportToolContext>(import_toolset())
diff --git a/crates/ai_tools/src/tool_context.rs b/crates/ai_tools/src/tool_context.rs
index 1569e8e21d..9f39e9ad06 100644
--- a/crates/ai_tools/src/tool_context.rs
+++ b/crates/ai_tools/src/tool_context.rs
@@ -41,6 +41,7 @@ use notification::domain::service::SqsNotificationIngress;
use notification::inbound::ai_tool::NotificationToolContext;
use projects::inbound::toolset::ProjectToolContext;
use properties::inbound::toolset::PropertiesToolContext;
+use reminders::inbound::toolset::RemindersToolContext;
use skills::inbound::toolset::SkillToolContext;
use soup::{domain::service::SoupImpl, inbound::toolset::SoupToolContext};
use std::sync::Arc;
@@ -772,6 +773,31 @@ pub type ToolNotificationService = notification::domain::service::NotificationRe
/// Type alias for the notification tool context.
pub type ToolNotificationToolContext = NotificationToolContext<ToolNotificationService>;
+/// Type alias for the reminders service implementation used by AI tools.
+pub type ToolRemindersService = reminders::domain::service::RemindersServiceImpl<
+ reminders::outbound::pg_reminders_repo::PgRemindersRepo,
+>;
+
+/// Type alias for the reminders tool context.
+pub type ToolRemindersToolContext =
+ RemindersToolContext<ToolRemindersService, ToolEntityAccessService>;
+
+/// Build the reminders tool context from a database pool.
+///
+/// The reminder tools go through the same access receipts the HTTP API does,
+/// so this needs the entity access service as well as the repository.
+pub fn build_reminders_tool_context(
+ pool: sqlx::PgPool,
+ entity_access_service: Arc<ToolEntityAccessService>,
+) -> ToolRemindersToolContext {
+ RemindersToolContext::new(
+ reminders::domain::service::RemindersServiceImpl::new(
+ reminders::outbound::pg_reminders_repo::PgRemindersRepo::new(pool),
+ ),
+ entity_access_service,
+ )
+}
+
/// Type alias for the chat service implementation used by AI tools.
/// Uses an empty toolset — the read-only tool never invokes tool execution.
pub type ToolChatService = ChatServiceImpl<PgChatRepo, (), ToolEntityAccessManagementService>;
@@ -1175,6 +1201,7 @@ pub struct ToolServiceContext {
pub call_tool_context: ToolCallToolContext,
pub calendar_tool_context: ToolCalendarToolContext,
pub notification_tool_context: ToolNotificationToolContext,
+ pub reminders_tool_context: ToolRemindersToolContext,
/// Import staging/tracking tools. `unwired` in hosts that can't build
/// the import service — calls there fail with a clear error.
pub import_tool_context: ToolImportToolContext,
diff --git a/crates/entity_access/src/domain/service.rs b/crates/entity_access/src/domain/service.rs
index 0553905e40..0112b1e8a8 100644
--- a/crates/entity_access/src/domain/service.rs
+++ b/crates/entity_access/src/domain/service.rs
@@ -528,6 +528,18 @@ where
.await?;
channel_role_result_to_permission(result)
}
+ // Ownership is the whole access model, so the only level this can
+ // yield is `Owner` — a caller who is not the owner gets no row.
+ // `ReminderAccessExtractor` builds the same receipt straight from
+ // `get_access_level`; this arm is what lets a non-axum caller (an
+ // AI tool) mint one without reimplementing that.
+ EntityType::Reminder => {
+ let access = self.repo.get_reminder_access(entity_id, user_id).await?;
+ match access {
+ Some(access_level) => Ok(EntityPermission::AccessLevel { access_level }),
+ None => Err(AccessError::Unauthorized),
+ }
+ }
_ => Err(AccessError::BadRequest("Unsupported entity type")),
}
}
diff --git a/crates/entity_access/src/domain/service/test.rs b/crates/entity_access/src/domain/service/test.rs
index df6d44b2d9..34bdfbdb2b 100644
--- a/crates/entity_access/src/domain/service/test.rs
+++ b/crates/entity_access/src/domain/service/test.rs
@@ -116,6 +116,11 @@ impl MockRepo {
self
}
+ fn with_reminder_access(mut self, level: AccessLevel) -> Self {
+ self.reminder_access = Arc::new(Mutex::new(Some(level)));
+ self
+ }
+
fn with_team_entity_access(mut self, level: AccessLevel) -> Self {
self.team_entity_access = Arc::new(Mutex::new(Some(level)));
self
@@ -705,6 +710,84 @@ async fn test_get_entity_permission_foreign_entity_returns_view_access_level() {
));
}
+/// Reminders reach `get_entity_permission` from AI tools, which mint their own
+/// receipts rather than going through `ReminderAccessExtractor`.
+#[tokio::test]
+async fn test_get_entity_permission_reminder_returns_owner() {
+ let repo = MockRepo::new().with_reminder_access(AccessLevel::Owner);
+ let service = EntityAccessServiceImpl::new(repo);
+ let user_id = test_user_id();
+
+ let result = service
+ .get_entity_permission(
+ Some(&user_id),
+ "11111111-1111-1111-1111-111111111111",
+ EntityType::Reminder,
+ None,
+ )
+ .await
+ .unwrap();
+
+ assert!(matches!(
+ result,
+ EntityPermission::AccessLevel {
+ access_level: AccessLevel::Owner
+ }
+ ));
+}
+
+/// Somebody else's reminder and a reminder that does not exist are the same
+/// answer, which is what keeps an id from leaking.
+#[tokio::test]
+async fn test_get_entity_permission_reminder_not_owned_is_unauthorized() {
+ let repo = MockRepo::new();
+ let service = EntityAccessServiceImpl::new(repo);
+ let user_id = test_user_id();
+
+ let result = service
+ .get_entity_permission(
+ Some(&user_id),
+ "11111111-1111-1111-1111-111111111111",
+ EntityType::Reminder,
+ None,
+ )
+ .await;
+
+ assert!(matches!(result, Err(AccessError::Unauthorized)));
+}
+
+/// The receipt an AI tool actually asks for. `OwnerAccessLevel` is the only
+/// requirement a reminder can satisfy, so this is the whole gate.
+#[tokio::test]
+async fn test_generate_reminder_owner_receipt() {
+ let repo = MockRepo::new().with_reminder_access(AccessLevel::Owner);
+ let service = EntityAccessServiceImpl::new(repo);
+ let user_id = test_user_id();
+
+ let receipt = service
+ .generate_entity_access_receipt::<OwnerAccessLevel>(
+ &user_id,
+ None,
+ "11111111-1111-1111-1111-111111111111",
+ EntityType::Reminder,
+ )
+ .await
+ .expect("owner should get a receipt");
+
+ assert_eq!(receipt.entity().entity_type, EntityType::Reminder);
+ assert_eq!(
+ receipt.entity().entity_id,
+ "11111111-1111-1111-1111-111111111111"
+ );
+ assert_eq!(
+ receipt
+ .get_authenticated_user()
+ .expect("receipt is authenticated")
+ .as_ref(),
+ user_id.as_ref()
+ );
+}
+
#[tokio::test]
async fn test_get_entity_permission_channel_returns_role() {
let repo = MockRepo::new().with_channel_role(ChannelRoleResult::Role(ParticipantRole::Admin));
diff --git a/crates/memory/src/context.rs b/crates/memory/src/context.rs
index 536415d155..28ad51d369 100644
--- a/crates/memory/src/context.rs
+++ b/crates/memory/src/context.rs
@@ -238,6 +238,10 @@ pub async fn build_tool_service_context(
email_tool_context,
call_tool_context,
notification_tool_context,
+ reminders_tool_context: ai_tools::build_reminders_tool_context(
+ pool.clone(),
+ entity_access_service.clone(),
+ ),
import_tool_context: ToolImportToolContext::unwired(),
chat_tool_context,
channel_tool_context: ai_tools::build_channel_tool_context(
diff --git a/crates/reminders/Cargo.toml b/crates/reminders/Cargo.toml
index cf8348bc92..7eb64fd4fc 100644
--- a/crates/reminders/Cargo.toml
+++ b/crates/reminders/Cargo.toml
@@ -6,6 +6,15 @@ version = "0.1.0"
[features]
default = []
+# AI tools. Driving adapter like `inbound`, but for the agent loop rather than
+# HTTP, so it needs neither axum nor utoipa.
+ai_tools = [
+ "dep:ai_toolset",
+ "dep:anyhow",
+ "dep:async-trait",
+ "dep:schemars",
+ "ports",
+]
# The queue worker. Transport-agnostic: it drives the domain through the
# dispatch ports, so it needs an async runtime but no AWS SDK.
dispatch = ["dep:serde_json", "dep:tokio", "dep:tokio-util", "ports"]
@@ -25,6 +34,9 @@ ports = ["dep:entity_access", "dep:tracing"]
postgres = ["dep:macro_uuid", "dep:sqlx", "outbound"]
[dependencies]
+ai_toolset = { path = "../ai_toolset", optional = true }
+anyhow = { workspace = true, optional = true }
+async-trait = { workspace = true, optional = true }
aws-sdk-sqs = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
chrono = { workspace = true, features = ["serde"] }
@@ -36,6 +48,7 @@ macro_user_id = { path = "../macro_user_id" }
macro_uuid = { path = "../macro_uuid", optional = true }
model-entity = { path = "../model-entity" }
rootcause = { workspace = true }
+schemars = { workspace = true, optional = true }
model-error-response = { path = "../model-error-response", optional = true }
model_notifications = { path = "../model_notifications", optional = true }
notification = { path = "../notification", optional = true }
diff --git a/crates/reminders/src/inbound.rs b/crates/reminders/src/inbound.rs
index 6c5cfe2b21..87398e1885 100644
--- a/crates/reminders/src/inbound.rs
+++ b/crates/reminders/src/inbound.rs
@@ -5,3 +5,6 @@ pub mod axum_router;
#[cfg(feature = "dispatch")]
pub mod dispatch_worker;
+
+#[cfg(feature = "ai_tools")]
+pub mod toolset;
diff --git a/crates/reminders/src/inbound/toolset/create_reminder.rs b/crates/reminders/src/inbound/toolset/create_reminder.rs
new file mode 100644
index 0000000000..8f815f6be9
--- /dev/null
+++ b/crates/reminders/src/inbound/toolset/create_reminder.rs
@@ -0,0 +1,151 @@
+//! CreateReminder tool for scheduling a nudge for the current user.
+
+use ai_toolset::{
+ AsyncTool, RequestContext, ServiceContext, ToolAnnotated, ToolAnnotations, ToolResult,
+};
+use async_trait::async_trait;
+use chrono::{DateTime, Utc};
+use entity_access::domain::ports::EntityAccessService;
+use schemars::JsonSchema;
+use serde::Deserialize;
+use uuid::Uuid;
+
+use super::{
+ ReminderEntityType, RemindersToolContext, ToolReminder, build_entity, reminder_error,
+ utc_conversion_note,
+};
+use crate::domain::models::{CreateReminder as CreateReminderRequest, ReminderSchedule};
+use crate::domain::ports::RemindersService;
+
+/// Schedule a reminder for the current user.
+#[derive(Debug, Deserialize, JsonSchema, Clone)]
+#[serde(rename_all = "camelCase")]
+#[schemars(
+ title = "CreateReminder",
+ description = concat!(
+ "\
+Schedule a reminder for the current user. At `remindAt` it is delivered to their Macro inbox \
+as a notification and stays there until they mark it done.\n\
+\n\
+A reminder is either attached to one Macro item — so clicking it opens that item — or \
+standalone. Attached is the common case (\"remind me to reply to this email tomorrow\"); \
+standalone is for everything else (\"remind me to book a flight\").\n\
+\n\
+Reminders are private: one is only ever delivered to its owner, and there is no way to set \
+one for somebody else. Only one-off reminders can be created — if the user asks for a \
+repeating one, say so rather than creating a single reminder and implying it repeats.\n\
+\n",
+ utc_conversion_note!(),
+ "\n\
+\n\
+## Attaching to an item\n\
+\n\
+Pass `entityType` and `entityId` together, using ids from ListEntities, GetThread, or search. \
+The user must already have access to what you attach. `entityType` accepts exactly these \
+values, and a type not on the list cannot be attached even if ListEntities returns it:\n\
+\n\
+- `document` — a Macro document\n\
+- `ai_chat` — an AI chat conversation\n\
+- `project` — a project, shown as a folder in the app\n\
+- `email` — an email thread\n\
+- `channel` — a chat channel\n\
+- `call` — a call record\n\
+- `calendar_event` — a calendar event\n\
+\n\
+**A channel thread needs its parent channel's id.** `channel` is on the list; \
+`channel_thread` is not. For a thread row, pass `entityType: \"channel\"` with the row's \
+`channelId` — never the thread's own `id`, which will not resolve. Put what the thread is \
+about in the description, since that is what tells two reminders on the same channel apart.\n\
+\n\
+For any other unattachable type, create a standalone reminder naming the thing in the \
+description rather than guessing at a type."
+ )
+)]
+pub struct CreateReminder {
+ /// What to remind the user about.
+ #[schemars(
+ description = "What to remind the user about, written as the reminder text they will \
+ read — e.g. \"Reply to Dana about the Q3 budget\". Max 2000 characters."
+ )]
+ pub description: String,
+
+ /// When the reminder fires.
+ #[schemars(description = "When to fire, as an RFC 3339 timestamp in UTC (e.g. \
+ \"2026-08-08T14:00:00Z\"). Must be in the future. Seconds are dropped, \
+ so a reminder fires on the minute. Convert from the user's local \
+ timezone before sending — see \"Times are UTC\" in the tool \
+ description.")]
+ pub remind_at: DateTime<Utc>,
+
+ /// Type of the entity to attach the reminder to. Requires `entityId`.
+ #[schemars(
+ description = "Type of the thing the reminder is about — one of document, ai_chat, \
+ project, email, channel, call, calendar_event. Requires entityId; omit \
+ both for a standalone reminder."
+ )]
+ #[serde(default)]
+ pub entity_type: Option<ReminderEntityType>,
+
+ /// Id of the entity to attach the reminder to. Requires `entityType`.
+ #[schemars(
+ description = "Id of the thing the reminder is about, as a UUID. Must be the id of an \
+ entity of entityType — for a channel_thread row that means its \
+ channelId, not its own id. Requires entityType."
+ )]
+ #[serde(default)]
+ pub entity_id: Option<Uuid>,
+}
+
+impl ToolAnnotated for CreateReminder {
+ const ANNOTATIONS: ToolAnnotations = ToolAnnotations::additive("Create reminder");
+}
+
+#[async_trait]
+impl<S, E> AsyncTool<RemindersToolContext<S, E>> for CreateReminder
+where
+ S: RemindersService,
+ E: EntityAccessService,
+{
+ type Output = ToolReminder;
+
+ #[tracing::instrument(skip_all, fields(
+ user_id = ?request_context.user_id,
+ remind_at = %self.remind_at,
+ entity_type = ?self.entity_type,
+ ), err)]
+ async fn call(
+ &self,
+ service_context: ServiceContext<RemindersToolContext<S, E>>,
+ request_context: RequestContext,
+ ) -> ToolResult<Self::Output> {
+ tracing::info!("Create reminder");
+
+ let user_id = &request_context.user_id;
+ let entity = build_entity(self.entity_type, self.entity_id)?;
+
+ // A standalone reminder points at nothing, so there is no access to
+ // prove. When there is an entity, the receipt is the only way its id
+ // reaches the service — the request itself cannot name one.
+ let entity_receipt = match &entity {
+ Some(entity) => Some(service_context.entity_receipt(user_id, entity).await?),
+ None => None,
+ };
+
+ let reminder = service_context
+ .service
+ .create_reminder(
+ user_id,
+ CreateReminderRequest {
+ description: self.description.clone(),
+ schedule: ReminderSchedule::Once {
+ remind_at: self.remind_at,
+ },
+ },
+ entity_receipt,
+ )
+ .await
+ .map_err(reminder_error)?;
+
+ Ok(ToolReminder::new(reminder, Utc::now()))
+ }
+}
diff --git a/crates/reminders/src/inbound/toolset/delete_reminder.rs b/crates/reminders/src/inbound/toolset/delete_reminder.rs
new file mode 100644
index 0000000000..d79c90c963
--- /dev/null
+++ b/crates/reminders/src/inbound/toolset/delete_reminder.rs
@@ -0,0 +1,85 @@
+//! DeleteReminder tool for removing one of the current user's reminders.
+
+use ai_toolset::{
+ AsyncTool, RequestContext, ServiceContext, ToolAnnotated, ToolAnnotations, ToolResult,
+};
+use async_trait::async_trait;
+use entity_access::domain::ports::EntityAccessService;
+use schemars::JsonSchema;
+use serde::{Deserialize, Serialize};
+use uuid::Uuid;
+
+use super::{RemindersToolContext, reminder_error};
+use crate::domain::ports::RemindersService;
+
+/// Delete one of the current user's reminders.
+#[derive(Debug, Deserialize, JsonSchema, Clone)]
+#[serde(rename_all = "camelCase")]
+#[schemars(
+ title = "DeleteReminder",
+ description = "\
+Permanently delete one of the current user's reminders, along with any notification it \
+already produced. Get the `reminderId` from ListReminders or CreateReminder.\n\
+\n\
+This cannot be undone, and it is not the usual way to clear a reminder. When the user has \
+simply dealt with one, use UpdateReminder with `completed: true` instead: that takes it off \
+their active list but keeps it, still readable with ListReminders `completed: true` and \
+restorable with `completed: false`. Delete is for reminders they want gone rather than \
+finished — one set by mistake, or for something that is no longer happening. If it is not \
+clear which they mean, mark it done."
+)]
+pub struct DeleteReminder {
+ /// The reminder to delete.
+ #[schemars(description = "The id of the reminder to delete.")]
+ pub reminder_id: Uuid,
+}
+
+impl ToolAnnotated for DeleteReminder {
+ const ANNOTATIONS: ToolAnnotations = ToolAnnotations::destructive("Delete reminder");
+}
+
+/// Response from the DeleteReminder tool.
+#[derive(Debug, Serialize, JsonSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct DeleteReminderResponse {
+ /// The id of the reminder that was deleted.
+ pub reminder_id: Uuid,
+ /// A human-readable summary of the operation.
+ pub summary: String,
+}
+
+#[async_trait]
+impl<S, E> AsyncTool<RemindersToolContext<S, E>> for DeleteReminder
+where
+ S: RemindersService,
+ E: EntityAccessService,
+{
+ type Output = DeleteReminderResponse;
+
+ #[tracing::instrument(skip_all, fields(
+ user_id = ?request_context.user_id,
+ reminder_id = %self.reminder_id,
+ ), err)]
+ async fn call(
+ &self,
+ service_context: ServiceContext<RemindersToolContext<S, E>>,
+ request_context: RequestContext,
+ ) -> ToolResult<Self::Output> {
+ tracing::info!("Delete reminder");
+
+ let receipt = service_context
+ .owner_receipt(&request_context.user_id, self.reminder_id)
+ .await?;
+
+ service_context
+ .service
+ .delete_reminder(receipt)
+ .await
+ .map_err(reminder_error)?;
+
+ Ok(DeleteReminderResponse {
+ reminder_id: self.reminder_id,
+ summary: "Reminder deleted.".to_string(),
+ })
+ }
+}
diff --git a/crates/reminders/src/inbound/toolset/list_reminders.rs b/crates/reminders/src/inbound/toolset/list_reminders.rs
new file mode 100644
index 0000000000..d2dc03d26f
--- /dev/null
+++ b/crates/reminders/src/inbound/toolset/list_reminders.rs
@@ -0,0 +1,206 @@
+//! ListReminders tool for reading the current user's reminders.
+
+use ai_toolset::{
+ AsyncTool, RequestContext, ServiceContext, ToolAnnotated, ToolAnnotations, ToolResult,
+};
+use async_trait::async_trait;
+use chrono::Utc;
+use entity_access::domain::ports::EntityAccessService;
+use schemars::JsonSchema;
+use serde::{Deserialize, Serialize};
+use uuid::Uuid;
+
+use super::{ReminderEntityType, RemindersToolContext, ToolReminder, build_entity, reminder_error};
+use crate::domain::models::{SoupOrder, SoupReminderQuery, entity_token};
+use crate::domain::ports::RemindersService;
+
+/// How many reminders come back when the caller does not say.
+const DEFAULT_LIMIT: u32 = 20;
+
+/// The most any one call will return, however large a `limit` is asked for.
+const MAX_LIMIT: u32 = 100;
+
+/// Read the current user's reminders.
+#[derive(Debug, Deserialize, JsonSchema, Clone, Default)]
+#[serde(rename_all = "camelCase")]
+#[schemars(
+ title = "ListReminders",
+ description = "\
+Read the current user's reminders, soonest first. **Filtered by default: only reminders the \
+user has not marked done**, which is what \"what are my reminders\" means. Pass \
+`completed: true` for the ones they have dealt with. To re-read a reminder you already have \
+the id for, pass it in `reminderIds`.\n\
+\n\
+Filters:\n\
+- `overdue: true` / `false` — already fired and waiting on the user, or still upcoming\n\
+- `completed: true` / `false` — dealt with, or still outstanding\n\
+- `entityType` + `entityId` — reminders about one specific thing. `entityType` takes the same \
+values CreateReminder accepts: document, ai_chat, project, email, channel, call, \
+calendar_event\n\
+\n\
+The two flags are independent and compose: firing does not complete a reminder, so overdue \
+and not completed is the needs-attention case, and a completed reminder never fires whether \
+or not its time has passed.\n\
+\n\
+Each reminder comes back with its `id` (pass to UpdateReminder or DeleteReminder), \
+`description`, `nextRunAt`, `overdue`, and what it is attached to. `nextRunAt` is UTC, so \
+convert before quoting it: for America/New_York (UTC-4 in August), `\"2026-08-13T19:00:00Z\"` \
+is \"3:00 PM tomorrow\".\n\
+\n\
+A `recurrence` field means the reminder repeats — rare, and currently broken: nothing in the \
+app creates one and the dispatcher never fires them, so it sits at its `nextRunAt` without \
+arriving. Say that rather than implying it is scheduled."
+)]
+pub struct ListReminders {
+ /// Restrict to these reminder ids.
+ #[schemars(
+ description = "Return only these reminders, by id. Use this to re-read a reminder you \
+ already know the id of. Omit to list all of them."
+ )]
+ #[serde(default)]
+ pub reminder_ids: Option<Vec<Uuid>>,
+
+ /// Restrict to reminders attached to an entity of this type. Requires
+ /// `entity_id`.
+ #[schemars(
+ description = "Return only reminders attached to a thing of this type. Requires \
+ entityId."
+ )]
+ #[serde(default)]
+ pub entity_type: Option<ReminderEntityType>,
+
+ /// Restrict to reminders attached to this entity. Requires `entity_type`.
+ #[schemars(
+ description = "Return only reminders attached to the thing with this id. Requires \
+ entityType."
+ )]
+ #[serde(default)]
+ pub entity_id: Option<Uuid>,
+
+ /// Filter on whether the owner marked the reminder done. Defaults to
+ /// outstanding reminders only.
+ #[schemars(
+ description = "Filter on whether the user has marked the reminder done. Defaults to \
+ false — only reminders still outstanding. Set true for ones already \
+ dealt with."
+ )]
+ #[serde(default)]
+ pub completed: Option<bool>,
+
+ /// Filter on whether the reminder has come due. `None` returns both.
+ #[schemars(
+ description = "Filter on whether the reminder has already fired. True returns only \
+ reminders past their time, false only ones still upcoming. Omit for \
+ both."
+ )]
+ #[serde(default)]
+ pub overdue: Option<bool>,
+
+ /// Page size, clamped into range.
+ #[schemars(
+ description = "Maximum number of reminders to return. Defaults to 20, capped at 100."
+ )]
+ #[serde(default)]
+ pub limit: Option<u32>,
+}
+
+impl ToolAnnotated for ListReminders {
+ const ANNOTATIONS: ToolAnnotations = ToolAnnotations::read_only("List reminders");
+}
+
+/// Response from the ListReminders tool.
+#[derive(Debug, Serialize, JsonSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct ListRemindersResponse {
+ /// The matching reminders, soonest firing first.
+ pub reminders: Vec<ToolReminder>,
+ /// A human-readable summary of what came back.
+ pub summary: String,
+}
+
+#[async_trait]
+impl<S, E> AsyncTool<RemindersToolContext<S, E>> for ListReminders
+where
+ S: RemindersService,
+ E: EntityAccessService,
+{
+ type Output = ListRemindersResponse;
+
+ #[tracing::instrument(skip_all, fields(
+ user_id = ?request_context.user_id,
+ completed = ?self.completed,
+ overdue = ?self.overdue,
+ ), err)]
+ async fn call(
+ &self,
+ service_context: ServiceContext<RemindersToolContext<S, E>>,
+ request_context: RequestContext,
+ ) -> ToolResult<Self::Output> {
+ tracing::info!("List reminders");
+
+ // No access check on the entity filter: this only narrows the caller's
+ // own reminders, so an id they cannot see simply matches nothing.
+ let entity = build_entity(self.entity_type, self.entity_id)?;
+ let entities: Vec<String> = entity.iter().map(entity_token).collect();
+ let ids = self.reminder_ids.clone().unwrap_or_default();
+ let limit = self.limit.unwrap_or(DEFAULT_LIMIT).clamp(1, MAX_LIMIT);
+
+ let reminders = service_context
+ .service
+ .list_reminders_for_soup(
+ &request_context.user_id,
+ SoupReminderQuery {
+ ids: &ids,
+ entities: &entities,
+ // Outstanding reminders are what the question almost always
+ // means, so default to those rather than to everything.
+ completed: Some(self.completed.unwrap_or(false)),
+ fired: self.overdue,
+ // Soonest first, and with no cursor this picks the rows
+ // rather than merely arranging them: the other direction
+ // would return the furthest-future reminders and never an
+ // overdue one.
+ order: SoupOrder::SoonestFirst,
+ limit: i64::from(limit),
+ },
+ )
+ .await
+ .map_err(reminder_error)?;
+
+ let now = Utc::now();
+ let reminders: Vec<ToolReminder> = reminders
+ .into_iter()
+ .map(|r| ToolReminder::new(r.reminder, now))
+ .collect();
+
+ let summary = build_summary(&reminders, limit);
+ Ok(ListRemindersResponse { reminders, summary })
+ }
+}
+
+/// Say what came back, and say when it was cut short.
+///
+/// A full page is indistinguishable from a complete list otherwise, and a model
+/// that cannot tell will happily report "you have 20 reminders" when there are
+/// eighty.
+pub(super) fn build_summary(reminders: &[ToolReminder], limit: u32) -> String {
+ if reminders.is_empty() {
+ return "No reminders match.".to_string();
+ }
+
+ let count = reminders.len();
+ let overdue = reminders.iter().filter(|r| r.overdue).count();
+ let plural = if count == 1 { "" } else { "s" };
+
+ let mut summary = if overdue > 0 {
+ format!("Found {count} reminder{plural}, {overdue} of them overdue.")
+ } else {
+ format!("Found {count} reminder{plural}.")
+ };
+
+ if count as u32 >= limit {
+ summary.push_str(" This is the maximum for one call; there may be more.");
+ }
+
+ summary
+}
diff --git a/crates/reminders/src/inbound/toolset/mod.rs b/crates/reminders/src/inbound/toolset/mod.rs
new file mode 100644
index 0000000000..d92ab651f0
--- /dev/null
+++ b/crates/reminders/src/inbound/toolset/mod.rs
@@ -0,0 +1,354 @@
+//! Toolset inbound adapter for reminders.
+//!
+//! A driving adapter like [`axum_router`](super::axum_router), but for the
+//! agent loop. It goes through the same [`RemindersService`] port and the same
+//! access receipts, so a tool can reach exactly what the HTTP API can and
+//! nothing more.
+//!
+//! Only one-shot reminders are creatable here. Recurring schedules are modelled
+//! and stored but never dispatched (see
+//! [`DeliveryOutcome::SkippedRecurring`](crate::domain::models::DeliveryOutcome::SkippedRecurring)),
+//! so a tool that accepted a cron would let the model promise a reminder that
+//! silently never fires. Recurring reminders that already exist are still
+//! listed, and say so.
+
+mod create_reminder;
+mod delete_reminder;
+mod list_reminders;
+mod update_reminder;
+
+#[cfg(test)]
+mod test;
+
+/// The timezone rule, shared verbatim by every tool that takes a timestamp.
+///
+/// A macro rather than a `const` because `#[schemars(description = ...)]` is
+/// built at compile time from literals, and `concat!` only concatenates
+/// literals. One definition is the point: the same rule stated three ways is
+/// how the three drift apart.
+///
+/// It is repeated into each tool's description rather than shared at runtime
+/// because a tool schema has nowhere else to put it — descriptions are
+/// independent fields, and tool search can load one of these tools without the
+/// others, so a cross-reference could dangle.
+macro_rules! utc_conversion_note {
+ () => {
+ "## Times are UTC — convert both ways\n\
+ \n\
+ Timestamps are absolute instants, in and out, while the user asks in their own \
+ timezone. Getting this wrong silently sets the reminder to the wrong hour.\n\
+ \n\
+ - **In:** resolve their wording against their local time, then convert. For \
+ America/New_York (UTC-4 in August), \"3pm tomorrow\" on 2026-08-12 is \
+ `\"2026-08-13T19:00:00Z\"`, not `\"2026-08-13T15:00:00Z\"`.\n\
+ - **Out:** report the response's UTC value back in their timezone — \
+ `\"2026-08-13T19:00:00Z\"` is \"3:00 PM tomorrow\".\n\
+ \n\
+ Ask for their timezone rather than assuming UTC."
+ };
+}
+
+pub(crate) use utc_conversion_note;
+
+use std::sync::Arc;
+
+use ai_toolset::{AsyncToolCollection, ToolCallError};
+use chrono::{DateTime, Utc};
+use entity_access::domain::{
+ models::{AccessError, AnyEntityPermission, EntityAccessReceipt, OwnerAccessLevel},
+ ports::EntityAccessService,
+};
+use macro_user_id::user_id::MacroUserIdStr;
+use model_entity::{Entity, EntityType};
+use schemars::JsonSchema;
+use serde::{Deserialize, Serialize};
+use uuid::Uuid;
+
+use crate::domain::models::{Reminder, ReminderError, ReminderSchedule};
+use crate::domain::ports::RemindersService;
+
+pub use create_reminder::CreateReminder;
+pub use delete_reminder::{DeleteReminder, DeleteReminderResponse};
+pub use list_reminders::{ListReminders, ListRemindersResponse};
+pub use update_reminder::UpdateReminder;
+
+/// Service context for reminder AI tools.
+pub struct RemindersToolContext<S: RemindersService, E: EntityAccessService> {
+ /// The reminders service instance.
+ pub service: Arc<S>,
+ /// Mints the access receipts every reminder operation is gated on.
+ pub entity_access_service: Arc<E>,
+}
+
+impl<S: RemindersService, E: EntityAccessService> Clone for RemindersToolContext<S, E> {
+ fn clone(&self) -> Self {
+ Self {
+ service: self.service.clone(),
+ entity_access_service: self.entity_access_service.clone(),
+ }
+ }
+}
+
+impl<S: RemindersService, E: EntityAccessService> RemindersToolContext<S, E> {
+ /// Create a new reminders tool context.
+ pub fn new(service: S, entity_access_service: Arc<E>) -> Self {
+ Self {
+ service: Arc::new(service),
+ entity_access_service,
+ }
+ }
+
+ /// Prove the caller owns `reminder_id`.
+ ///
+ /// A reminder is never shared, so ownership is the whole access model and
+ /// `Owner` is the only level this can come back with. Somebody else's
+ /// reminder and one that does not exist give the same answer, which is what
+ /// keeps an id from leaking.
+ async fn owner_receipt(
+ &self,
+ user_id: &MacroUserIdStr<'_>,
+ reminder_id: Uuid,
+ ) -> Result<EntityAccessReceipt<OwnerAccessLevel>, ToolCallError> {
+ self.entity_access_service
+ .generate_entity_access_receipt::<OwnerAccessLevel>(
+ user_id,
+ None,
+ &reminder_id.to_string(),
+ EntityType::Reminder,
+ )
+ .await
+ .map_err(|e| ToolCallError {
+ description: format!(
+ "No reminder with id {reminder_id} belongs to this user. \
+ Call ListReminders to see the user's reminders and their ids."
+ ),
+ internal_error: e.into(),
+ })
+ }
+
+ /// Prove the caller may attach a reminder to `entity`.
+ ///
+ /// [`AnyEntityPermission`], not view access: entity permissions come in two
+ /// shapes and a channel resolves to a role rather than an access level, so
+ /// requiring view would reject every channel including ones the caller
+ /// owns. Holding any permission at all is the bar, and no permission is an
+ /// error rather than a value.
+ async fn entity_receipt(
+ &self,
+ user_id: &MacroUserIdStr<'_>,
+ entity: &Entity<'_>,
+ ) -> Result<EntityAccessReceipt<AnyEntityPermission>, ToolCallError> {
+ self.entity_access_service
+ .generate_entity_access_receipt::<AnyEntityPermission>(
+ user_id,
+ None,
+ entity.entity_id.as_ref(),
+ entity.entity_type,
+ )
+ .await
+ .map_err(|e| {
+ // Say what actually went wrong. Collapsing these into one
+ // message told a model with a wrong id that it lacked access,
+ // which sends it looking in the wrong place.
+ let description = match &e {
+ AccessError::NotFound(_) => format!(
+ "No {} exists with id {}.",
+ entity.entity_type.as_ref(),
+ entity.entity_id
+ ),
+ AccessError::BadRequest(msg) => msg.to_string(),
+ _ => format!(
+ "The user does not have access to {} {}.",
+ entity.entity_type.as_ref(),
+ entity.entity_id
+ ),
+ };
+ ToolCallError {
+ description,
+ internal_error: e.into(),
+ }
+ })
+ }
+}
+
+/// Create the reminders toolset.
+pub fn reminders_toolset<S, E>() -> AsyncToolCollection<RemindersToolContext<S, E>>
+where
+ S: RemindersService,
+ E: EntityAccessService,
+{
+ AsyncToolCollection::new()
+ .add_tool::<ListReminders, RemindersToolContext<S, E>>()
+ .add_tool::<CreateReminder, RemindersToolContext<S, E>>()
+ .add_tool::<UpdateReminder, RemindersToolContext<S, E>>()
+ .add_tool::<DeleteReminder, RemindersToolContext<S, E>>()
+}
+
+/// Turn a domain error into something the model can act on.
+///
+/// `BadRequest` is passed through verbatim — it is the service explaining what
+/// was wrong with the request ("remindAt must be in the future"), which is
+/// exactly what lets a model correct itself and retry.
+fn reminder_error(error: ReminderError) -> ToolCallError {
+ let description = match &error {
+ ReminderError::NotFound => {
+ "That reminder no longer exists. Call ListReminders for the current list.".to_string()
+ }
+ ReminderError::EntityNotFound => {
+ "The entity the reminder would be attached to does not exist.".to_string()
+ }
+ ReminderError::BadRequest(message) => message.clone(),
+ ReminderError::EntityAccessDenied => {
+ "The user does not have access to that entity.".to_string()
+ }
+ ReminderError::Internal(_) => "The reminders service failed.".to_string(),
+ };
+
+ ToolCallError {
+ description,
+ internal_error: anyhow::Error::msg(format!("{error:?}")),
+ }
+}
+
+/// Entity types a reminder can be attached to.
+///
+/// Deliberately narrower than [`EntityType`], which covers plenty of things a
+/// reminder has no business pointing at. The names match the ones `ListEntities`
+/// uses so the model sees one vocabulary across tools.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
+#[serde(rename_all = "snake_case")]
+pub enum ReminderEntityType {
+ /// Macro document.
+ Document,
+ /// AI chat conversation.
+ AiChat,
+ /// Macro project (shown as a folder in the app UI).
+ Project,
+ /// Email thread.
+ Email,
+ /// Chat channel.
+ Channel,
+ /// Call record.
+ Call,
+ /// Calendar event.
+ CalendarEvent,
+}
+
+impl From<ReminderEntityType> for EntityType {
+ fn from(value: ReminderEntityType) -> Self {
+ match value {
+ ReminderEntityType::Document => EntityType::Document,
+ ReminderEntityType::AiChat => EntityType::Chat,
+ ReminderEntityType::Project => EntityType::Project,
+ ReminderEntityType::Email => EntityType::EmailThread,
+ ReminderEntityType::Channel => EntityType::Channel,
+ ReminderEntityType::Call => EntityType::Call,
+ ReminderEntityType::CalendarEvent => EntityType::CalendarEvent,
+ }
+ }
+}
+
+impl ReminderEntityType {
+ /// The tool-facing name for a stored entity type, or `None` for one this
+ /// toolset does not name.
+ ///
+ /// Stored reminders can reference types the create tool refuses (they are
+ /// reachable from the UI), so a read has to survive meeting one rather than
+ /// fail the whole list.
+ fn from_entity_type(entity_type: EntityType) -> Option<Self> {
+ match entity_type {
+ EntityType::Document => Some(Self::Document),
+ EntityType::Chat => Some(Self::AiChat),
+ EntityType::Project => Some(Self::Project),
+ EntityType::EmailThread => Some(Self::Email),
+ EntityType::Channel => Some(Self::Channel),
+ EntityType::Call => Some(Self::Call),
+ EntityType::CalendarEvent => Some(Self::CalendarEvent),
+ _ => None,
+ }
+ }
+}
+
+/// Pair an optional entity type and id, rejecting a half-supplied association.
+///
+/// Both or neither. A model that sends only one of them has almost certainly
+/// lost the other, and silently creating a standalone reminder would hide that.
+fn build_entity(
+ entity_type: Option<ReminderEntityType>,
+ entity_id: Option<Uuid>,
+) -> Result<Option<Entity<'static>>, ToolCallError> {
+ match (entity_type, entity_id) {
+ (Some(entity_type), Some(entity_id)) => Ok(Some(
+ EntityType::from(entity_type).with_entity_string(entity_id.to_string()),
+ )),
+ (None, None) => Ok(None),
+ _ => Err(ToolCallError {
+ description: "entityType and entityId must be provided together, or both omitted \
+ for a reminder that is not about anything in particular."
+ .to_string(),
+ internal_error: anyhow::anyhow!("half-supplied reminder entity association"),
+ }),
+ }
+}
+
+/// A reminder as the model sees it.
+#[derive(Debug, Serialize, JsonSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct ToolReminder {
+ /// The reminder's id. Pass this to UpdateReminder or DeleteReminder.
+ pub id: Uuid,
+ /// What the user wanted to be reminded about.
+ pub description: String,
+ /// When the reminder fires next, RFC 3339 in UTC. The user thinks in their
+ /// own timezone — convert before quoting this back to them.
+ pub next_run_at: DateTime<Utc>,
+ /// Whether `nextRunAt` has already passed, evaluated against the server
+ /// clock. An overdue reminder is one the user has been notified about and
+ /// has not dealt with yet.
+ pub overdue: bool,
+ /// For a repeating reminder, its cron expression and timezone. Absent on a
+ /// one-shot, which is everything this toolset can create.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub recurrence: Option<String>,
+ /// The type of thing the reminder is about, when it is about something and
+ /// that type is one these tools name. The app can attach a reminder to
+ /// kinds of thing this list does not cover, so `entityId` may be present
+ /// with no `entityType` beside it — the reminder is about something, but
+ /// not something these tools can name or filter on.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub entity_type: Option<ReminderEntityType>,
+ /// The id of the thing the reminder is about.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub entity_id: Option<String>,
+ /// Whether the user has marked the reminder as dealt with.
+ pub completed: bool,
+ /// Whether the reminder will fire at all. A disabled reminder keeps its
+ /// schedule but is skipped by the dispatcher.
+ pub enabled: bool,
+}
+
+impl ToolReminder {
+ /// Render a stored reminder, resolving overdue-ness against `now`.
+ fn new(reminder: Reminder, now: DateTime<Utc>) -> Self {
+ let recurrence = match &reminder.schedule {
+ ReminderSchedule::Once { .. } => None,
+ ReminderSchedule::Recurring { cron, timezone } => {
+ Some(format!("{} ({timezone})", cron.as_str()))
+ }
+ };
+
+ Self {
+ id: reminder.id,
+ description: reminder.description,
+ next_run_at: reminder.next_run_at,
+ overdue: reminder.next_run_at <= now,
+ recurrence,
+ entity_type: reminder
+ .entity_type
+ .and_then(ReminderEntityType::from_entity_type),
+ entity_id: reminder.entity_id,
+ completed: reminder.completed_at.is_some(),
+ enabled: reminder.enabled,
+ }
+ }
+}
diff --git a/crates/reminders/src/inbound/toolset/test.rs b/crates/reminders/src/inbound/toolset/test.rs
new file mode 100644
index 0000000000..30142c390b
--- /dev/null
+++ b/crates/reminders/src/inbound/toolset/test.rs
@@ -0,0 +1,287 @@
+use super::list_reminders::{ListRemindersResponse, build_summary};
+use super::*;
+use ai_toolset::schema::generate_validated_input_schema;
+use chrono::TimeZone;
+use chrono_tz::Tz;
+
+use crate::domain::models::ReminderCron;
+
+fn at(hour: u32, minute: u32) -> DateTime<Utc> {
+ Utc.with_ymd_and_hms(2026, 8, 7, hour, minute, 0).unwrap()
+}
+
+fn reminder(schedule: ReminderSchedule, next_run_at: DateTime<Utc>) -> Reminder {
+ Reminder {
+ id: Uuid::new_v4(),
+ description: "Reply to Dana".to_string(),
+ entity_type: None,
+ entity_id: None,
+ schedule,
+ next_run_at,
+ enabled: true,
+ completed_at: None,
+ created_at: at(9, 0),
+ updated_at: at(9, 0),
+ }
+}
+
+fn one_shot(next_run_at: DateTime<Utc>) -> Reminder {
+ reminder(
+ ReminderSchedule::Once {
+ remind_at: next_run_at,
+ },
+ next_run_at,
+ )
+}
+
+// --- schema validation ---
+
+#[test]
+fn create_reminder_schema_is_valid() {
+ let validated =
+ generate_validated_input_schema::<CreateReminder>().expect("schema should validate");
+ assert_eq!(validated.name, "CreateReminder");
+ assert!(
+ validated.description.contains("remindAt"),
+ "{}",
+ validated.description
+ );
+}
+
+#[test]
+fn list_reminders_schema_is_valid() {
+ let validated =
+ generate_validated_input_schema::<ListReminders>().expect("schema should validate");
+ assert_eq!(validated.name, "ListReminders");
+ assert!(
+ validated.description.contains("soonest first"),
+ "{}",
+ validated.description
+ );
+}
+
+#[test]
+fn update_reminder_schema_is_valid() {
+ let validated =
+ generate_validated_input_schema::<UpdateReminder>().expect("schema should validate");
+ assert_eq!(validated.name, "UpdateReminder");
+ assert!(
+ validated.description.contains("completed"),
+ "{}",
+ validated.description
+ );
+}
+
+#[test]
+fn delete_reminder_schema_is_valid() {
+ let validated =
+ generate_validated_input_schema::<DeleteReminder>().expect("schema should validate");
+ assert_eq!(validated.name, "DeleteReminder");
+ assert!(
+ validated.description.contains("cannot be undone"),
+ "{}",
+ validated.description
+ );
+}
+
+/// Every tool has to survive being put in a collection — that is where name
+/// conflicts and schema rejections actually surface.
+#[test]
+fn toolset_builds_with_every_tool() {
+ use crate::domain::service::NoOpRemindersService;
+ use entity_access::domain::ports::NoOpEntityAccessService;
+
+ let toolset = reminders_toolset::<NoOpRemindersService, NoOpEntityAccessService>();
+
+ for name in [
+ "CreateReminder",
+ "ListReminders",
+ "UpdateReminder",
+ "DeleteReminder",
+ ] {
+ assert!(toolset.tools.contains_key(name), "missing {name}");
+ }
+ assert_eq!(toolset.tools.len(), 4);
+ assert!(
+ toolset.user_tools.is_empty(),
+ "reminder tools run in the loop, none are user-executed"
+ );
+}
+
+// --- entity pairing ---
+
+#[test]
+fn entity_type_and_id_map_to_a_domain_entity() {
+ let id = Uuid::new_v4();
+ let entity = build_entity(Some(ReminderEntityType::Email), Some(id))
+ .expect("a complete pair is valid")
+ .expect("a complete pair is an entity");
+
+ assert_eq!(entity.entity_type, EntityType::EmailThread);
+ assert_eq!(entity.entity_id, id.to_string());
+}
+
+#[test]
+fn neither_entity_field_is_a_standalone_reminder() {
+ let entity = build_entity(None, None).expect("neither field is valid");
+ assert!(entity.is_none());
+}
+
+/// A model that sends one half has lost the other. Creating a standalone
+/// reminder instead would hide that.
+#[test]
+fn half_an_entity_pair_is_rejected() {
+ let only_type = build_entity(Some(ReminderEntityType::Document), None)
+ .expect_err("type without id should be rejected");
+ assert!(
+ only_type.description.contains("must be provided together"),
+ "{}",
+ only_type.description
+ );
+
+ assert!(build_entity(None, Some(Uuid::new_v4())).is_err());
+}
+
+/// The tool vocabulary and the stored vocabulary have to agree in both
+/// directions, or a reminder is created as one type and read back as another.
+#[test]
+fn entity_type_mapping_round_trips() {
+ for tool_type in [
+ ReminderEntityType::Document,
+ ReminderEntityType::AiChat,
+ ReminderEntityType::Project,
+ ReminderEntityType::Email,
+ ReminderEntityType::Channel,
+ ReminderEntityType::Call,
+ ReminderEntityType::CalendarEvent,
+ ] {
+ let stored = EntityType::from(tool_type);
+ assert_eq!(
+ ReminderEntityType::from_entity_type(stored),
+ Some(tool_type),
+ "{tool_type:?} did not round trip"
+ );
+ }
+}
+
+/// Reminders on types this toolset does not name are reachable from the UI, so
+/// a read has to render them rather than fail.
+#[test]
+fn unnamed_entity_type_reads_back_as_no_type() {
+ let mut reminder = one_shot(at(10, 0));
+ reminder.entity_type = Some(EntityType::CrmCompany);
+ reminder.entity_id = Some(Uuid::new_v4().to_string());
+
+ let rendered = ToolReminder::new(reminder, at(9, 0));
+ assert_eq!(rendered.entity_type, None);
+ assert!(
+ rendered.entity_id.is_some(),
+ "the id survives even when the type has no tool-facing name"
+ );
+}
+
+// --- rendering ---
+
+#[test]
+fn a_future_reminder_is_not_overdue() {
+ let rendered = ToolReminder::new(one_shot(at(10, 0)), at(9, 0));
+ assert!(!rendered.overdue);
+ assert_eq!(rendered.recurrence, None);
+ assert!(!rendered.completed);
+}
+
+/// Overdue is inclusive of the firing instant: at exactly `next_run_at` the
+/// sweep has already picked the reminder up.
+#[test]
+fn a_reminder_at_its_firing_instant_is_overdue() {
+ let rendered = ToolReminder::new(one_shot(at(9, 0)), at(9, 0));
+ assert!(rendered.overdue);
+}
+
+#[test]
+fn a_completed_reminder_reads_as_completed() {
+ let mut reminder = one_shot(at(10, 0));
+ reminder.completed_at = Some(at(9, 30));
+
+ let rendered = ToolReminder::new(reminder, at(9, 0));
+ assert!(rendered.completed);
+}
+
+/// A repeating reminder has to announce itself — these tools cannot create or
+/// reschedule one, so the model needs to know before it offers to.
+#[test]
+fn a_recurring_reminder_reports_its_recurrence() {
+ let schedule = ReminderSchedule::Recurring {
+ cron: ReminderCron::parse("0 9 * * *").expect("valid cron"),
+ timezone: Tz::America__New_York,
+ };
+ let rendered = ToolReminder::new(reminder(schedule, at(13, 0)), at(9, 0));
+
+ let recurrence = rendered.recurrence.expect("recurring reminders say so");
+ assert!(recurrence.contains("0 0 9 * * *"), "{recurrence}");
+ assert!(recurrence.contains("America/New_York"), "{recurrence}");
+}
+
+// --- list summary ---
+
+#[test]
+fn empty_list_summary() {
+ assert_eq!(build_summary(&[], 20), "No reminders match.");
+}
+
+#[test]
+fn summary_counts_overdue_reminders() {
+ let reminders = vec![
+ ToolReminder::new(one_shot(at(8, 0)), at(9, 0)),
+ ToolReminder::new(one_shot(at(10, 0)), at(9, 0)),
+ ];
+
+ let summary = build_summary(&reminders, 20);
+ assert!(summary.contains("2 reminders"), "{summary}");
+ assert!(summary.contains("1 of them overdue"), "{summary}");
+ assert!(
+ !summary.contains("there may be more"),
+ "a short page is the whole list: {summary}"
+ );
+}
+
+/// A full page is otherwise indistinguishable from a complete list, and a model
+/// that cannot tell will report the truncated count as the total.
+#[test]
+fn summary_admits_when_the_page_is_full() {
+ let reminders = vec![ToolReminder::new(one_shot(at(10, 0)), at(9, 0))];
+ let summary = build_summary(&reminders, 1);
+ assert!(summary.contains("there may be more"), "{summary}");
+}
+
+#[test]
+fn single_reminder_summary_is_not_pluralized() {
+ let reminders = vec![ToolReminder::new(one_shot(at(10, 0)), at(9, 0))];
+ let summary = build_summary(&reminders, 20);
+ assert!(summary.contains("Found 1 reminder."), "{summary}");
+}
+
+/// The response is what the model actually reads, so the fields it needs have
+/// to survive serialization under the names the schema advertises.
+#[test]
+fn response_serializes_with_camel_case_keys() {
+ let response = ListRemindersResponse {
+ reminders: vec![ToolReminder::new(one_shot(at(10, 0)), at(9, 0))],
+ summary: "Found 1 reminder.".to_string(),
+ };
+
+ let json = serde_json::to_value(&response).expect("response should serialize");
+ let reminder = &json["reminders"][0];
+
+ assert!(reminder["nextRunAt"].is_string());
+ assert_eq!(reminder["overdue"], serde_json::json!(false));
+ assert_eq!(reminder["completed"], serde_json::json!(false));
+ assert!(
+ reminder.get("recurrence").is_none(),
+ "a one-shot omits recurrence rather than sending null"
+ );
+ assert!(
+ reminder.get("entityType").is_none(),
+ "a standalone reminder omits its entity fields"
+ );
+}
diff --git a/crates/reminders/src/inbound/toolset/update_reminder.rs b/crates/reminders/src/inbound/toolset/update_reminder.rs
new file mode 100644
index 0000000000..72c3930987
--- /dev/null
+++ b/crates/reminders/src/inbound/toolset/update_reminder.rs
@@ -0,0 +1,125 @@
+//! UpdateReminder tool for rescheduling, rewording, or completing a reminder.
+
+use ai_toolset::{
+ AsyncTool, RequestContext, ServiceContext, ToolAnnotated, ToolAnnotations, ToolResult,
+};
+use async_trait::async_trait;
+use chrono::{DateTime, Utc};
+use entity_access::domain::ports::EntityAccessService;
+use schemars::JsonSchema;
+use serde::Deserialize;
+use uuid::Uuid;
+
+use super::{RemindersToolContext, ToolReminder, reminder_error, utc_conversion_note};
+use crate::domain::models::{ReminderPatch, ReminderSchedule};
+use crate::domain::ports::RemindersService;
+
+/// Change one of the current user's reminders.
+#[derive(Debug, Deserialize, JsonSchema, Clone)]
+#[serde(rename_all = "camelCase")]
+#[schemars(
+ title = "UpdateReminder",
+ description = concat!(
+ "\
+Change one of the current user's reminders: reword it, move when it fires, or mark it done. \
+Get the `reminderId` from ListReminders or CreateReminder.\n\
+\n\
+Pass only the fields you are changing; anything omitted is left alone. At least one must be \
+given.\n\
+\n\
+- Snooze or reschedule: set `remindAt`\n\
+- Mark done: `completed: true` — the user has dealt with it and it leaves their active list\n\
+- Reopen: `completed: false`\n\
+- Reword: set `description`\n\
+\n\
+Marking done is the normal way to clear a reminder the user has handled, and it is \
+reversible: the reminder drops out of the default ListReminders results but is still there, \
+readable with `completed: true` and restorable with `completed: false`. Reach for \
+DeleteReminder only when the user wants the reminder not to exist; that cannot be undone.\n\
+\n\
+Two things this tool will not do. It cannot change what a reminder is attached to — create a \
+new reminder and delete this one instead. And setting `remindAt` on a repeating reminder \
+replaces the repetition with that single firing, so only do it if the user asked to stop it \
+repeating.\n\
+\n",
+ utc_conversion_note!()
+ )
+)]
+pub struct UpdateReminder {
+ /// The reminder to change.
+ #[schemars(description = "The id of the reminder to change.")]
+ pub reminder_id: Uuid,
+
+ /// Replacement description.
+ #[schemars(description = "Replacement reminder text. Max 2000 characters.")]
+ #[serde(default)]
+ pub description: Option<String>,
+
+ /// Replacement one-shot firing time.
+ #[schemars(description = "Reschedule to this RFC 3339 timestamp in UTC (e.g. \
+ \"2026-08-08T14:00:00Z\"). Must be in the future — to move a reminder \
+ that has already fired, give it a new future time. Convert from the \
+ user's local timezone before sending; see \"Times are UTC\" in the tool \
+ description.")]
+ #[serde(default)]
+ pub remind_at: Option<DateTime<Utc>>,
+
+ /// Mark the reminder as dealt with, or live again.
+ #[schemars(
+ description = "Mark the reminder as dealt with (true) or put it back on the active \
+ list (false)."
+ )]
+ #[serde(default)]
+ pub completed: Option<bool>,
+}
+
+impl ToolAnnotated for UpdateReminder {
+ const ANNOTATIONS: ToolAnnotations = ToolAnnotations::destructive("Update reminder");
+}
+
+#[async_trait]
+impl<S, E> AsyncTool<RemindersToolContext<S, E>> for UpdateReminder
+where
+ S: RemindersService,
+ E: EntityAccessService,
+{
+ type Output = ToolReminder;
+
+ #[tracing::instrument(skip_all, fields(
+ user_id = ?request_context.user_id,
+ reminder_id = %self.reminder_id,
+ completed = ?self.completed,
+ ), err)]
+ async fn call(
+ &self,
+ service_context: ServiceContext<RemindersToolContext<S, E>>,
+ request_context: RequestContext,
+ ) -> ToolResult<Self::Output> {
+ tracing::info!("Update reminder");
+
+ let receipt = service_context
+ .owner_receipt(&request_context.user_id, self.reminder_id)
+ .await?;
+
+ let patch = ReminderPatch {
+ description: self.description.clone(),
+ schedule: self
+ .remind_at
+ .map(|remind_at| ReminderSchedule::Once { remind_at }),
+ // Not exposed: `enabled` is the dispatcher's switch and reads as a
+ // second, subtly different way of saying "done". Two booleans that
+ // both sound like "turn this off" is how a model picks the wrong
+ // one. Rescheduling covers the case it would serve.
+ enabled: None,
+ completed: self.completed,
+ };
+
+ let reminder = service_context
+ .service
+ .update_reminder(receipt, patch)
+ .await
+ .map_err(reminder_error)?;
+
+ Ok(ToolReminder::new(reminder, Utc::now()))
+ }
+}
diff --git a/crates/reminders/src/lib.rs b/crates/reminders/src/lib.rs
index e508804285..b5b2a8904c 100644
--- a/crates/reminders/src/lib.rs
+++ b/crates/reminders/src/lib.rs
@@ -19,7 +19,7 @@
pub mod domain;
-#[cfg(any(feature = "inbound", feature = "dispatch"))]
+#[cfg(any(feature = "inbound", feature = "dispatch", feature = "ai_tools"))]
pub mod inbound;
#[cfg(feature = "outbound")]
diff --git a/services/document_cognition_service/src/api/context/test.rs b/services/document_cognition_service/src/api/context/test.rs
index 5ce3f72167..fd6bb7b273 100644
--- a/services/document_cognition_service/src/api/context/test.rs
+++ b/services/document_cognition_service/src/api/context/test.rs
@@ -368,6 +368,10 @@ pub async fn test_api_context(pool: sqlx::Pool<sqlx::Postgres>) -> std::sync::Ar
"test-internal-api-key".to_string(),
),
notification_tool_context: notification_tool_context.clone(),
+ reminders_tool_context: ai_tools::build_reminders_tool_context(
+ pool.clone(),
+ entity_access_service.clone(),
+ ),
import_tool_context: ai_tools::ToolImportToolContext::unwired(),
chat_tool_context,
channel_tool_context: ai_tools::build_channel_tool_context_without_side_effects(
diff --git a/services/document_cognition_service/src/main.rs b/services/document_cognition_service/src/main.rs
index b330c5ce61..eae11f0fb3 100644
--- a/services/document_cognition_service/src/main.rs
+++ b/services/document_cognition_service/src/main.rs
@@ -561,6 +561,10 @@ async fn main() -> anyhow::Result<()> {
internal_api_key.clone(),
),
notification_tool_context: notification_tool_context.clone(),
+ reminders_tool_context: ai_tools::build_reminders_tool_context(
+ db.clone(),
+ entity_access_service.clone(),
+ ),
import_tool_context: import::inbound::toolset::ImportToolContext::wired(
import_service.clone(),
),
diff --git a/services/mcp_service/src/context.rs b/services/mcp_service/src/context.rs
index 4a06c22f40..7de0ccd084 100644
--- a/services/mcp_service/src/context.rs
+++ b/services/mcp_service/src/context.rs
@@ -382,6 +382,10 @@ async fn build_tool_context(args: ToolContextBuildArgs<'_>) -> anyhow::Result<To
config.internal_api_key.to_string(),
),
notification_tool_context,
+ reminders_tool_context: ai_tools::build_reminders_tool_context(
+ db.clone(),
+ entity_access_service.clone(),
+ ),
import_tool_context: ToolImportToolContext::unwired(),
chat_tool_context,
channel_tool_context,