Skip to main content
Enable Agno agents to list, create, update, and delete Google Calendar events and find free time slots.
  • Availability intelligence
  • Dynamic scheduling
  • Contextual invitations
  • Timezone and conflict management

Prerequisites

  1. Enable Google Calendar API - Go To https://console.cloud.google.com/apis/enableflow?apiid=calendar-json.googleapis.com
  2. Select Project and enable the API access (Reference : https://developers.google.com/calendar/api/quickstart/python)
  3. (Click for details)
    1. Enable Google Calendar API
    2. Go To API & Service -> OAuth Consent Screen
    3. Select User Type
      • If you are Google Workspace User select Internal
      • Else Select External
    4. Fill in the app details (App name, logo, support email, etc.).
    5. Select Scope
      • Click on Add or Remove Scope
      • Search for Google Calendar API (Make sure you’ve enabled Google Calendar API. Otherwise, the scopes will not be visible)
      • Select Scopes Accordingly
      • From the dropdown check on /auth/calendar scope
      • Save and Continue
    6. Adding Test User
      • Click Add Users and enter the email addresses of the users you want to allow during testing.
      • NOTE : Only these users can access the app’s OAuth functionality when the app is in “Testing” mode. If anyone else tries to authenticate, they’ll see an error like: “Error 403: access_denied.”
      • To make the app available to all users, you’ll need to move the app’s status to “In Production.”.Before doing so, ensure the app is fully verified by Google if it uses sensitive or restricted scopes.
      • Click on Go back to Dashboard
    7. Generate OAuth 2.0 Client ID
      • Go To Credentials
      • Click on Create Credentials -> OAuth Client ID
      • Select Application Type as Desktop app
      • Download JSON
    8. Using Google Calendar Tool pass the path of downloaded credentials as credentials_path to Google Calendar tool

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run the example

Save the code above as googlecalendar_tools.py, then run:
Full source: cookbook/91_tools/googlecalendar_tools.py