You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add reminder update, delete, and list management tools - #271
reminders_update edits an existing reminder by identifier with the same properties as reminders_create plus a completed flag. Omitted properties are unchanged; null clears an optional property (notes, URL, start, due, alarms). An unmatched list name is an error rather than a silent default, mirroring contacts_update's partial-update semantics.
reminders_delete removes a reminder by identifier, with destructiveHint/idempotentHint annotations matching events_delete.
reminders_lists_create, reminders_lists_rename, and reminders_lists_delete manage lists; reminders_lists now returns an identifier for targeting, delete refuses subscribed or immutable lists, and an ambiguous list name (several lists share it) is an error pointing at the identifier instead of an arbitrary first match.
reminders_create gains url and start properties, and its alarms parameter accepts relative, absolute, and proximity configurations like events_create — bare minutes-before integers still work, so existing callers are unaffected.
EventKit accepts EKCalendarItem.location on reminders but the Reminders store does not persist it, so it is intentionally not exposed.
Hardening
reminders_update resolves and validates everything — target list included — before mutating anything: EventKit retains unsaved mutations in its shared store, so a validation error thrown after apply would otherwise be committed by the next successful save of anything.
Numbers arrive as integers or integral doubles depending on the client library; every integer parameter accepts both (converting with Int(exactly:) so a schema-legal but out-of-range value errors instead of trapping), and alarm minutes scale in Double for the same reason.
The update tool does not advertise priority's create-time default of none: omission means leave unchanged, and a default-applying client would otherwise wipe priorities it never meant to touch. Likewise the shared list description is split per tool — create documents its unmatched-name fallback to the default list, update states the name must match an existing list.
Testing
swift format lint --strict and xcodebuild -scheme iMCP build pass.
Exercised against the live Reminders store on macOS 27.2 via a script mirroring each tool's EventKit calls: created a reminder with URL, start date, and all three alarm kinds and confirmed every field round-trips; resolved it back via calendarItem(withIdentifier:); toggled isCompleted both ways (completion date set/cleared); deleted it; created, renamed, and deleted a list. 18/18 checks passed.
reminders_update edits an existing reminder by identifier with the same
properties as reminders_create plus completion state; omitted properties
are unchanged and null clears them. reminders_delete removes a reminder.
reminders_lists_create, reminders_lists_rename, and reminders_lists_delete
manage lists, which now expose an identifier. reminders_create also gains
URL and start-date properties, and its alarms parameter accepts relative,
absolute, and proximity alarms like events_create.
EventKit accepts EKCalendarItem.location on reminders but the store does
not persist it, so it is not exposed.
Fixesmattt#140
- Alarms accept bare integers again (minutes before due), so callers
written against the original schema keep working; unparseable alarm
configurations are now an error instead of being silently dropped
- Proximity alarms take a free-text location, geocoded with Maps, as an
alternative to explicit coordinates
- Numeric alarm fields accept whole numbers for latitude, longitude,
and radius alike
- Nullable properties (notes, url, start, due, alarms) accept null in
their schemas, matching the documented clear-on-null behavior
- List lookup by name errors when several lists share the name instead
of acting on an arbitrary match
- Alarm objects now require "type": without it, absolute and proximity
configurations were schema-valid but routed as relative and rejected
with an error about minutes the caller never sent
- A proximity alarm's radius falls back to the documented 200 m instead
of EKStructuredLocation's zero-radius default, which never triggers
- reminders_update resolves and validates everything before mutating
the reminder, and moves the list change after apply: EventKit keeps
unsaved mutations in its shared store, so a failed call could
otherwise be committed by the next successful save
- The "list" argument accepts a list identifier, so the ambiguous-name
error's instruction is no longer a dead end for create and update
- An integral-double minutes value (30.0) is accepted like JSON Schema's
integer does; an unknown alarm sound throws instead of silently
arming a silent alarm
- reminders_update checks list modifiability before mutating anything:
the reminder's list (or the move target) is known up front, and
throwing after apply would leave unsaved mutations in the shared
store for the next successful save to commit
- The bare alarm form accepts an integral double (30.0), like the
object form already did; both convert with Int(exactly:) so a
schema-legal but out-of-range value errors instead of trapping
- The update tool no longer advertises priority's create-time default
of "none": omitting a property means leave unchanged, and a client
honoring the advertised default would wipe priorities untouched
- OrderedDictionary.merging calls uniquingKeysWith as (existing,
incoming); the closures passed (new, old), so the update tool's
priority entry — added to drop create's default — was discarded and
the default kept being advertised. Swap the argument order at all
three call sites
- Alarm minutes convert to Double before scaling by 60: a
schema-legal Int64 like 9_223_372_036_854_775_807 passed Int(exactly:)
but trapped in minutes * 60, killing the process — and Int.min also
trapped on the leading negation
- The shared list description is neutral; create documents its
unmatched-name fallback to the default list and update documents
that the name must match an existing list
Validate every supplied create/update property instead of treating
wrong-typed values as omitted: title, notes, url, start, due, priority
(including enum membership), completed, alarms, and list now throw
before anything is mutated. Explicit proximity-alarm coordinates are
checked against geographic ranges, negative radii are rejected (zero
stays the system-default request), and the schemas advertise the same
bounds. Create/update are marked openWorldHint because proximity
alarms can geocode through Maps.
due and start already normalize date-only values to local midnight, and
the alarm configurations advertise parity with events_create, whose
builder does the same — but the absolute branch rejected them. Accept
date-only datetimes as midnight on that same rule.
Self-review follow-up in f4eb283: a date-only absolute alarm datetime is now treated as local midnight, the same rule due/start already follow and the one events_create's alarm builder uses — the body promises parity with events_create, but the absolute branch was rejecting date-only values instead.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b560ffd: both reminders_lists_rename and reminders_lists_delete advertise .allOf([object, .anyOf([required identifier, required name])]), so clients see that one selector is mandatory — matching what the handler already enforced.
A present-but-malformed list identifier fell through to the name
fallback, so {identifier: 123, name: \"Work\"} deleted the named list
instead of rejecting the preferred selector; both selectors now reject
a present value of the wrong shape before any resolution. Nested alarm
objects get the same treatment the top level already had: a non-string
type no longer folds into the relative default, unknown keys are
rejected per the advertised additionalProperties: false, a string
radius no longer silently becomes the 200 m default, an unsupported
proximity string no longer folds into .enter, non-string sound and
emailAddress are errors, and mixing the location query and coordinate
variants is rejected. URLs must be absolute (carry a scheme), matching
the .uri format the schema already advertises, and reminders_create
now rejects update-only properties like completed because inputSchema
is advertised, not enforced. The rename and delete list schemas carry
an anyOf requirement for identifier or name so a request carrying
neither is advertised as invalid, which the handler already enforced.
Apple's documentation for EKStructuredLocation.radius says
to set it to 0 to use the default radius, and gives no value for that default.
An absent radius now stays 0 instead of becoming 200 meters,
and the alarm schemas no longer advertise a 200-meter default.
Present values are validated as before.
The MCP specification requires type "object" at the root of a tool's
inputSchema. The allOf schemas for reminders_lists_rename and
reminders_lists_delete encoded with only an allOf key at the root,
and the JSONSchema package cannot add anyOf to an object schema.
Both tools return to a top-level object schema
with the same properties, required keys, and additionalProperties,
and their descriptions now state that identifier or name is required.
The handler still rejects a request that has neither.
Alarm parsing and building are now separate steps.
apply parses every alarm configuration without I/O, then builds the alarms,
so the Maps search for a proximity alarm's location runs
only after every check passes:
radius, proximity, sound, and emailAddress on the same alarm,
and every check on the other alarms in the request.
Error messages and codes are unchanged,
and the alarms are built in the same order with the same properties.
reminders_delete, reminders_lists_create, reminders_lists_rename,
and reminders_lists_delete advertise additionalProperties: false but
never enforced it at runtime, so a typo key rode along while the
request still deleted or created what it named. Each handler now
rejects unknown keys before resolving or touching anything, matching
the schema exactly.
I pushed a few commits to reminders-edit-delete and reminders-recurrence before your latest round, so please pull before your next push:
An alarm without a radius now uses the system default (EKStructuredLocation treats 0 as "use the default radius") instead of 200 m.
The list rename and delete tools advertise a plain object schema again. MCP requires type: "object" at the root, and the allOf version didn't have one, so the "identifier or name" requirement is in the descriptions instead. Copilot keeps flagging this; I'm fine leaving it.
Every alarm in a request is validated before any Maps search runs.
Add reminder update, delete, and list management tools #271: if EventKit rejects the save in reminders_update, the reminder is rolled back, so the shared store doesn't hold the changes for a later save. I didn't add a "relative alarms need a due date" check. Apple doesn't document that rule, and it would change reminders_create from what's on main.
Add recurrence and completion details to reminders #272: the comment on value(for:) now says a rule round-trips only when every value is representable. I also ran your ordinal change through a round-trip check for every weekday from -54 to 54, and it all lines up.
One more thing I noticed but haven't verified: EKError.Code has reminderAlarmContainsEmailOrUrl, which suggests EventKit might reject email alarms on reminders. That shouldn't hold up this PR or 1.7.0 — if it turns out to be a problem, it can go in a patch release.
Reset shared event store after saveCalendar failure
App/Services/Reminders.swift:772
If saveCalendar throws, this title mutation remains on the calendar held by the shared EKEventStore; a later successful commit can therefore persist a rename that this call reported as failed. The reminder update path explicitly rolls back for the same reason, but EKCalendar has no item-level rollback, so reset the store on failure before propagating the error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #140
What
reminders_updateedits an existing reminder by identifier with the same properties asreminders_createplus acompletedflag. Omitted properties are unchanged;nullclears an optional property (notes, URL, start, due, alarms). An unmatchedlistname is an error rather than a silent default, mirroringcontacts_update's partial-update semantics.reminders_deleteremoves a reminder by identifier, withdestructiveHint/idempotentHintannotations matchingevents_delete.reminders_lists_create,reminders_lists_rename, andreminders_lists_deletemanage lists;reminders_listsnow returns anidentifierfor targeting, delete refuses subscribed or immutable lists, and an ambiguous list name (several lists share it) is an error pointing at the identifier instead of an arbitrary first match.reminders_creategainsurlandstartproperties, and itsalarmsparameter acceptsrelative,absolute, andproximityconfigurations likeevents_create— bare minutes-before integers still work, so existing callers are unaffected.EventKit accepts
EKCalendarItem.locationon reminders but the Reminders store does not persist it, so it is intentionally not exposed.Hardening
reminders_updateresolves and validates everything — target list included — before mutating anything: EventKit retains unsaved mutations in its shared store, so a validation error thrown afterapplywould otherwise be committed by the next successful save of anything.Int(exactly:)so a schema-legal but out-of-range value errors instead of trapping), and alarm minutes scale inDoublefor the same reason.priority's create-time default ofnone: omission means leave unchanged, and a default-applying client would otherwise wipe priorities it never meant to touch. Likewise the sharedlistdescription is split per tool — create documents its unmatched-name fallback to the default list, update states the name must match an existing list.Testing
swift format lint --strictandxcodebuild -scheme iMCP buildpass.calendarItem(withIdentifier:); toggledisCompletedboth ways (completion date set/cleared); deleted it; created, renamed, and deleted a list. 18/18 checks passed.