Skip to content

Default get_calendar_events to all enabled accounts (#59)#60

Merged
rockfordlhotka merged 3 commits into
mainfrom
rockfordlhotka/59-calendar-read-tools-all-accounts
Jun 2, 2026
Merged

Default get_calendar_events to all enabled accounts (#59)#60
rockfordlhotka merged 3 commits into
mainfrom
rockfordlhotka/59-calendar-read-tools-all-accounts

Conversation

@rockfordlhotka

Copy link
Copy Markdown
Member

Summary

Fixes #59. get_calendar_events threw accountId is required when both accountId and calendarId were omitted, even though accountId is declared optional in the tool schema and sibling read tools (search_emails, list_calendars, get_emails, get_contacts) default to querying all accounts. The inconsistency read as a bug — a caller following the schema (and the server's own daily_briefing prompt guidance) got a hard error. It was observed downstream as a top tool-call failure for a consuming agent.

When neither accountId nor calendarId is supplied, the tool now queries all enabled accounts instead of throwing, mirroring list_calendars.

Changes

  • GetCalendarEventsTool.cs — Replaced the throw-and-single-account logic with an up-front validAccounts list (same shape as search_emails):
    • accountId provided → that single account
    • calendarId alone → existing auto-resolve-to-one-account path (unchanged)
    • neither → all enabled accounts via GetEnabledAccounts(); throws No accounts found only when none exist
    • The existing parallel fan-out + per-account warning aggregation already looped over validAccounts, so accounts that don't support calendar (e.g. IMAP) degrade gracefully into a warnings entry.
    • Updated the tool + accountId descriptions to reflect "one or all accounts."
  • GetCalendarEventsToolTests.cs — Replaced the two obsolete *_ThrowsMcpException tests with *_QueriesAllEnabledAccounts (single- and multi-account merge/sort) and added *_NoAccountsConfigured_ThrowsMcpException.
  • Directory.Build.props — Version bump 1.3.31.3.4 (patch, bug fix).

Audit of the rest of issue #59's checklist (no code needed)

  • get_emails, list_calendars, get_contextual_email_summary, get_contacts — already default to all accounts ✅
  • respond_to_event / create_event correctly expect explicit accountId; move_email requires it via RequireNonEmpty
  • daily_briefing's "omit accountId to query all at once" guidance is now consistent with the tool ✅

Testing

dotnet test — all 244 tests pass.

🤖 Generated with Claude Code

rockfordlhotka and others added 3 commits June 2, 2026 17:16
get_calendar_events threw "accountId is required" when both accountId
and calendarId were omitted, even though accountId is schema-optional
and sibling read tools (search_emails, list_calendars, get_emails,
get_contacts) default to querying all accounts. This inconsistency read
as a bug and was a top tool-call failure for consuming agents.

When neither accountId nor calendarId is supplied, query all enabled
accounts instead of throwing, mirroring list_calendars. The existing
parallel fan-out and per-account warning aggregation already looped over
validAccounts, so accounts that don't support calendar degrade into a
warning. Bumps version to 1.3.4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the floating :latest tag with the explicit 1.3.4 tag so the
deployed version is unambiguous and matches the image pushed for #59.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The GetGuide calendar.md skill still said accountId was required unless
calendarId resolved one account. Align it with the #59 behavior change:
omitting accountId now fans out across all enabled accounts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rockfordlhotka
rockfordlhotka merged commit 7bbfa44 into main Jun 2, 2026
1 check passed
@rockfordlhotka
rockfordlhotka deleted the rockfordlhotka/59-calendar-read-tools-all-accounts branch June 2, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_calendar_events throws "accountId is required" where sibling read tools default to all accounts

1 participant