Skip to main content

Google Calendar

List, create, get, and delete events on Google Calendar. Uses the same OAuth2 pattern as the Gmail toolkit.
Requires: npm install googleapis

Quick Start

import { Agent, openai, GoogleCalendarToolkit } from "@radaros/core";

const calendar = new GoogleCalendarToolkit({
  credentialsPath: "./credentials.json",
  tokenPath: "./token.json",
});

const agent = new Agent({
  name: "scheduler",
  model: openai("gpt-4o"),
  instructions: "Help manage the user's calendar. Schedule and look up events.",
  tools: [...calendar.getTools()],
});

const result = await agent.run("What meetings do I have today?");

Config

credentialsPath
string
Path to OAuth2 credentials JSON. Falls back to GOOGLE_CALENDAR_CREDENTIALS_PATH env var.
tokenPath
string
Path to saved token JSON. Falls back to GOOGLE_CALENDAR_TOKEN_PATH env var.
authClient
any
Pre-authenticated OAuth2 client (if you handle auth yourself).
calendarId
string
default:"primary"
Calendar ID to operate on.

Tools

ToolDescription
calendar_list_eventsList upcoming events. Supports time range filters.
calendar_create_eventCreate a new event with title, time, location, description, and attendees.
calendar_get_eventGet details of a specific event by ID.
calendar_delete_eventDelete an event by ID.

Environment Variables

export GOOGLE_CALENDAR_CREDENTIALS_PATH="./credentials.json"
export GOOGLE_CALENDAR_TOKEN_PATH="./token.json"
See the Gmail toolkit setup guide for OAuth2 credential instructions — the process is identical.