> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Google Calendar

## 概要

ElevenLabs AIエージェントを[Google Calendar](https://calendar.google.com)と連携し、スケジュールやカレンダーの予定を管理できます。このインテグレーションにより、自然な会話を通じて、エージェントは空き状況の確認、参加者や任意のGoogle Meet会議を含む予定の作成・更新・削除、今後の予定の一覧表示、アクセス可能なカレンダーの検索を行えます。

## 機能

| 機能           | 対応状況                   |
| ------------ | ---------------------- |
| ゼロ保持モード（ZRM） | 非対応                    |
| ツール内の添付ファイル  | 非対応 — ツールはテキストのみを処理します |

## セキュリティに関する警告

> **セキュリティに関する警告：`google_calendar_update_event`と`google_calendar_delete_event`は特権ツールです。** これらは、エージェントが作成した予定だけでなく、接続されたGoogleアカウントのカレンダーへのフルアクセス権で実行されます。エージェントと会話できる人は誰でも、そのカレンダー上の**あらゆる**予定を変更またはキャンセルできます。これは、`google_calendar_list_events`でイベントIDを検索できるためで、作成者本人でない予定も対象です。システムプロンプトでの確認はモデルへのヒントであり、セキュリティ制御ではありません。
>
> これらのツールは、**認証を有効にした**エージェント、または信頼できるソースからイベントIDを取得する場合にのみ有効にしてください。公開エージェントには追加しないでください。予定が更新または削除されると、参加者には常に通知されます。

## セットアップ

このインテグレーションでは、認証に**Google OAuth 2.0**を使用します。Google CalendarへのアクセスをElevenLabsに許可します。

#### ElevenLabsで「Connect」をクリック

ElevenLabsのインテグレーション設定で、**Connect**をクリックします。Googleにリダイレクトされ、アクセスを許可します。

#### Googleアカウントを選択

エージェントにアクセスさせるカレンダーデータのGoogleアカウントを選択します。ブラウザで複数のGoogleアカウントにログインしている場合は、正しいアカウントを選択してください。

#### カレンダーへのアクセスを許可

リクエストされた権限を確認し、**Allow**をクリックします。このインテグレーションでは、自分が所有するカレンダー上の予定管理、カレンダーリストの表示、空き時間／予定あり情報の確認へのアクセスをリクエストします。

## OAuthスコープ

このインテグレーションは、次のGoogle OAuth 2.0スコープをリクエストします。

| スコープ                             | 目的                                     |
| -------------------------------- | -------------------------------------- |
| `calendar.events.owned`          | 自分が所有するカレンダー上の予定を作成、読み取り、更新、削除します。     |
| `calendar.calendarlist.readonly` | アカウントがアクセスできるカレンダーの一覧（名前とID）を表示します。    |
| `calendar.freebusy`              | 予定の詳細を公開せずに、カレンダー全体の空き時間／予定あり状況を確認します。 |

## 仕組み

エージェントは、ツール呼び出しを使用して予約プロセスを段階的に進め、会議をスケジュールします。以下のタブでは、概要と詳細なシステムプロンプトを確認できます。

#### 概要

#### カレンダーを検索

エージェントは、スケジュール設定に使用する適切なカレンダーを特定するため、アクセス可能なカレンダーを一覧表示します。ほとんどのユーザーでは、メインのカレンダーが対象です。

#### 空き状況を確認

エージェントは、次の方法で空き時間／予定あり状況を確認します。

* `google_calendar_check_availability`ツールを使用して、予定ありの時間帯を照会します。
* リクエストされた時間が空いているかを確認します。
* リクエストされた時間が既存の予定と重複する場合は、代替案を提示します。
* 選択した時間を発信者に確認します。

#### 参加者情報を収集

時間が合意された後、エージェントは次を行います。

* 参加者の氏名とメールアドレスを収集します。
* メールアドレスを発信者に読み上げて確認します。
* タイムゾーン情報を確認します。

#### 予定を作成

エージェントは次を行います。

* 確認済みの詳細情報を使用して`google_calendar_create_event`ツールを呼び出します。
* ビデオ会議がリクエストされた場合は、必要に応じてGoogle Meetリンクを追加します。
* 予定の作成を確認し、参加者にカレンダー招待が届くことを伝えます。

#### 詳細なシステムプロンプト

```
You are a helpful scheduling assistant responsible for managing calendar bookings using Google Calendar. Be friendly, precise, and concise.

Begin by briefly asking for the purpose of the meeting and the caller's preferred date and time.
Then, ask about the desired meeting duration (15, 30, or 60 minutes), and wait for the user's response before proceeding.

Once you have the meeting details, check calendar availability:
- Call google_calendar_check_availability with the appropriate time range and calendar ID (use 'primary' for the main calendar)
- The tool returns busy time blocks — any time not listed as busy is available
- If the requested time overlaps with a busy block, suggest alternative times
- Continue until a suitable time is agreed upon

After confirming a time slot, gather the following contact details:
- The attendee's full name
- A valid email address. Note that the email address is transcribed from voice, so ensure it is formatted correctly.
- The attendee's time zone (in 'Continent/City' format like 'America/New_York')
- Read the email back to the caller to confirm accuracy

Once all details are confirmed, create the event:
- Call google_calendar_create_event with calendarId set to 'primary'
- Set summary to a descriptive meeting title
- Set start and end times in RFC 3339 format with the attendee's time zone
- Add the attendee's email to the attendees array
- If the caller requests a video call, include conferenceData with conferenceSolutionKey type 'hangoutsMeet' and set the conferenceDataVersion query parameter to 1
- Set sendUpdates to 'all' so attendees receive calendar invitations

Thank the attendee and inform them they will receive a calendar invitation shortly.

Clarifications:
- Do not inform the user that you are formatting the email; do it silently.
- If the caller asks you to proceed with booking, do so with the existing information.
- Use google_calendar_list_calendars if the caller asks to schedule on a specific calendar other than their primary one.
- Use google_calendar_list_events if the caller asks what meetings they have coming up, or to find the event ID before changing or cancelling a meeting.
- Use google_calendar_update_event to reschedule or edit an existing event. Check availability for the new time first, and confirm the change with the caller.
- Use google_calendar_delete_event to cancel an event only after the caller has explicitly confirmed which event to cancel. For recurring events, confirm whether to cancel one occurrence or the whole series: list events with singleEvents=true and use the occurrence's ID for one occurrence, or its recurringEventId for the whole series.

Guardrails:
- Do not share any internal IDs or API details with the caller.
- If event creation fails, check for formatting issues in the email or time conflicts.
```

## エージェントツール

エージェントにGoogle Calendarツールを追加すると、次の組み込みツールを利用できます。

| ツール                                  | 説明                                                                                                                         |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| `google_calendar_check_availability` | 指定した時間範囲内で、1つ以上のカレンダーの空き時間／予定あり状況を確認します。エージェントが空いている時間枠を見つけられるよう、予定ありの時間帯を返します。競合を避けるため、予定を作成する前に使用してください。                 |
| `google_calendar_create_event`       | 参加者、場所、Google Meet会議を任意で含めて、Google Calendarに新しい予定を作成します。すべての参加者にメール通知を送信します。                                               |
| `google_calendar_list_events`        | 時間範囲内の今後の予定をカレンダーから一覧表示し、開始時刻順に並べます。予定の概要、説明、場所、参加者の詳細を対象としたフリーテキスト検索に対応しています。                                             |
| `google_calendar_update_event`       | **特権。** カレンダー上の任意の予定を更新します。たとえば、予定の変更や、タイトル、場所、参加者の変更が可能です。指定したフィールドのみが変更されます。参加者には通知されます。                                 |
| `google_calendar_delete_event`       | **特権。** カレンダー上の任意の予定を削除し、すべての参加者の予定をキャンセルします。まず予定を一覧表示してイベントIDを確認してください。繰り返し予定では、各予定のID、またはrecurringEventId（シリーズ全体）を使用します。 |
| `google_calendar_list_calendars`     | 接続されたGoogleアカウントがアクセスできるすべてのカレンダーを一覧表示します。カレンダー名とIDを返します。空き状況の確認や予定の作成前に、対象のカレンダーを特定するために使用してください。                         |

## 便利なリンク

* [Google Calendar APIドキュメント](https://developers.google.com/calendar/api/v3/reference)
* [Calendar用Google OAuth 2.0スコープ](https://developers.google.com/identity/protocols/oauth2/scopes#calendar)
* [Google Calendar APIクイックスタート](https://developers.google.com/calendar/api/quickstart/python)
* [ElevenLabsツールの概要](/docs/ja/eleven-agents/customization/tools/server-tools)