Google Drive Automation via Rube MCP
Automate Google Drive workflows including file upload/download, search, folder management, sharing/permissions, and organization through Composio's Google Drive toolkit.
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Google Drive connection via
RUBE_MANAGE_CONNECTIONS with toolkit googledrive
- Always call
RUBE_SEARCH_TOOLS first to get current tool schemas
Setup
Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
- Verify Rube MCP is available by confirming
RUBE_SEARCH_TOOLS responds
- Call
RUBE_MANAGE_CONNECTIONS with toolkit googledrive
- If connection is not ACTIVE, follow the returned auth link to complete Google OAuth
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Upload and Download Files
When to use: User wants to upload files to or download files from Google Drive
Tool sequence:
GOOGLEDRIVE_FIND_FILE - Locate target folder for upload [Prerequisite]
GOOGLEDRIVE_UPLOAD_FILE - Upload a file (max 5MB) [Required]
GOOGLEDRIVE_RESUMABLE_UPLOAD - Upload large files [Fallback]
GOOGLEDRIVE_DOWNLOAD_FILE - Download a file by ID [Required]
GOOGLEDRIVE_DOWNLOAD_FILE_OPERATION - Track long-running downloads [Fallback]
GOOGLEDRIVE_GET_FILE_METADATA - Verify file after upload/download [Optional]
Key parameters:
file_to_upload: Object with name, mimetype, and s3key (file must be in internal storage)
folder_to_upload_to: Target folder ID (optional; uploads to root if omitted)
file_id: ID of file to download
mime_type: Export format for Google Workspace files only (omit for native files)
Pitfalls:
GOOGLEDRIVE_UPLOAD_FILE requires file_to_upload.s3key; files must already be in internal storage
- For non-Google formats (Excel, PDF), do NOT set
mime_type; it causes errors for native files
- Download responses provide a temporary URL at
data.downloaded_file_content.s3url, not inline bytes
- Use
GOOGLEDRIVE_RESUMABLE_UPLOAD for files >5MB or when basic uploads fail
2. Search and List Files
When to use: User wants to find specific files or browse Drive contents
Tool sequence:
GOOGLEDRIVE_FIND_FILE - Search by name, content, type, date, or folder [Required]
GOOGLEDRIVE_LIST_FILES - Browse files with folder scoping [Alternative]
GOOGLEDRIVE_LIST_SHARED_DRIVES - Enumerate shared drives [Optional]
GOOGLEDRIVE_GET_FILE_METADATA - Get detailed file info [Optional]
GOOGLEDRIVE_GET_ABOUT - Check storage quota and supported formats [Optional]
Key parameters:
q: Drive query string (e.g., "name contains 'report'", "mimeType = 'application/pdf'")
corpora: Search scope ('user', 'domain', 'drive', 'allDrives')
fields: Response fields to include (e.g., 'files(id,name,mimeType)')
orderBy: Sort key ('modifiedTime desc', 'name', 'quotaBytesUsed desc')
pageSize: Results per page (max 1000)
pageToken: Pagination cursor from nextPageToken
folder_id: Scope search to a specific folder
Pitfalls:
- 403 PERMISSION_DENIED if OAuth scopes insufficient for shared drives
- Pagination required; files are in
response.data.files; follow nextPageToken until exhausted
corpora="domain" may trigger 400; try "allDrives" with includeItemsFromAllDrives=true
- Query complexity limits: >5-10 OR clauses may error "The query is too complex"
- Wildcards (*) NOT supported in
name; use contains for partial matching
- 'My Drive' is NOT searchable by name; use
folder_id='root' for root folder
- User email searches: use
'user@example.com' in owners (NOT owner:user@example.com)
3. Share Files and Manage Permissions
When to use: User wants to share files or manage access permissions
Tool sequence:
GOOGLEDRIVE_FIND_FILE - Locate the file to share [Prerequisite]
GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE - Set sharing permission [Required]
GOOGLEDRIVE_LIST_PERMISSIONS - View current permissions [Optional]
GOOGLEDRIVE_GET_PERMISSION - Inspect a specific permission [Optional]
GOOGLEDRIVE_UPDATE_PERMISSION - Modify existing permission [Optional]
GOOGLEDRIVE_DELETE_PERMISSION - Revoke access [Optional]
Key parameters:
file_id: ID of file to share
type: 'user', 'group', 'domain', or 'anyone'
role: 'owner', 'organizer', 'fileOrganizer', 'writer', 'commenter', 'reader'
email_address: Required for type='user' or 'group'
domain: Required for type='domain'
transfer_ownership: Required when role='owner'
Pitfalls:
- Invalid type/email combinations trigger 4xx errors
- Using
type='anyone' or powerful roles is risky; get explicit user confirmation
- Org policies may block certain sharing types, causing 403
- Permission changes may take time to propagate
- Use
GMAIL_SEARCH_PEOPLE to resolve contact names to emails before sharing
4. Create and Organize Folders
When to use: User wants to create folder structures or move files between folders
Tool sequence:
GOOGLEDRIVE_FIND_FILE - Check if folder already exists [Prerequisite]
GOOGLEDRIVE_CREATE_FOLDER - Create a new folder [Required]
GOOGLEDRIVE_GET_FILE_METADATA - Verify created folder [Optional]
GOOGLEDRIVE_MOVE_FILE - Move files between folders [Optional]
GOOGLEDRIVE_UPDATE_FILE_PUT - Update file metadata/parents [Alternative]
Key parameters:
name: Folder name
parent_id: Parent folder ID (NOT name); omit for root
file_id: File to move
add_parents: Destination folder ID for move
remove_parents: Source folder ID to remove from
Pitfalls:
GOOGLEDRIVE_CREATE_FOLDER requires parent_id as an ID, not a folder name
- Using
parent_id="root" creates at top level; for nested paths, chain folder IDs
GOOGLEDRIVE_FIND_FILE returns ~100 items/page; follow nextPageToken for large drives
- Move operations can leave items with multiple parents; use
remove_parents for true moves
- Always verify parent folder exists before creating children
Common Patterns
ID Resolution
- File/folder name -> ID:
GOOGLEDRIVE_FIND_FILE with q parameter
- Root folder: Use
folder_id='root' or 'root' in parents
- Shared drive -> driveId:
GOOGLEDRIVE_LIST_SHARED_DRIVES
- Contact name -> email:
GMAIL_SEARCH_PEOPLE (for sharing)
Query Syntax
Google Drive uses a specific query language:
- Name search:
"name contains 'report'" or "name = 'exact.pdf'"
- Type filter:
"mimeType = 'application/pdf'" or "mimeType = 'application/vnd.google-apps.folder'"
- Folder scoping:
"'FOLDER_ID' in parents"
- Date filter:
"modifiedTime > '2024-01-01T00:00:00'"
- Combine with
and/or/not: "name contains 'report' and trashed = false"
- Boolean filters:
"sharedWithMe = true", "starred = true", "trashed = false"
Pagination
- Follow
nextPageToken until absent for complete results
- Set
pageSize explicitly (default 100, max 1000)
- De-duplicate results if running multiple searches
Export Formats
For Google Workspace files, set mime_type to export:
- Docs:
application/pdf, text/plain, text/html, application/vnd.openxmlformats-officedocument.wordprocessingml.document
- Sheets:
text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- Slides:
application/pdf, application/vnd.openxmlformats-officedocument.presentationml.presentation
Known Pitfalls
- Internal storage required: Upload requires files in internal S3 storage (s3key)
- Export vs download: Set
mime_type ONLY for Google Workspace files; omit for native files
- Temporary URLs: Downloaded content via
s3url is temporary; fetch promptly
- Query complexity: >5-10 OR clauses may error; split complex searches into multiple queries
- Shared drive scoping: Missing drive permissions yield empty results; verify access first
- No wildcards: Use
contains operator instead of * for partial name matching
- Folder creation chains: Always pass folder IDs (not names) as
parent_id
- Multiple parents: Move operations may leave items with multiple parents; use
remove_parents
- Rate limits: Heavy searches/exports can trigger 403/429; implement backoff
Quick Reference
| Task |
Tool Slug |
Key Params |
| Search files |
GOOGLEDRIVE_FIND_FILE |
q, corpora, pageSize |
| List files |
GOOGLEDRIVE_LIST_FILES |
folderId, q, orderBy |
| Upload file |
GOOGLEDRIVE_UPLOAD_FILE |
file_to_upload, folder_to_upload_to |
| Resumable upload |
GOOGLEDRIVE_RESUMABLE_UPLOAD |
file data |
| Download file |
GOOGLEDRIVE_DOWNLOAD_FILE |
file_id, mime_type (Workspace only) |
| File metadata |
GOOGLEDRIVE_GET_FILE_METADATA |
fileId, fields |
| Create folder |
GOOGLEDRIVE_CREATE_FOLDER |
name, parent_id |
| Move file |
GOOGLEDRIVE_MOVE_FILE |
file_id, add_parents, remove_parents |
| Share file |
GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE |
file_id, role, type, email_address |
| List permissions |
GOOGLEDRIVE_LIST_PERMISSIONS |
fileId |
| Update permission |
GOOGLEDRIVE_UPDATE_PERMISSION |
file_id, permission_id |
| Delete permission |
GOOGLEDRIVE_DELETE_PERMISSION |
file_id, permission_id |
| List shared drives |
GOOGLEDRIVE_LIST_SHARED_DRIVES |
pageSize |
| Drive info |
GOOGLEDRIVE_GET_ABOUT |
(none) |
| Create shortcut |
GOOGLEDRIVE_CREATE_SHORTCUT_TO_FILE |
target file_id |
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
🏰 Rei Skills — Curated by Rootcastle Engineering & Innovation | Batuhan Ayrıbaş
Engineering Beyond Boundaries | admin@rootcastle.com
1---2name: google-drive-automation3description: Automate Google Drive file operations (upload, download, search, share, organize) via Rube MCP (Composio). Upload/download files, manage folders, share with permissions, and search across drives pr...4---56# Google Drive Automation via Rube MCP78Automate Google Drive workflows including file upload/download, search, folder management, sharing/permissions, and organization through Composio's Google Drive toolkit.910## Prerequisites1112- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)13- Active Google Drive connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `googledrive`14- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1516## Setup1718**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.1920211. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds222. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `googledrive`233. If connection is not ACTIVE, follow the returned auth link to complete Google OAuth244. Confirm connection status shows ACTIVE before running any workflows2526## Core Workflows2728### 1. Upload and Download Files2930**When to use**: User wants to upload files to or download files from Google Drive3132**Tool sequence**:331. `GOOGLEDRIVE_FIND_FILE` - Locate target folder for upload [Prerequisite]342. `GOOGLEDRIVE_UPLOAD_FILE` - Upload a file (max 5MB) [Required]353. `GOOGLEDRIVE_RESUMABLE_UPLOAD` - Upload large files [Fallback]364. `GOOGLEDRIVE_DOWNLOAD_FILE` - Download a file by ID [Required]375. `GOOGLEDRIVE_DOWNLOAD_FILE_OPERATION` - Track long-running downloads [Fallback]386. `GOOGLEDRIVE_GET_FILE_METADATA` - Verify file after upload/download [Optional]3940**Key parameters**:41- `file_to_upload`: Object with `name`, `mimetype`, and `s3key` (file must be in internal storage)42- `folder_to_upload_to`: Target folder ID (optional; uploads to root if omitted)43- `file_id`: ID of file to download44- `mime_type`: Export format for Google Workspace files only (omit for native files)4546**Pitfalls**:47- `GOOGLEDRIVE_UPLOAD_FILE` requires `file_to_upload.s3key`; files must already be in internal storage48- For non-Google formats (Excel, PDF), do NOT set `mime_type`; it causes errors for native files49- Download responses provide a temporary URL at `data.downloaded_file_content.s3url`, not inline bytes50- Use `GOOGLEDRIVE_RESUMABLE_UPLOAD` for files >5MB or when basic uploads fail5152### 2. Search and List Files5354**When to use**: User wants to find specific files or browse Drive contents5556**Tool sequence**:571. `GOOGLEDRIVE_FIND_FILE` - Search by name, content, type, date, or folder [Required]582. `GOOGLEDRIVE_LIST_FILES` - Browse files with folder scoping [Alternative]593. `GOOGLEDRIVE_LIST_SHARED_DRIVES` - Enumerate shared drives [Optional]604. `GOOGLEDRIVE_GET_FILE_METADATA` - Get detailed file info [Optional]615. `GOOGLEDRIVE_GET_ABOUT` - Check storage quota and supported formats [Optional]6263**Key parameters**:64- `q`: Drive query string (e.g., "name contains 'report'", "mimeType = 'application/pdf'")65- `corpora`: Search scope ('user', 'domain', 'drive', 'allDrives')66- `fields`: Response fields to include (e.g., 'files(id,name,mimeType)')67- `orderBy`: Sort key ('modifiedTime desc', 'name', 'quotaBytesUsed desc')68- `pageSize`: Results per page (max 1000)69- `pageToken`: Pagination cursor from `nextPageToken`70- `folder_id`: Scope search to a specific folder7172**Pitfalls**:73- 403 PERMISSION_DENIED if OAuth scopes insufficient for shared drives74- Pagination required; files are in `response.data.files`; follow `nextPageToken` until exhausted75- `corpora="domain"` may trigger 400; try `"allDrives"` with `includeItemsFromAllDrives=true`76- Query complexity limits: >5-10 OR clauses may error "The query is too complex"77- Wildcards (*) NOT supported in `name`; use `contains` for partial matching78- 'My Drive' is NOT searchable by name; use `folder_id='root'` for root folder79- User email searches: use `'user@example.com' in owners` (NOT `owner:user@example.com`)8081### 3. Share Files and Manage Permissions8283**When to use**: User wants to share files or manage access permissions8485**Tool sequence**:861. `GOOGLEDRIVE_FIND_FILE` - Locate the file to share [Prerequisite]872. `GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE` - Set sharing permission [Required]883. `GOOGLEDRIVE_LIST_PERMISSIONS` - View current permissions [Optional]894. `GOOGLEDRIVE_GET_PERMISSION` - Inspect a specific permission [Optional]905. `GOOGLEDRIVE_UPDATE_PERMISSION` - Modify existing permission [Optional]916. `GOOGLEDRIVE_DELETE_PERMISSION` - Revoke access [Optional]9293**Key parameters**:94- `file_id`: ID of file to share95- `type`: 'user', 'group', 'domain', or 'anyone'96- `role`: 'owner', 'organizer', 'fileOrganizer', 'writer', 'commenter', 'reader'97- `email_address`: Required for type='user' or 'group'98- `domain`: Required for type='domain'99- `transfer_ownership`: Required when role='owner'100101**Pitfalls**:102- Invalid type/email combinations trigger 4xx errors103- Using `type='anyone'` or powerful roles is risky; get explicit user confirmation104- Org policies may block certain sharing types, causing 403105- Permission changes may take time to propagate106- Use `GMAIL_SEARCH_PEOPLE` to resolve contact names to emails before sharing107108### 4. Create and Organize Folders109110**When to use**: User wants to create folder structures or move files between folders111112**Tool sequence**:1131. `GOOGLEDRIVE_FIND_FILE` - Check if folder already exists [Prerequisite]1142. `GOOGLEDRIVE_CREATE_FOLDER` - Create a new folder [Required]1153. `GOOGLEDRIVE_GET_FILE_METADATA` - Verify created folder [Optional]1164. `GOOGLEDRIVE_MOVE_FILE` - Move files between folders [Optional]1175. `GOOGLEDRIVE_UPDATE_FILE_PUT` - Update file metadata/parents [Alternative]118119**Key parameters**:120- `name`: Folder name121- `parent_id`: Parent folder ID (NOT name); omit for root122- `file_id`: File to move123- `add_parents`: Destination folder ID for move124- `remove_parents`: Source folder ID to remove from125126**Pitfalls**:127- `GOOGLEDRIVE_CREATE_FOLDER` requires `parent_id` as an ID, not a folder name128- Using `parent_id="root"` creates at top level; for nested paths, chain folder IDs129- `GOOGLEDRIVE_FIND_FILE` returns ~100 items/page; follow `nextPageToken` for large drives130- Move operations can leave items with multiple parents; use `remove_parents` for true moves131- Always verify parent folder exists before creating children132133## Common Patterns134135### ID Resolution136- **File/folder name -> ID**: `GOOGLEDRIVE_FIND_FILE` with `q` parameter137- **Root folder**: Use `folder_id='root'` or `'root' in parents`138- **Shared drive -> driveId**: `GOOGLEDRIVE_LIST_SHARED_DRIVES`139- **Contact name -> email**: `GMAIL_SEARCH_PEOPLE` (for sharing)140141### Query Syntax142Google Drive uses a specific query language:143- Name search: `"name contains 'report'"` or `"name = 'exact.pdf'"`144- Type filter: `"mimeType = 'application/pdf'"` or `"mimeType = 'application/vnd.google-apps.folder'"`145- Folder scoping: `"'FOLDER_ID' in parents"`146- Date filter: `"modifiedTime > '2024-01-01T00:00:00'"`147- Combine with `and`/`or`/`not`: `"name contains 'report' and trashed = false"`148- Boolean filters: `"sharedWithMe = true"`, `"starred = true"`, `"trashed = false"`149150### Pagination151- Follow `nextPageToken` until absent for complete results152- Set `pageSize` explicitly (default 100, max 1000)153- De-duplicate results if running multiple searches154155### Export Formats156For Google Workspace files, set `mime_type` to export:157- **Docs**: `application/pdf`, `text/plain`, `text/html`, `application/vnd.openxmlformats-officedocument.wordprocessingml.document`158- **Sheets**: `text/csv`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`159- **Slides**: `application/pdf`, `application/vnd.openxmlformats-officedocument.presentationml.presentation`160161## Known Pitfalls162163- **Internal storage required**: Upload requires files in internal S3 storage (s3key)164- **Export vs download**: Set `mime_type` ONLY for Google Workspace files; omit for native files165- **Temporary URLs**: Downloaded content via `s3url` is temporary; fetch promptly166- **Query complexity**: >5-10 OR clauses may error; split complex searches into multiple queries167- **Shared drive scoping**: Missing drive permissions yield empty results; verify access first168- **No wildcards**: Use `contains` operator instead of `*` for partial name matching169- **Folder creation chains**: Always pass folder IDs (not names) as `parent_id`170- **Multiple parents**: Move operations may leave items with multiple parents; use `remove_parents`171- **Rate limits**: Heavy searches/exports can trigger 403/429; implement backoff172173## Quick Reference174175| Task | Tool Slug | Key Params |176|------|-----------|------------|177| Search files | `GOOGLEDRIVE_FIND_FILE` | `q`, `corpora`, `pageSize` |178| List files | `GOOGLEDRIVE_LIST_FILES` | `folderId`, `q`, `orderBy` |179| Upload file | `GOOGLEDRIVE_UPLOAD_FILE` | `file_to_upload`, `folder_to_upload_to` |180| Resumable upload | `GOOGLEDRIVE_RESUMABLE_UPLOAD` | file data |181| Download file | `GOOGLEDRIVE_DOWNLOAD_FILE` | `file_id`, `mime_type` (Workspace only) |182| File metadata | `GOOGLEDRIVE_GET_FILE_METADATA` | `fileId`, `fields` |183| Create folder | `GOOGLEDRIVE_CREATE_FOLDER` | `name`, `parent_id` |184| Move file | `GOOGLEDRIVE_MOVE_FILE` | `file_id`, `add_parents`, `remove_parents` |185| Share file | `GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE` | `file_id`, `role`, `type`, `email_address` |186| List permissions | `GOOGLEDRIVE_LIST_PERMISSIONS` | `fileId` |187| Update permission | `GOOGLEDRIVE_UPDATE_PERMISSION` | file_id, permission_id |188| Delete permission | `GOOGLEDRIVE_DELETE_PERMISSION` | file_id, permission_id |189| List shared drives | `GOOGLEDRIVE_LIST_SHARED_DRIVES` | `pageSize` |190| Drive info | `GOOGLEDRIVE_GET_ABOUT` | (none) |191| Create shortcut | `GOOGLEDRIVE_CREATE_SHORTCUT_TO_FILE` | target file_id |192193## When to Use194This skill is applicable to execute the workflow or actions described in the overview.195196---197198> 🏰 **Rei Skills** — Curated by [Rootcastle Engineering & Innovation](https://www.rootcastle.com) | Batuhan Ayrıbaş 199> Engineering Beyond Boundaries | admin@rootcastle.com