Skip to main content
Google Calendar is a product of Google Workspace that allows users to organize their schedules and events. It is a cloud-based calendar that allows users to create, edit, and delete events. It also allows users to share their calendars with others.

Overview

This notebook will help you get started with the Google Calendar Toolkit. This toolkit interacts with the Google Calendar API to perform various operations on the calendar. It allows you to:
  • Create events.
  • Search events.
  • Update events.
  • Move events between different calendars.
  • Delete events.
  • List events.

Setup

To use this toolkit, you will need to:
  1. Have a Google account with access to Google Calendar.
  2. Set up your credentials as explained in the Google Calendar API docs. Once you’ve downloaded the credentials.json file, you can start using the Google Calendar API.
To enable automated tracing of individual tools, set your LangSmith API key:

Installation

This toolkit lives in the langchain-google-community package of the langchain-google repository. We’ll need the calendar extra:

Instantiation

By default the toolkit reads the local credentials.json file. You can also manually provide a Credentials object.

Customizing authentication

Behind the scenes, a googleapi resource is created using the following methods. you can manually build a googleapi resource for more auth control.

Tools

View available tools:

Invocation

Invoke directly with args

You can invoke the tool directly by passing the required arguments in a dictionary format. Here is an example of creating a new event using the CalendarCreateEvent tool.

Use within an agent

Below we show how to incorporate the toolkit into an agent. We will need an LLM or chat model:

API reference