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)
| Tool | Description |
|---|---|
gmail_send | Send email via the agent's assigned email address |
gmail_list | List emails with query filtering |
gmail_read | Read 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.
| Tool | Description |
|---|---|
drive_list | List files in a folder or shared drive |
drive_get | Get detailed file/folder metadata |
drive_read | Read/download file content (Google formats auto-exported) |
drive_upload | Upload file to Drive or shared drive (up to 50 MB) |
drive_update | Overwrite file content |
drive_create_folder | Create a folder |
drive_share | Share file with users (reader, commenter, writer, organizer) |
drive_move | Move file between folders or shared drives |
drive_rename | Rename a file or folder |
drive_delete | Trash or permanently delete a file |
drive_list_shared_drives | List 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 Format | Default Export |
|---|---|
| Google Docs | Plain text |
| Google Sheets | CSV |
| Google Slides | Plain text |
| Google Drawings | PNG |
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)
| Tool | Description |
|---|---|
docs_create | Create a new Google Doc |
docs_read | Read 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)
| Tool | Description |
|---|---|
sheets_create | Create a spreadsheet with multiple sheets |
sheets_update | Update cells using A1 notation |
sheets_read | Read 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)
| Tool | Description |
|---|---|
slides_create | Create a new presentation |
slides_add_slide | Add a slide with a layout |
slides_add_text | Add text boxes to a slide |
slides_get | Get 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)
| Tool | Description |
|---|---|
calendar_list_events | List events with date filtering |
calendar_create_event | Create 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)
| Tool | Description |
|---|---|
meet_create | Create an instant or scheduled video conference |
Google Chat (3 tools)
| Tool | Description |
|---|---|
chat_list_spaces | List accessible Chat spaces |
chat_send_message | Send message to a space |
chat_create_space | Create a new Chat space |
Google Tasks (3 tools)
| Tool | Description |
|---|---|
tasks_list | List tasks from a task list |
tasks_create | Create a task with due date |
tasks_complete | Mark a task as completed |
Google Vault / eDiscovery (2 tools)
| Tool | Description |
|---|---|
vault_list_matters | List eDiscovery matters |
vault_create_matter | Create a new matter |
Google Analytics (2 tools)
| Tool | Description |
|---|---|
analytics_list_properties | List GA4 properties |
analytics_run_report | Run custom analytics reports with dimensions and metrics |
Google Ads (2 tools)
| Tool | Description |
|---|---|
ads_list_campaigns | List ad campaigns (requires developer token) |
ads_get_metrics | Get campaign performance metrics |
YouTube (5 tools)
| Tool | Description |
|---|---|
youtube_list_videos | List channel videos |
youtube_get_analytics | Get channel analytics |
youtube_update_video | Update video metadata |
youtube_create_playlist | Create a new playlist |
youtube_add_to_playlist | Add 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.
| Tool | Description | Requires Approval |
|---|---|---|
google_admin_create_group | Create a Google Group | Yes |
google_admin_add_group_member | Add member to a group | No |
google_admin_create_shared_drive | Create a shared drive | Yes |
google_admin_add_drive_permission | Add permission to a shared drive | No |
google_admin_create_user | Create a user account | Yes |
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:
- Enable the Admin SDK API in Google Cloud Console
- In Google Admin Console: Security > API controls > Domain-wide delegation
- 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'
]
Service Account (Recommended for Agents)
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"
- Check user has Google Workspace license
- Verify OAuth scopes include required API
- Check Google Admin console for API restrictions
"Rate Limit Exceeded"
Google APIs have per-user and per-project limits:
| API | Limit |
|---|---|
| Gmail | 250 quota units/user/second |
| Drive | 12,000 requests/day |
| Calendar | 500 requests/100 seconds |
"Invalid Grant"
OAuth token expired or revoked:
await client.integrations.refreshConnection('connection-123');
Next: Explore Microsoft 365 integration.