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
get_calendar_events silently accepted a missing accountId and fell through to a "query all accounts" path, producing confusing empty or ambiguous results rather than a clear error. accountId is now validated on every call. When accountId is omitted but calendarId is provided, the tool attempts to auto-resolve the account by searching all enabled accounts' calendars for a unique match.
Changes
GetCalendarEventsTool
When both accountId and calendarId are omitted: returns { "error": "accountId is required" }, consistent with the pattern already used in GetCalendarEventDetailsTool
When accountId is omitted but calendarId is provided: searches all enabled accounts in parallel for a calendar with that ID
Exactly one match → account is auto-resolved and the call proceeds normally
No match → { "error": "No calendar found with id '...'. Provide accountId to specify which account to query." }
Multiple matches → { "error": "calendarId '...' exists in multiple accounts; provide accountId to specify which account to query." }
Removed the now-dead "query all accounts" branch (GetEnabledAccounts()) and its conditional error message
Updated tool and parameter descriptions to reflect the new behavior
GetCalendarEventsToolTests
Added validation tests for null and empty accountId (no calendarId)
Added test for single-match auto-resolution via calendarId
Added test for no-match error when calendarId is not found in any account
Added test for ambiguous error when calendarId exists in multiple accounts
Error responses
{ "error": "accountId is required" }
{ "error": "No calendar found with id '<calendarId>'. Provide accountId to specify which account to query." }
{ "error": "calendarId '<calendarId>' exists in multiple accounts; provide accountId to specify which account to query." }
CopilotAI
changed the title
[WIP] Add validation error for missing accountId in get_calendar_events
Require accountId in get_calendar_events, return structured validation error when missing
Apr 22, 2026
@copilot
Is it possible, if the caller does omit the accountId, to use the calendarId value to find the matching calendar if there are no other matches? In other words, if there's only one calendar with that id, we could just use the id value right?
@copilot
Is it possible, if the caller does omit the accountId, to use the calendarId value to find the matching calendar if there are no other matches? In other words, if there's only one calendar...
Yes, implemented in commit 1897f0a. When accountId is omitted but calendarId is provided, the tool now searches all enabled accounts' calendars in parallel. If exactly one account owns a calendar with that ID, it's used automatically. If zero match, it returns "No calendar found with id '...'". If more than one match, it returns "calendarId '...' exists in multiple accounts; provide accountId to specify which account to query."
CopilotAI
changed the title
Require accountId in get_calendar_events, return structured validation error when missing
Validate accountId in get_calendar_events, with auto-resolution from calendarId
Apr 22, 2026
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.
get_calendar_eventssilently accepted a missingaccountIdand fell through to a "query all accounts" path, producing confusing empty or ambiguous results rather than a clear error.accountIdis now validated on every call. WhenaccountIdis omitted butcalendarIdis provided, the tool attempts to auto-resolve the account by searching all enabled accounts' calendars for a unique match.Changes
GetCalendarEventsToolaccountIdandcalendarIdare omitted: returns{ "error": "accountId is required" }, consistent with the pattern already used inGetCalendarEventDetailsToolaccountIdis omitted butcalendarIdis provided: searches all enabled accounts in parallel for a calendar with that ID{ "error": "No calendar found with id '...'. Provide accountId to specify which account to query." }{ "error": "calendarId '...' exists in multiple accounts; provide accountId to specify which account to query." }GetEnabledAccounts()) and its conditional error messageGetCalendarEventsToolTestsaccountId(nocalendarId)calendarIdcalendarIdis not found in any accountcalendarIdexists in multiple accountsError responses
{ "error": "accountId is required" }{ "error": "No calendar found with id '<calendarId>'. Provide accountId to specify which account to query." }{ "error": "calendarId '<calendarId>' exists in multiple accounts; provide accountId to specify which account to query." }