Skip to main content

Google Workspace

Connect your agents to Google Workspace for Gmail, Drive (including shared drives), Calendar, Docs, Sheets, Slides, Meet, Chat, Tasks, and more.

48 tools across 14 Google services.

Gmail (3 tools)

ToolDescription
gmail_sendSend email via the agent's assigned email address
gmail_listList emails with query filtering
gmail_readRead full email content by message ID

Send Email

await tools.gmail_send({
to: 'customer@example.com',
cc: 'team@company.com',
subject: 'Re: Your inquiry',
body: 'Thank you for reaching out...',
isHtml: false
});

List Emails

const emails = await tools.gmail_list({
query: 'from:support@company.com is:unread',
maxResults: 10
});

Google Drive (11 tools)

Full CRUD operations with shared drives support.

ToolDescription
drive_listList files in a folder or shared drive
drive_getGet detailed file/folder metadata
drive_readRead/download file content (Google formats auto-exported)
drive_uploadUpload file to Drive or shared drive (up to 50 MB)
drive_updateOverwrite file content
drive_create_folderCreate a folder
drive_shareShare file with users (reader, commenter, writer, organizer)
drive_moveMove file between folders or shared drives
drive_renameRename a file or folder
drive_deleteTrash or permanently delete a file
drive_list_shared_drivesList all accessible shared drives

Shared Drives

Agents can work with shared drives across your organization:

// List all shared drives the agent can access
const drives = await tools.drive_list_shared_drives({
query: "name contains 'Marketing'"
});

// List files in a shared drive
const files = await tools.drive_list({
driveId: 'shared-drive-id',
maxResults: 50
});

// Upload to a shared drive folder
await tools.drive_upload({
name: 'Q4-Report.pdf',
content: base64Content,
mimeType: 'application/pdf',
parentId: 'folder-id-in-shared-drive'
});

Google Workspace Native Formats

When reading Google Docs, Sheets, Slides, or Drawings, the content is automatically exported to a standard format:

Google FormatDefault Export
Google DocsPlain text
Google SheetsCSV
Google SlidesPlain text
Google DrawingsPNG

You can override the export format:

// Export a Google Doc as HTML instead of plain text
const content = await tools.drive_read({
fileId: 'doc-id',
exportMimeType: 'text/html'
});

// Export as PDF
const pdf = await tools.drive_read({
fileId: 'doc-id',
exportMimeType: 'application/pdf'
});

File Operations

// Get file metadata
const file = await tools.drive_get({ fileId: 'file-123' });

// Upload a file
await tools.drive_upload({
name: 'report.xlsx',
content: base64Content,
mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
parentId: 'folder-id' // optional
});

// Move file to another folder
await tools.drive_move({
fileId: 'file-123',
destinationFolderId: 'folder-456'
});

// Share a file
await tools.drive_share({
fileId: 'file-123',
email: 'colleague@company.com',
role: 'writer' // reader, commenter, writer, organizer
});

// Delete a file
await tools.drive_delete({ fileId: 'file-123' });

Limits: 10 MB max for reads/downloads, 50 MB max for uploads. Binary files are returned as base64.

Google Docs (2 tools)

ToolDescription
docs_createCreate a new Google Doc
docs_readRead document content
// Create a document
const doc = await tools.docs_create({
title: 'Meeting Notes - Q4 Review',
content: 'Attendees: Sarah, Mike, Lisa\n\n## Action Items\n...'
});

// Read a document
const content = await tools.docs_read({ documentId: 'doc-123' });

Google Sheets (3 tools)

ToolDescription
sheets_createCreate a spreadsheet with multiple sheets
sheets_updateUpdate cells using A1 notation
sheets_readRead cell ranges
// Create a spreadsheet
const sheet = await tools.sheets_create({
title: 'Sales Pipeline',
sheets: ['Q1', 'Q2', 'Q3', 'Q4']
});

// Update cells
await tools.sheets_update({
spreadsheetId: 'sheet-123',
range: 'Q1!A1:C2',
values: [
['Deal', 'Amount', 'Stage'],
['Acme', '50000', 'Negotiation']
]
});

// Read data
const data = await tools.sheets_read({
spreadsheetId: 'sheet-123',
range: 'Q1!A1:D10'
});

Google Slides (4 tools)

ToolDescription
slides_createCreate a new presentation
slides_add_slideAdd a slide with a layout
slides_add_textAdd text boxes to a slide
slides_getGet presentation structure and slide IDs
// Create a presentation
const pres = await tools.slides_create({
title: 'Q4 Review'
});

// Add a slide
await tools.slides_add_slide({
presentationId: pres.presentationId,
layout: 'TITLE_AND_BODY' // BLANK, TITLE, TITLE_AND_BODY, etc.
});

// Add text to a slide
await tools.slides_add_text({
presentationId: pres.presentationId,
slideId: 'slide-id',
text: 'Revenue grew 45% YoY',
x: 100, y: 200, width: 400, height: 50
});

Google Calendar (2 tools)

ToolDescription
calendar_list_eventsList events with date filtering
calendar_create_eventCreate event with attendees and Google Meet
// List upcoming events
const events = await tools.calendar_list_events({
calendarId: 'primary',
timeMin: '2026-02-10T00:00:00Z',
timeMax: '2026-02-17T00:00:00Z'
});

// Create event with Google Meet
const event = await tools.calendar_create_event({
calendarId: 'primary',
summary: 'Project Kickoff',
description: 'Initial planning session',
start: '2026-02-15T14:00:00Z',
end: '2026-02-15T15:00:00Z',
attendees: ['alice@company.com', 'bob@company.com'],
addMeetLink: true
});

Google Meet (1 tool)

ToolDescription
meet_createCreate an instant or scheduled video conference

Google Chat (3 tools)

ToolDescription
chat_list_spacesList accessible Chat spaces
chat_send_messageSend message to a space
chat_create_spaceCreate a new Chat space

Google Tasks (3 tools)

ToolDescription
tasks_listList tasks from a task list
tasks_createCreate a task with due date
tasks_completeMark a task as completed

Google Vault / eDiscovery (2 tools)

ToolDescription
vault_list_mattersList eDiscovery matters
vault_create_matterCreate a new matter

Google Analytics (2 tools)

ToolDescription
analytics_list_propertiesList GA4 properties
analytics_run_reportRun custom analytics reports with dimensions and metrics
ToolDescription
ads_list_campaignsList ad campaigns (requires developer token)
ads_get_metricsGet campaign performance metrics

YouTube (5 tools)

ToolDescription
youtube_list_videosList channel videos
youtube_get_analyticsGet channel analytics
youtube_update_videoUpdate video metadata
youtube_create_playlistCreate a new playlist
youtube_add_to_playlistAdd videos to a playlist

Google Admin (5 tools)

Enterprise administration tools for provisioning users, groups, and shared drives. Requires domain-wide delegation via service account.

ToolDescriptionRequires Approval
google_admin_create_groupCreate a Google GroupYes
google_admin_add_group_memberAdd member to a groupNo
google_admin_create_shared_driveCreate a shared driveYes
google_admin_add_drive_permissionAdd permission to a shared driveNo
google_admin_create_userCreate a user accountYes

Tools marked "Requires Approval" have requiresApproval: true because they incur costs (license fees) or create organization-wide resources.

Setup

Admin tools require a service account with domain-wide delegation:

  1. Enable the Admin SDK API in Google Cloud Console
  2. In Google Admin Console: Security > API controls > Domain-wide delegation
  3. Add your service account client ID with these scopes:
    https://www.googleapis.com/auth/admin.directory.user
    https://www.googleapis.com/auth/admin.directory.group
    https://www.googleapis.com/auth/drive

Examples

// Create a shared drive for a team
const drive = await tools.google_admin_create_shared_drive({
name: 'Marketing Team Drive',
requestId: 'unique-request-id'
});

// Add permission to the drive
await tools.google_admin_add_drive_permission({
driveId: drive.id,
email: 'marketing-team@company.com',
role: 'organizer',
type: 'group'
});

// Create a user account
const user = await tools.google_admin_create_user({
email: 'newuser@company.com',
firstName: 'New',
lastName: 'User',
password: 'temporary-password',
changePasswordAtNextLogin: true,
orgUnitPath: '/Employees/Engineering'
});

Connecting

OAuth Scopes

// Workspace productivity scopes
scopes: [
'gmail.readonly', 'gmail.send', 'gmail.modify', 'gmail.compose',
'drive', 'drive.file',
'documents', 'spreadsheets', 'presentations',
'calendar', 'calendar.events',
'chat.spaces', 'chat.messages', 'chat.memberships',
'tasks',
'ediscovery'
]

Agents authenticate via a Google Service Account with domain-wide delegation. The service account impersonates the agent's assigned email address.

await client.integrations.connectServiceAccount({
integrationId: 'google-workspace',
credentials: {
type: 'service_account',
project_id: 'your-project',
private_key: process.env.GOOGLE_PRIVATE_KEY,
client_email: 'service@your-project.iam.gserviceaccount.com'
},
adminEmail: 'admin@your-domain.com',
scopes: ['gmail.send', 'drive', 'calendar']
});

OAuth (Interactive)

const connection = await client.integrations.connect({
integrationId: 'google-workspace',
scopes: ['gmail.modify', 'drive', 'calendar'],
redirectUrl: 'https://your-app.com/oauth/callback'
});

window.location.href = connection.authUrl;

Automatic Workspace Provisioning

When you start a team with Google Workspace connected, MeetLoyd can automatically create a Shared Drive for the team with standard folders (Reports, Working, Shared, Archive) and add agents as members.

  • Service account configured: Workspace created automatically during team first-start
  • No service account: A guided task is created for your admin to set up manually

Team bosses and lead agents get organizer access, regular agents get writer access.

After provisioning, you can manage the workspace from the team's Workspace tab in the dashboard. See Team Workspace Provisioning for full details.

Files & Attachments Integration

Google Drive tools work alongside MeetLoyd's file management system:

  • Agents can read files from Drive and reference them in conversations
  • Agents can upload generated documents to Drive or shared drives
  • Files downloaded from Drive can be parsed and chunked for RAG via the MeetLoyd file parser
  • Chat file attachments are stored locally; Drive files stay in Google's infrastructure

Best Practices

1. Minimal Scopes

// ✅ Good - request only what you need
scopes: ['gmail.readonly', 'calendar.readonly']

// ❌ Bad - overly broad
scopes: ['https://mail.google.com/']

2. Use Shared Drives for Team Content

Shared drives provide consistent access for all team agents:

// All agents in the team can access the same shared drive
const files = await tools.drive_list({ driveId: 'team-shared-drive-id' });

3. Handle Export Formats Explicitly

When reading Google Workspace files, specify the export format if the default doesn't suit your needs:

// Need structured data from a Sheet? Use CSV (default)
const csv = await tools.drive_read({ fileId: 'sheet-id' });

// Need formatted doc? Export as HTML
const html = await tools.drive_read({
fileId: 'doc-id',
exportMimeType: 'text/html'
});

4. Respect Size Limits

// Check file size before downloading
const meta = await tools.drive_get({ fileId: 'file-id' });
if (parseInt(meta.file.size) > 10 * 1024 * 1024) {
// File too large for direct read - consider alternative approach
}

Troubleshooting

"Access Denied"

  1. Check user has Google Workspace license
  2. Verify OAuth scopes include required API
  3. Check Google Admin console for API restrictions

"Rate Limit Exceeded"

Google APIs have per-user and per-project limits:

APILimit
Gmail250 quota units/user/second
Drive12,000 requests/day
Calendar500 requests/100 seconds

"Invalid Grant"

OAuth token expired or revoked:

await client.integrations.refreshConnection('connection-123');

Next: Explore Microsoft 365 integration.