Add exclude_calendars parameter to calendar_list_events and calendar_search_events - #5
Open
fmasi wants to merge 1 commit into
Open
Add exclude_calendars parameter to calendar_list_events and calendar_search_events#5fmasi wants to merge 1 commit into
exclude_calendars parameter to calendar_list_events and calendar_search_events#5fmasi wants to merge 1 commit into
Conversation
Optional list[str]; calendars whose title matches any entry (case-insensitive exact match) are dropped before fetching. Ignored when calendar_name is set (single-include wins). Default None preserves existing behavior. Closes harriscarl#4 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an optional
exclude_calendars: list[str] | Noneparameter tocalendar_list_eventsandcalendar_search_events(and the underlyingEventKitStore.get_events/search_events). When provided, calendars whosetitle()matches any entry (case-insensitive, exact match) are dropped from the EventKit fetch.Closes #4.
Design notes
calendarslist passed intopredicateForEventsWithStartDate_endDate_calendars_, so excluded calendars are never fetched in the first place — no wasted serialization.calendar_name. When the caller specifies a single calendar viacalendar_name,exclude_calendarsis ignored (a single-include and an exclude list together would be incoherent). Documented in the docstring.None, so existing callers see identical behavior.*@domain.comstyle globs as a follow-up if you want it.Diff scope
Two files, 28 insertions / 3 deletions:
src/apple_eventkit_mcp/eventkit_store.py— add param toget_eventsandsearch_events; apply filter whencalendar_nameis unsetsrc/apple_eventkit_mcp/calendar_tools.py— surface the param on the two MCP tools, pass through to the storeTest plan
exclude_calendarsarg) behave identicallycalendar_list_events(start, end, exclude_calendars=["Holidays in Canada"])returns events from all calendars except that oneexclude_calendars=["HOLIDAYS in canada"]still excludescalendar_list_events(start, end, calendar_name="Wellbeing", exclude_calendars=["Wellbeing"])returns Wellbeing events (single-include wins)calendar_search_events(query="x", exclude_calendars=[...])filters search scope the same wayNo existing test suite to extend; smoke-tested locally against my real calendar.
🤖 Generated with Claude Code