> ## 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

<Info>
  **Built by Runlayer.** Runlayer builds and maintains this connector. It runs
  on Runlayer Deploy, which must be enabled for your workspace.
</Info>

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                             |
| `create_event`    | Create an event with attendees and recurrence |
| `quick_add`       | Create event from natural language            |
| `update_event`    | Modify an event                               |
| `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                            |

### 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                                   |
| `fetch_file`               | Download file content                                      |
| `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                                   |

### Google Docs

| Tool                   | Description                                                                                                                                               |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `search`               | Search for documents                                                                                                                                      |
| `fetch`                | Get document content                                                                                                                                      |
| `create_file`          | Create a new document from markdown or HTML                                                                                                               |
| `replace_file_content` | Overwrite a document's entire content                                                                                                                     |
| `insert_text`          | Insert text at position                                                                                                                                   |
| `replace_text`         | Find and replace text                                                                                                                                     |
| `delete_text`          | Delete text in range                                                                                                                                      |
| `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)                                                                                        |
| `link_text`            | Find text and turn it into a hyperlink                                                                                                                    |
| `edit_table`           | Edit a table (insert/delete rows & columns, set cell text, overwrite a whole row, column width, cell styling including padding), located by index or text |
| `insert_break`         | Insert a page or section break                                                                                                                            |
| `add_comment`          | Add a comment                                                                                                                                             |
| `list_comments`        | List comments on a document                                                                                                                               |
| `resolve_comment`      | Resolve a comment                                                                                                                                         |
| `list_tabs`            | List document tabs                                                                                                                                        |
| `fetch_tab`            | Get content of a tab                                                                                                                                      |
| `fetch_all_tabs`       | Get all tab contents                                                                                                                                      |

### 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) |

### 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

<Steps>
  <Step title="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
  </Step>

  <Step title="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
  </Step>

  <Step title="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
  </Step>

  <Step title="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**
  </Step>

  <Step title="Add Server in Runlayer">
    1. In Runlayer, go to **My 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**
  </Step>

  <Step title="Authorize">
    1. Click **Connect** on the server page
    2. Sign in with Google and grant permissions
  </Step>
</Steps>

## 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:

<Steps>
  <Step title="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`).
  </Step>

  <Step title="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).
  </Step>

  <Step title="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.
  </Step>
</Steps>

<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>

<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>

<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.
</Note>

## Troubleshooting

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

<Accordion title="Access blocked during OAuth">
  Ensure OAuth consent screen is configured. Add yourself as a test user if using External mode.
</Accordion>

<Accordion title="API not enabled">
  Enable the specific API in Google Cloud Console > APIs & Services > Library.
</Accordion>

<Accordion title="Invalid grant">
  Tokens may have expired. Disconnect and reconnect the server in Runlayer.
</Accordion>

<Accordion title="Insufficient permissions">
  Re-authorize with updated scopes. Ensure the API is enabled in your project.
</Accordion>
