You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/tools/google-calendar.mdx
+46-28Lines changed: 46 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,14 @@
1
1
---
2
2
title: Google Calendar Integration
3
-
subtitle: 'Connect your assistant to Google Calendar for seamless appointment scheduling.'
3
+
subtitle: 'Connect your assistant to Google Calendar for seamless appointment scheduling and availability checking.'
4
4
slug: tools/google-calendar
5
5
---
6
6
7
-
The Google Calendar integration allows your Vapi assistant to create calendar events through voice commands. This enables your assistant to schedule appointments, meetings, and other calendar events directly during phone calls.
7
+
The Google Calendar integration allows your Vapi assistant to interact with Google Calendar in two ways:
8
+
1. Create calendar events through voice commands
9
+
2. Check calendar availability for scheduling
10
+
11
+
This enables your assistant to schedule appointments, meetings, and other calendar events directly during phone calls, as well as check when you're available for meetings.
8
12
9
13
## Prerequisites
10
14
@@ -26,7 +30,7 @@ First, you need to connect your Google Calendar account to Vapi:
26
30
5. Follow the prompts to authorize Vapi to access your Google Calendar
27
31
28
32
<Note>
29
-
The authorization process will request access to your Google Calendar to create and manage events.
33
+
The authorization process will request access to your Google Calendar to create events and check availability.
30
34
</Note>
31
35
32
36
<Framecaption="Connect Google Calendar">
@@ -36,64 +40,72 @@ First, you need to connect your Google Calendar account to Vapi:
36
40
/>
37
41
</Frame>
38
42
39
-
### 2. Create Calendar Tool
43
+
### 2. Create Calendar Tools
40
44
41
-
After connecting your Google Calendar account, create a new tool:
45
+
After connecting your Google Calendar account, create the tools:
42
46
43
47
1. Go to **Dashboard** > **Tools** page
44
48
2. Click the **Create Tool** button
45
49
3. Select **Google Calendar** from the available options
46
-
4. Provide a name for your tool
47
-
5. Add a description explaining when this tool should be invoked (e.g., "Use this tool when the user wants to schedule an appointment or create a calendar event")
50
+
4. Choose which tool(s) you want to create:
51
+
- Google Calendar Create Event Tool
52
+
- Google Calendar Check Availability Tool
53
+
5. For each tool, provide a name and description explaining when it should be invoked
48
54
49
55
<Note>
50
-
The description field is crucial as it helps the AI model understand when and how to use the tool. Be specific about the scenarios and conditions when the tool should be invoked.
56
+
The description field is crucial as it helps the AI model understand when and how to use each tool. Be specific about the scenarios and conditions when each tool should be invoked.
The Google Calendar tool uses the following fields to create events:
87
+
This tool uses the following fields to create events:
84
88
85
89
-`summary`: The title or description of the calendar event
86
90
-`startDateTime`: The start date and time of the event
87
91
-`endDateTime`: The end date and time of the event
88
92
-`timeZone`: The timezone for the event
89
93
94
+
### Google Calendar Check Availability Tool
95
+
96
+
This tool uses the following fields to check availability:
97
+
98
+
-`startDateTime`: The start of the time range to check
99
+
-`endDateTime`: The end of the time range to check
100
+
-`timeZone`: The timezone for the availability check
101
+
90
102
<Info>
91
103
All datetime fields should be provided in ISO 8601 format.
92
104
</Info>
93
105
94
106
## Example Usage
95
107
96
-
Here's how the tool can be used in your assistant's configuration:
108
+
Here's how the tools can be used in your assistant's configuration:
97
109
98
110
```json
99
111
{
@@ -103,14 +115,19 @@ Here's how the tool can be used in your assistant's configuration:
103
115
"messages": [
104
116
{
105
117
"role": "system",
106
-
"content": "You are a scheduling assistant. When users want to schedule an appointment, use the Google Calendar tool to create the event."
118
+
"content": "You are a scheduling assistant. When users want to schedule an appointment, first check their availability using the Check Availability tool, then use the Create Event tool to schedule the event if they're available.\n\n- Gather date and time range to check availability.\n- To book an appointment, gather the purpose of the appointment, ex: general checkup, dental cleaning and etc.\n\nNotes\n- Use the purpose as summary for booking appointment.\n- Current date: {{date}}\n- Current time: {{time}}"
107
119
}
108
120
],
109
121
"tools": [
122
+
{
123
+
"type": "google.calendar.availability.check",
124
+
"name": "checkAvailability",
125
+
"description": "Use this tool to check calendar availability and use the America/Los_Angeles as default timezone."
126
+
},
110
127
{
111
128
"type": "google.calendar.event.create",
112
129
"name": "scheduleAppointment",
113
-
"description": "Use this tool to schedule appointments and create calendar events"
130
+
"description": "Use this tool to schedule appointments and create calendar events. Notes: - Use America/Los_Angeles as default timezone - All appointments are 30 mins."
114
131
}
115
132
]
116
133
}
@@ -119,10 +136,11 @@ Here's how the tool can be used in your assistant's configuration:
119
136
120
137
## Best Practices
121
138
122
-
1.**Clear Instructions**: Provide clear instructions in your assistant's system message about when to use the calendar tool
123
-
2.**Error Handling**: Include fallback responses for cases where the calendar tool fails
124
-
3.**Time Zone Awareness**: Always specify the correct timezone for events
139
+
1.**Clear Instructions**: Provide clear instructions in your assistant's system message about when to use each calendar tool
140
+
2.**Error Handling**: Include fallback responses for cases where either calendar tool fails
141
+
3.**Time Zone Awareness**: Always specify the correct timezone for events and availability checks
125
142
4.**Event Details**: Ensure all required fields are properly filled when creating events
143
+
5.**Availability Flow**: Check availability before attempting to schedule events to avoid conflicts
subtitle: 'Connect your assistant to Google Sheets for seamless data entry.'
4
+
slug: tools/google-sheets
5
+
---
6
+
7
+
The Google Sheets integration allows your Vapi assistant to interact with Google Sheets in a simple way:
8
+
1. Add new rows to existing Google Sheets
9
+
10
+
This enables your assistant to record information and add data to spreadsheets directly during phone calls.
11
+
12
+
<Note>
13
+
The Google Sheets integration currently only supports adding new rows to spreadsheets. It does not support reading from or modifying existing data in the spreadsheet.
14
+
</Note>
15
+
16
+
## Prerequisites
17
+
18
+
Before you can use the Google Sheets integration, you need to:
19
+
1. Have a Google Sheets account
20
+
2. Have access to the Vapi Dashboard
21
+
3. Have an assistant created in Vapi
22
+
4. Have a Google Sheet created and ready to receive data
23
+
24
+
## Setup Steps
25
+
26
+
### 1. Connect Google Sheets Account
27
+
28
+
First, you need to connect your Google Sheets account to Vapi:
29
+
30
+
1. Navigate to the Vapi Dashboard
31
+
2. Go to **Providers Keys** > **Tools Provider** > **Google Sheets**
32
+
3. Click the **Connect** button
33
+
4. A Google authorization popup will appear
34
+
5. Follow the prompts to authorize Vapi to access your Google Sheets
35
+
36
+
<Note>
37
+
The authorization process will request access to your Google Sheets.
38
+
</Note>
39
+
40
+
### 2. Create and Configure Sheets Tool
41
+
42
+
After connecting your Google Sheets account, create and configure the tool:
43
+
44
+
1. Go to **Dashboard** > **Tools** page
45
+
2. Click the **Create Tool** button
46
+
3. Select **Google Sheets** from the available options
47
+
4. Choose the Google Sheets Add Row Tool
48
+
5. Provide a name and description explaining when it should be invoked
49
+
6. Configure the tool with the following required fields:
50
+
-`spreadsheetId`: The ID of your Google Sheet
51
+
-`range`: The sheet name or range (e.g., "Sheet1" or "Sheet1!A:Z")
52
+
53
+
<Note>
54
+
To find your spreadsheet ID:
55
+
1. Open your Google Sheet in a browser
56
+
2. Look at the URL: `https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit`
57
+
3. Copy the SPREADSHEET_ID portion (it's a long string of letters, numbers, and special characters)
58
+
</Note>
59
+
60
+
<Note>
61
+
The description field is crucial as it helps the AI model understand when and how to use the tool. Be specific about the scenarios and conditions when the tool should be invoked.
62
+
</Note>
63
+
64
+
### 3. Add Tool to Assistant
65
+
66
+
Now, add the Google Sheets tool to your assistant:
67
+
68
+
1. Navigate to **Dashboard** > **Assistants** page
69
+
2. Select your assistant
70
+
3. Go to the **Tools** tab
71
+
4. In the tools dropdown, select the Google Sheets tool
72
+
5. Click **Publish** to save your changes
73
+
74
+
## Tool Configuration
75
+
76
+
### Google Sheets Add Row Tool
77
+
78
+
This tool uses the following fields to add data to your spreadsheet:
79
+
80
+
-`spreadsheetId`: The ID of your Google Sheet (found in the sheet's URL)
81
+
-`range`: The range where the data should be added (e.g., "Sheet1" or "Sheet1!A:Z")
82
+
-`values`: An array of values to be added as a new row
83
+
84
+
<Note>
85
+
The range field can be specified in two ways:
86
+
1. Just the sheet name (e.g., "Sheet1") - This will append to the next empty row
87
+
2. Sheet name with range (e.g., "Sheet1!A:Z") - This will append to the specified range
88
+
</Note>
89
+
90
+
## Example Usage
91
+
92
+
Here's how the tool can be used in your assistant's configuration:
93
+
94
+
```json
95
+
{
96
+
"model": {
97
+
"provider": "openai",
98
+
"model": "gpt-4",
99
+
"messages": [
100
+
{
101
+
"role": "system",
102
+
"content": "You are a customer feedback assistant. After each customer service call, collect feedback using the following process:\n\n1. Ask the customer if they would like to provide feedback\n2. If yes, ask for their rating (1-5 stars)\n3. Ask for specific comments about their experience\n4. Ask for any suggestions for improvement\n5. Confirm the feedback before adding it to the spreadsheet\n\nUse the Add Row tool to record the feedback with the following columns:\n- Timestamp\n- Rating (1-5)\n- Comments\n- Suggestions\n\nAlways be polite and thank the customer for their feedback."
103
+
}
104
+
],
105
+
"tools": [
106
+
{
107
+
"type": "google.sheets.row.append",
108
+
"name": "addFeedback",
109
+
"description": "Use this tool to add customer feedback to the feedback spreadsheet. Collect all required information (rating, comments, suggestions) before adding the row."
110
+
}
111
+
]
112
+
}
113
+
}
114
+
```
115
+
116
+
## Best Practices
117
+
118
+
1.**Data Validation**: Ensure all data is properly formatted before adding to the spreadsheet
119
+
2.**Error Handling**: Include fallback responses for cases where the tool fails
120
+
3.**User Confirmation**: Always confirm with the user before adding data to the spreadsheet
121
+
4.**Sheet Structure**: Be aware of the spreadsheet's structure and column requirements
122
+
123
+
<CardGroupcols={2}>
124
+
<Card
125
+
title="Need Help?"
126
+
icon="question-circle"
127
+
href="https://discord.gg/pUFNcf2WmH"
128
+
>
129
+
Join our Discord community for support with Google Sheets integration
0 commit comments