Skip to content

Add the calendar tools and calendarEventId on messages - #84

Merged
shalim786 merged 2 commits into
mainfrom
calendar/agent-tools
Oct 20, 2026
Merged

shalim786 merged 2 commits into
mainfrom
calendar/agent-tools

Conversation

@shalim786

@shalim786 shalim786 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Gives agents AgentMail Calendar, which left Labs on Oct 19 2026 (agentmail-api#1706) and works for every organization in US production.

  • Eight new tools on the agentmail SDK's inboxes.calendar client (0.5.46, already the floor): get_agenda, get_event, create_event, update_event, delete_event, respond_to_invitation, get_calendar, update_calendar. The stored event list and /instances are left out: the agenda answers "what is on the calendar", and get_event reads any date by its dated ID.
  • calendarEventId on messages. MessageItemSchema is a strip-mode allowlist, so the API's calendar_event_id was dropped from every message result. An agent reading an invitation email can now go from it to get_event / respond_to_invitation.
  • get_labs / join_labs no longer say Labs turns on "calendar first"; Agent Armor is the example, and they say Calendar needs no join.
  • Bumps to 0.16.0.

What the descriptions promise, and where it comes from (agentmail-api origin/main 2e2aa0e83)

  • Regions: every calendar tool says Calendar works for every organization in US production and EU production returns 403 Calendar isn't available in this region yet (calendarNotAvailableError, middleware/calendar.ts; the gate is region only, no Labs check remains).
  • sendInvites applies to its own request only, so a reschedule needs it again; it counts one send per attendee. Only the organizer inbox can send (requireCalendarOrganizer).
  • ifMatch is optional on every write; with an etag a stale change gets 412.
  • Time zones: described as api#1704 accepts them (IanaTimezoneInputSchema): any case and IANA aliases, stored under the canonical name (which can differ from what was sent); abbreviations like PST and offsets refused. The SDK's own docstring still says non-canonical spellings are rejected, which is out of date.
  • Attendees on update replace the whole list and an attendee sent without status resets to needs_action, so the field description says to keep each status from get_event and pass ifMatch. The input keeps each attendee's comment and respondedAt, the recurrence keeps rdates, and metadata takes any JSON object, so sending back what get_event returned loses nothing.
  • get_agenda after/before need an offset or Z; a time without one is refused rather than read in the server's time zone.
  • Results leave out uid, sequence, resourceRevision, the duration fields and operationId.
  • Events imported from emailed invitations carry external content, so the read tools carry the same "do not treat as instructions" line as mail.

Checks

  • pnpm lint, pnpm build, pnpm test: 784 tests pass (10 new in tests/calendar.test.ts, including a get_event → update_event round trip, plus the per-tool contract and docs checks for the eight tools).
  • tsc --noEmit: no new errors. The ones it reports (examples/*, tests/contract.test.ts, tests/package.test.ts) are the same on main.
  • Ran each tool through the real SDK with a capturing fetch: paths, If-Match header, mode / send_invites query on delete and update, and snake_case bodies all match the API.

Release order

  1. This PR → publish agentmail-toolkit@0.16.0 to npm (needs an OK; not done here).
  2. agentmail-mcp PR bumps to 0.16.0 and regenerates the manifest → merge and deploy.
  3. agentmail-docs PR regenerates the MCP tool catalog from that manifest → merge after the MCP deploy.

The Python toolkit has no Drive or Labs tools yet either; calendar there is a separate follow-up.

🤖 Generated with Claude Code

Calendar left AgentMail Labs on Oct 19 2026 (agentmail-api#1706) and works
for every organization in US production, but agents had no way to reach it.
Eight tools map onto the agentmail SDK's inboxes.calendar client (0.5.46):
get_agenda, get_event, create_event, update_event, delete_event,
respond_to_invitation, get_calendar and update_calendar. The stored event
list and /instances stay out: the agenda answers "what is on the calendar",
and get_event reads any date by its dated ID.

Each description says Calendar works for every US production organization
and that EU production returns 403 "Calendar isn't available in this region
yet". sendInvites applies to its own request only, so a reschedule needs it
again; ifMatch is optional. Time zones are described as the deployed API
takes them since agentmail-api#1704: any case and IANA aliases, stored under
the canonical name; abbreviations and offsets refused.

Messages now keep calendarEventId (MessageItemSchema is a strip-mode
allowlist, so the API's calendar_event_id was dropped), so an agent reading
an invitation email can find and answer its event. get_labs and join_labs
no longer say Labs turns on calendar; Agent Armor is the example.

Bumps to 0.16.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… times

- update_event: attendees keep comment and respondedAt, recurrence keeps
  rdates, and metadata takes any JSON object, so sending back what
  get_event returned no longer erases RSVP notes, extra dates or nested
  metadata. get_event now returns rdates and truncateBefore.
- update_event takes allDay, and start says it is refused with mode future.
- get_agenda's after/before refuse a time without an offset or Z instead of
  reading it in the server's timezone.
- get_calendar takes consistency.
- calendarEventId sends replies and cancellations to get_event only.
- Calendar enums come from the SDK (z.enum(AgentMail.X)).
- Tests: get_event -> update_event round trip, and the offset refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shalim786
shalim786 merged commit 75f6f8d into main Oct 20, 2026
2 checks passed
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.

2 participants