> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Workspace

> MCP servers for Google Calendar, Gmail, Drive, Docs, Sheets, Slides, and Forms

> [!NOTE]
>
> **Built by Runlayer.** Runlayer builds and maintains this connector. It runs
> on Runlayer Deploy, which must be enabled for your workspace.

Connect your AI assistant to [Google Workspace](https://workspace.google.com) services. All Google servers share the same **Google OAuth** setup process.

| Server | Description |
| - | - |
| Google Calendar | Manage events, calendars, and schedules |
| Gmail | Read, search, send emails, and manage labels |
| Google Drive | Browse, search, and manage files and folders |
| Google Docs | Create, read, and edit documents |
| Google Sheets | Create and manage spreadsheets |
| Google Slides | Create and edit presentations |
| Google Forms | Create, edit, and manage forms; access forms and their responses |

## Available Tools

### Google Calendar

| Tool | Description |
| - | - |
| `list_calendars` | List all accessible calendars |
| `list_events` | List events with date filtering |
| `get_event` | Get event details, including whether you organize it and its guest permissions |
| `create_event` | Create an event with attendees (required or optional), visibility, guest permissions, recurrence, and an optional Google Meet link |
| `quick_add` | Create event from natural language |
| `update_event` | Modify an event, including attendees, visibility, and guest permissions, or add a Google Meet link |
| `respond_to_event` | Respond to an invitation (accept, decline, or tentative) |
| `delete_event` | Remove an event |
| `move_event` | Move event to different calendar |
| `create_calendar` | Create a new calendar |
| `update_calendar` | Modify calendar settings |
| `delete_calendar` | Remove a calendar |
| `get_free_busy` | Check availability |

Set `add_google_meet: true` on `create_event` or `update_event` to add Google Meet. The response returns the join link when ready. If Meet creation is still pending or fails, the event remains saved and the response includes a warning; use `get_event` to check a pending link, or retry a failed Meet request with `update_event` on the same event. Existing Meet links are preserved. Omitting the flag or passing `false` leaves conference details unchanged. This option does not replace other conference providers. The calendar must support Google Meet.

`create_event` and `update_event` accept `guests_can_modify`, `guests_can_invite_others`, and `guests_can_see_other_guests` to set Google's guest permissions. An explicit `false` is sent.

`update_event` on an event you don't organize changes nothing unless you pass `edit_as_guest: true`. With it, the change is saved on the organizer's calendar so everyone on the event sees it. This only works when the organizer lets guests modify the event; otherwise the call is refused and names the organizer. To respond to an invitation, use `respond_to_event`.

### Gmail

| Tool | Description |
| - | - |
| `search` | Search emails using Gmail operators |
| `list_messages` | List recent messages |
| `fetch_message` | Get full email content (includes attachment metadata) |
| `fetch_attachment` | Download a message attachment as text or base64 |
| `send_email` | Send a new email (supports attachments) |
| `reply_to_message` | Reply to an email thread (supports attachments) |
| `create_draft` | Create a draft (supports attachments) |
| `send_draft` | Send an existing draft |
| `list_drafts` | List all drafts |
| `list_labels` | List all labels |
| `add_labels` | Add labels to messages |
| `remove_labels` | Remove labels from messages |
| `create_label` | Create a new label |
| `mark_as_read` | Mark messages as read |
| `mark_as_unread` | Mark messages as unread |
| `archive_messages` | Archive messages |

### Google Drive

| Tool | Description |
| - | - |
| `search` | Search files by name or content; name matches ranked first |
| `list_folder` | List folder contents |
| `get_metadata` | Get file/folder metadata |
| `update_metadata` | Update a file/folder's description and custom properties |
| `fetch_file` | Read file content, including extracted PDF text by default (1 MB cap; set `allow_large_file` to read up to 10 MB) |
| `create_file` | Create a new file |
| `create_folder` | Create a new folder |
| `create_doc_from_markdown` | Create Google Doc from Markdown |
| `update_file` | Update file content |
| `update_doc_from_markdown` | Update Google Doc from Markdown |
| `rename_file` | Rename a file or folder |
| `copy_file` | Copy a file |
| `move_file` | Move a file |
| `delete_file` | Move file to trash |
| `share_file` | Share a file |
| `list_permissions` | List sharing permissions |

For PDFs, `fetch_file` defaults to `format: "auto"` and returns readable text, capped at 100,000 characters including any truncation marker. The response reports `truncated` and extraction details: status (`text_extracted`, `partial`, or `ocr_required`), page counts, pages without text, and a warning. Parsing has a 30-second deadline. Scans and images are not read because OCR is disabled; blank pages also count as pages without text. Layout, tables, and reading order may not be preserved.

Use `format: "raw"` only when you need exact PDF bytes. It returns base64, roughly 1.4 times the file size in characters, all of which consumes model context. Both formats retain the 1 MB default download limit and the 10 MB ceiling when `allow_large_file: true`; the 100,000-character output cap applies to extracted text only. Here, 1 MB means 1,048,576 bytes.

Existing Google Drive connectors need to be redeployed to receive PDF text extraction.

### Google Docs

| Tool | Description |
| - | - |
| `search` | Search for documents |
| `fetch` | Get text across tabs, with optional native structure and formatting via `include_structure` |
| `create_file` | Create a new document from markdown or HTML |
| `copy_document` | Copy a native template with styles, tables, lists, tabs, headers and footers preserved |
| `replace_file_content` | Overwrite a document's entire content |
| `insert_text` | Insert text at position |
| `replace_text` | Find and replace text |
| `delete_text` | Find and delete text |
| `delete_between_text` | Delete a whole block (a heading and everything under it, tables included) by naming the text at each end |
| `apply_doc_updates` | Apply raw Google Docs API requests in one batch |
| `format_text` | Find text and apply character formatting (bold, color, font, etc.) |
| `format_paragraphs` | Find text and apply paragraph styling (heading, alignment, indent, line & paragraph spacing, bullet and numbered lists) |
| `link_text` | Find text and turn it into a hyperlink |
| `get_table` | Read a table's row/column counts, index ranges, and cell text without changing the document |
| `edit_table` | Edit a table (insert/delete rows & columns, set cell text, overwrite a whole row, write many cells at once, column width, cell styling including padding, delete the table), located by index or text |
| `insert_break` | Insert a page or section break |
| `add_comment` | Anchor a native comment to a UTF-16 text range, optionally targeting a tab or header/footer segment |
| `list_comments` | Read native comment threads, replies, anchor ranges and quoted text |
| `resolve_comment` | Resolve a comment |
| `list_tabs` | List document tabs |
| `fetch_tab` | Get content of a tab |
| `fetch_all_tabs` | Get all tab contents |

For template-based generation, use `copy_document`, fill placeholders with `replace_text` or
`apply_doc_updates`, then use `fetch` with `include_structure: true` to inspect the native
formatting. Styles may inherit from named styles and defaults; structured data does not verify
rendered pagination. Avoid replacing the whole document body when preserving template formatting.

Native comments use the Google Docs API to attach to text. Pass the native UTF-16 indices from
`fetch.include_structure` as `docStartIndex` and `docEndIndex` to `add_comment`; legacy
`startIndex` and `endIndex` inputs are rejected to prevent misplaced anchors. Comment creation may
notify collaborators.
After an ambiguous copy or comment-write failure, read back the result before retrying to avoid duplicates.
Comment pagination tokens from the previous Drive-based implementation must be discarded.
The documented Google Docs API does not expose native checklist checked/unchecked state.
Existing Google Docs connectors need to be redeployed to receive these capabilities.

### Google Sheets

| Tool | Description |
| - | - |
| `search` | Search for spreadsheets |
| `list` | List spreadsheets |
| `fetch` | Get spreadsheet data (values or underlying formulas) |
| `create` | Create a new spreadsheet |
| `update` | Update cell values |
| `update_ranges` | Update multiple ranges in a single call |
| `append` | Append rows |
| `insert_rows` | Insert blank rows mid-sheet, shifting existing rows down |
| `delete_rows` | Delete rows, shifting rows below up |
| `clear` | Clear values in a range, keeping rows and formatting |
| `add_sheet` | Add a new sheet tab |
| `get_metadata` | Get spreadsheet metadata |
| `set_row_visibility` | Hide or unhide rows |
| `group_rows` | Group rows (optionally collapsed) |
| `ungroup_rows` | Remove a row group |
| `autofill` | Extend a formula/series across a range |
| `format_cells` | Apply cell formatting (number format, font, color, alignment, wrap) |
| `set_column_width` | Set column width in pixels, or fit to contents |
| `set_row_height` | Set row height in pixels, or fit to contents |
| `create_filter` | Turn on filtering over a range so rows can be sorted and filtered |
| `clear_filter` | Remove a sheet's filter |

### Google Slides

| Tool | Description |
| - | - |
| `search` | Search presentations by name or content; name matches ranked first |
| `fetch` | Get presentation content |
| `list_slides` | List all slides |
| `get_slide` | Get slide details |
| `list_layouts` | List available layouts |
| `create` | Create a presentation |
| `create_from_markdown` | Create slides from Markdown |
| `create_from_template` | Copy a themed template deck (optionally clearing sample slides) |
| `duplicate` | Duplicate a presentation |
| `add_slide` | Add a new slide |
| `delete_slide` | Remove a slide |
| `duplicate_slide` | Duplicate a slide |
| `reorder_slide` | Change slide order |
| `add_text` | Add a text box |
| `update_text` | Modify text in a shape |
| `add_shape` | Add a shape |
| `add_image` | Insert an image |
| `add_table` | Insert a table |
| `add_line` | Add a line |
| `delete_element` | Remove an element |
| `style_text` | Apply text formatting |
| `set_paragraph_style` | Set paragraph alignment |
| `style_shape_advanced` | Apply shape styling |
| `set_slide_background` | Change background |
| `set_speaker_notes` | Add speaker notes |

### Google Forms

| Tool | Description |
| - | - |
| `search` | Search for forms |
| `list` | List all forms |
| `get` | Get form structure and questions |
| `responses` | Get form responses |
| `create` | Create a new form (title only; add content with `batch_update`) |
| `batch_update` | Add, edit, reorder, or delete questions/items; update form info or settings |

## Setup

**1. Create Google Cloud Project**

1. Go to [Google Cloud Console](https://console.cloud.google.com)
2. Create a new project or select an existing one

**2. Enable APIs**

Go to **APIs & Services** > **Library** and enable the APIs you need:

* Google Calendar API
* Gmail API
* Google Drive API
* Google Docs API
* Google Sheets API
* Google Slides API
* Google Forms API

**3. Configure OAuth Consent Screen**

1. Go to **APIs & Services** > **OAuth consent screen**
2. Select **External** or **Internal**
3. Fill in app name, support email, and developer contact
4. Add required scopes (see below)
5. Add test users if using External mode

**4. Create OAuth Credentials**

1. Go to **APIs & Services** > **Credentials**
2. Click **Create Credentials** > **OAuth client ID**
3. Select **Web application**
4. Add redirect URI: `https://<your-tenant>.runlayer.com/oauth/callback`
5. Copy the **Client ID** and **Client Secret**

**5. Add Server in Runlayer**

1. In Runlayer, go to **Connectors**, select a Google service, and click **Add connector**
2. Check **Custom OAuth credentials**
3. Enter your **Client ID** and **Client Secret**
4. Click **Deploy Server**

> [!NOTE]
>
> If you have the **Manage security policies** capability, Gmail and Google Calendar open **Recommended security settings** on the connector page after deploy. Review the per-tool overrides, then click **Apply**.

**6. Authorize**

1. Click **Connect** on the server page
2. Sign in with Google and grant permissions

## OAuth Scopes

Add these scopes when configuring OAuth consent:

| Service | Scopes |
| - | - |
| Calendar | `https://www.googleapis.com/auth/calendar.events`, `https://www.googleapis.com/auth/calendar.calendars`, `https://www.googleapis.com/auth/calendar.calendarlist.readonly`, `https://www.googleapis.com/auth/calendar.freebusy` |
| Gmail | `https://www.googleapis.com/auth/gmail.readonly`, `https://www.googleapis.com/auth/gmail.send`, `https://www.googleapis.com/auth/gmail.modify` |
| Drive | `https://www.googleapis.com/auth/drive` |
| Docs | `https://www.googleapis.com/auth/drive`, `https://www.googleapis.com/auth/documents` |
| Sheets | `https://www.googleapis.com/auth/drive.metadata.readonly`, `https://www.googleapis.com/auth/spreadsheets` |
| Slides | `https://www.googleapis.com/auth/drive`, `https://www.googleapis.com/auth/presentations` |
| Forms | `https://www.googleapis.com/auth/drive.metadata.readonly`, `https://www.googleapis.com/auth/forms.body`, `https://www.googleapis.com/auth/forms.responses.readonly` |

All connectors additionally request `openid` and `https://www.googleapis.com/auth/userinfo.email` for user identity.

## Changing scopes on an existing connector

When a connector's scopes change (for example, Google Forms moving from read-only access to read and write, so it can create and edit forms), an already-deployed connector needs these steps in this order:

**1. Add the new scope to your OAuth consent screen (External apps only)**

If your app's user type is **External**, add the new scope(s) in **APIs & Services** > **OAuth consent screen** so users can consent to them. **Internal** (Google Workspace) apps can request any scope without listing it here, so you can skip this step. You can remove any scope the new one supersedes (e.g. `forms.body` covers `forms.body.readonly`).

**2. Redeploy the connector**

Redeploy the server so it picks up the new image and requests the new scope set. Until you redeploy, nothing changes for your users. By default the connector requests its built-in scopes, so a redeploy is enough — unless you've overridden them (see the note below).

**3. Users re-authorize**

Each user re-authorizes through their own MCP client, the same way they first connected (signing in with Google and granting access). Existing authorizations keep their previously granted scopes until the user re-authorizes, so users pick up the new capability individually as they reconnect — it isn't something an admin does on each user's behalf.

> [!NOTE]
>
> The connector requests its built-in scopes by default, so most deployments only need the redeploy. The exception is if you set a `GOOGLE_OAUTH_SCOPES` environment variable on the connector, which overrides the built-in scopes. To check, open your connector in Runlayer and look at its environment variables: if `GOOGLE_OAUTH_SCOPES` is set, add the new scope to it (otherwise a redeploy won't change what's requested); if it isn't set, there's nothing to do.

> [!NOTE]
>
> Each user will need to re-authorize before they can use the new tools. Until they do, tools that need the added scope return permission errors for that user, while their existing capabilities keep working.

> [!NOTE]
>
> Adding a **sensitive** or **restricted** scope to a **published/verified External** app may require re-verification by Google (verification of a related scope does not carry over). **Internal** (Google Workspace) apps do not need re-verification.

## Troubleshooting

> [accordion] Redirect URI mismatch
>
> Verify the redirect URL in Google Cloud Console matches exactly: `https://<your-tenant>.runlayer.com/oauth/callback` (no trailing slash).

> [accordion] Access blocked during OAuth
>
> Ensure OAuth consent screen is configured. Add yourself as a test user if using External mode.

> [accordion] API not enabled
>
> Enable the specific API in Google Cloud Console > APIs & Services > Library.

> [accordion] Invalid grant
>
> Tokens may have expired. Disconnect and reconnect the server in Runlayer.

> [accordion] Insufficient permissions
>
> Re-authorize with updated scopes. Ensure the API is enabled in your project.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.