> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Calendar

> Query events, check availability, and create meetings.

Query events, check availability, and create meetings. By default, exposes `query_calendar` for reading. Enable `write=True` to also expose `update_calendar` for creating and modifying events.

```python theme={null}
from agno.agent import Agent
from agno.context.calendar import GoogleCalendarContextProvider

calendar = GoogleCalendarContextProvider()

agent = Agent(
    model=...,
    tools=calendar.get_tools(),
)

await agent.aprint_response("What meetings do I have tomorrow?")
```

## Authentication

Same as Gmail - OAuth or service account.

> [tab] OAuth (Personal)
>
> ```shell theme={null}
> export GOOGLE_CLIENT_ID=...
> export GOOGLE_CLIENT_SECRET=...
> export GOOGLE_PROJECT_ID=...
> ```
>
> Token cached to `calendar_token.json`.

> [tab] Service Account
>
> ```shell theme={null}
> export GOOGLE_SERVICE_ACCOUNT_FILE=/path/to/service-account.json
> export GOOGLE_DELEGATED_USER=user@domain.com  # Optional
> ```
>
> Without `delegated_user`, operates on the service account's own calendar.

## Configuration

| Parameter | Type | Default | Description |
| - | - | - | - |
| `id` | `str` | `"calendar"` | Tools become `query_<id>` and `update_<id>`. |
| `calendar_id` | `str` | `"primary"` | Calendar to query and modify. Set to a shared or team calendar ID instead of the caller's own calendar. |
| `model` | `Model` | `None` | Model for sub-agents. |
| `read` | `bool` | `True` | Expose `query_calendar`. |
| `write` | `bool` | `False` | Expose `update_calendar`. Disabled by default for safety. |
| `mode` | `ContextMode` | `default` | See [Mode](https://agno-v2.mintlify.site/context-providers/overview.md#mode). |

## Tools Exposed

| Tool | Description |
| - | - |
| `query_calendar` | List events, search events, check availability, find free slots. Exposed when `read=True` (default). |
| `update_calendar` | Create events, update events, delete events. Requires `write=True`. |

## Example queries

| Query | What happens |
| - | - |
| "What's on my calendar this week?" | Lists events with time range |
| "When am I free on Friday afternoon?" | Checks availability |
| "Find all meetings about the product launch" | Searches event titles/descriptions |
| "Schedule a 30-min sync with Alice tomorrow at 2pm" | Creates event (requires `write=True`) |

## Resources

> [card] [GoogleCalendarTools Reference](https://agno-v2.mintlify.site/tools/toolkits/others/googlecalendar.md)
>
> All methods and OAuth setup

> [card] [Cookbook Example](https://github.com/agno-agi/agno/blob/main/cookbook/12_context/19_calendar.py)
>
> Working example


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.