---
name: calendar
description: "Interact with Google Calendar. Create events, list upcoming events, and check availability."
---

# Calendar Skill

Use the `calendar` tool to interact with Google Calendar.

## Setup

1. Enable Google Calendar API in Google Cloud Console
2. Create OAuth2 credentials (Desktop app)
3. Download credentials JSON file
4. Configure in nanobot:
   ```bash
   export NANOBOT_TOOLS__CALENDAR__ENABLED=true
   export NANOBOT_TOOLS__CALENDAR__CREDENTIALS_FILE=/path/to/credentials.json
   ```

On first run, you'll be prompted to authorize access via OAuth flow.

## Actions

### List Events

List upcoming calendar events:
```
calendar(action="list_events", max_results=10)
```

### Create Event

Create a new calendar event:
```
calendar(
    action="create_event",
    title="Team Meeting",
    start_time="2024-01-15T14:00:00",
    end_time="2024-01-15T15:00:00",
    description="Discuss project progress",
    location="Conference Room A",
    attendees=["colleague@example.com"]
)
```

**Time formats:**
- ISO format: `"2024-01-15T14:00:00"`
- Relative: `"tomorrow 2pm"`, `"in 1 hour"`, `"in 2 days"`

### Check Availability

Check if a time slot is available:
```
calendar(
    action="check_availability",
    start_time="2024-01-15T14:00:00",
    end_time="2024-01-15T15:00:00"
)
```

## Email Integration

When an email mentions a meeting (e.g., "meeting tomorrow at 2pm"), the agent can automatically:
1. Parse the email to extract meeting details
2. Create a calendar event using `create_event`
3. Confirm the event was created

Enable automatic scheduling:
```bash
export NANOBOT_TOOLS__CALENDAR__AUTO_SCHEDULE_FROM_EMAIL=true
```

