Skip to content
Skip to main content

Share your calendar with your agent

Give your agent full access to the calendar you already use — a personal Google Calendar, a work Outlook calendar, or any Exchange/iCloud calendar. Events the agent creates appear on your calendar, and invites come to your address. The Nylas CLI handles provider auth and returns structured JSON so your agent can drive every operation from shell commands.

If you’d rather the agent have its own dedicated calendar (for events it hosts or manages on its own), see Give your agent its own calendar.

Make sure the CLI is installed and authenticated against the account whose calendar you want to share. If not, follow the AI agents quickstart first.

nylas auth whoami --json

See what’s on the user’s calendar. The --days flag controls the lookahead window.

nylas calendar events list --days 7 --json

View details for a specific event:

nylas calendar events show <EVENT_ID> --json

Schedule a meeting with participants. The CLI handles timezone conversion and sends invitations automatically.

nylas calendar events create \
--title "Project kickoff" \
--start "2026-04-15T10:00:00" \
--end "2026-04-15T11:00:00" \
--description "Review goals and assign workstreams"

Natural language scheduling:

nylas calendar schedule ai "30 minute sync with [email protected] next Tuesday afternoon"

Before scheduling, check when participants are free. This queries across multiple users’ calendars and returns open slots.

nylas calendar find-time \
--duration 30m \
--json
# Update an event
nylas calendar events update <EVENT_ID> \
--title "Updated: Project kickoff" \
--start "2026-04-15T14:00:00" \
--end "2026-04-15T15:00:00"
# Delete an event
nylas calendar events delete <EVENT_ID> --yes

Each user can have multiple calendars. List them to find the right one for event operations.

nylas calendar list --json

Here’s a realistic pattern for an agent that handles meeting requests:

# 1. Check the user's schedule for next week
nylas calendar events list --days 7 --json
# 2. Find a time that works for all participants
nylas calendar find-time \
--duration 60m \
--json
# 3. (Agent picks the best slot based on preferences)
# 4. Create the meeting
nylas calendar events create \
--title "Q3 planning" \
--start "2026-04-16T10:00:00" \
--end "2026-04-16T11:00:00" \
--description "Quarterly planning session"
# 5. Confirm via email
nylas email send \
--subject "Meeting scheduled: Q3 planning" \
--body "I've scheduled Q3 planning for April 16 at 10am. Calendar invite sent." \
--yes

If your agent supports Model Context Protocol (Claude Code, Cursor, Windsurf, VS Code, Codex CLI), register the CLI as an MCP server for typed calendar tools:

nylas mcp install --assistant claude-code

See the MCP docs for details.