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 programmatically.
Add this skill
npx mdskills install sickn33/google-drive-automationComprehensive Google Drive automation with detailed workflows, query syntax, and extensive pitfall documentation
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 programmatically."4requires:5 mcp: [rube]6---78# Google Drive Automation via Rube MCP910Automate Google Drive workflows including file upload/download, search, folder management, sharing/permissions, and organization through Composio's Google Drive toolkit.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active Google Drive connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `googledrive`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**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.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `googledrive`253. If connection is not ACTIVE, follow the returned auth link to complete Google OAuth264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. Upload and Download Files3132**When to use**: User wants to upload files to or download files from Google Drive3334**Tool sequence**:351. `GOOGLEDRIVE_FIND_FILE` - Locate target folder for upload [Prerequisite]362. `GOOGLEDRIVE_UPLOAD_FILE` - Upload a file (max 5MB) [Required]373. `GOOGLEDRIVE_RESUMABLE_UPLOAD` - Upload large files [Fallback]384. `GOOGLEDRIVE_DOWNLOAD_FILE` - Download a file by ID [Required]395. `GOOGLEDRIVE_DOWNLOAD_FILE_OPERATION` - Track long-running downloads [Fallback]406. `GOOGLEDRIVE_GET_FILE_METADATA` - Verify file after upload/download [Optional]4142**Key parameters**:43- `file_to_upload`: Object with `name`, `mimetype`, and `s3key` (file must be in internal storage)44- `folder_to_upload_to`: Target folder ID (optional; uploads to root if omitted)45- `file_id`: ID of file to download46- `mime_type`: Export format for Google Workspace files only (omit for native files)4748**Pitfalls**:49- `GOOGLEDRIVE_UPLOAD_FILE` requires `file_to_upload.s3key`; files must already be in internal storage50- For non-Google formats (Excel, PDF), do NOT set `mime_type`; it causes errors for native files51- Download responses provide a temporary URL at `data.downloaded_file_content.s3url`, not inline bytes52- Use `GOOGLEDRIVE_RESUMABLE_UPLOAD` for files >5MB or when basic uploads fail5354### 2. Search and List Files5556**When to use**: User wants to find specific files or browse Drive contents5758**Tool sequence**:591. `GOOGLEDRIVE_FIND_FILE` - Search by name, content, type, date, or folder [Required]602. `GOOGLEDRIVE_LIST_FILES` - Browse files with folder scoping [Alternative]613. `GOOGLEDRIVE_LIST_SHARED_DRIVES` - Enumerate shared drives [Optional]624. `GOOGLEDRIVE_GET_FILE_METADATA` - Get detailed file info [Optional]635. `GOOGLEDRIVE_GET_ABOUT` - Check storage quota and supported formats [Optional]6465**Key parameters**:66- `q`: Drive query string (e.g., "name contains 'report'", "mimeType = 'application/pdf'")67- `corpora`: Search scope ('user', 'domain', 'drive', 'allDrives')68- `fields`: Response fields to include (e.g., 'files(id,name,mimeType)')69- `orderBy`: Sort key ('modifiedTime desc', 'name', 'quotaBytesUsed desc')70- `pageSize`: Results per page (max 1000)71- `pageToken`: Pagination cursor from `nextPageToken`72- `folder_id`: Scope search to a specific folder7374**Pitfalls**:75- 403 PERMISSION_DENIED if OAuth scopes insufficient for shared drives76- Pagination required; files are in `response.data.files`; follow `nextPageToken` until exhausted77- `corpora="domain"` may trigger 400; try `"allDrives"` with `includeItemsFromAllDrives=true`78- Query complexity limits: >5-10 OR clauses may error "The query is too complex"79- Wildcards (*) NOT supported in `name`; use `contains` for partial matching80- 'My Drive' is NOT searchable by name; use `folder_id='root'` for root folder81- User email searches: use `'user@example.com' in owners` (NOT `owner:user@example.com`)8283### 3. Share Files and Manage Permissions8485**When to use**: User wants to share files or manage access permissions8687**Tool sequence**:881. `GOOGLEDRIVE_FIND_FILE` - Locate the file to share [Prerequisite]892. `GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE` - Set sharing permission [Required]903. `GOOGLEDRIVE_LIST_PERMISSIONS` - View current permissions [Optional]914. `GOOGLEDRIVE_GET_PERMISSION` - Inspect a specific permission [Optional]925. `GOOGLEDRIVE_UPDATE_PERMISSION` - Modify existing permission [Optional]936. `GOOGLEDRIVE_DELETE_PERMISSION` - Revoke access [Optional]9495**Key parameters**:96- `file_id`: ID of file to share97- `type`: 'user', 'group', 'domain', or 'anyone'98- `role`: 'owner', 'organizer', 'fileOrganizer', 'writer', 'commenter', 'reader'99- `email_address`: Required for type='user' or 'group'100- `domain`: Required for type='domain'101- `transfer_ownership`: Required when role='owner'102103**Pitfalls**:104- Invalid type/email combinations trigger 4xx errors105- Using `type='anyone'` or powerful roles is risky; get explicit user confirmation106- Org policies may block certain sharing types, causing 403107- Permission changes may take time to propagate108- Use `GMAIL_SEARCH_PEOPLE` to resolve contact names to emails before sharing109110### 4. Create and Organize Folders111112**When to use**: User wants to create folder structures or move files between folders113114**Tool sequence**:1151. `GOOGLEDRIVE_FIND_FILE` - Check if folder already exists [Prerequisite]1162. `GOOGLEDRIVE_CREATE_FOLDER` - Create a new folder [Required]1173. `GOOGLEDRIVE_GET_FILE_METADATA` - Verify created folder [Optional]1184. `GOOGLEDRIVE_MOVE_FILE` - Move files between folders [Optional]1195. `GOOGLEDRIVE_UPDATE_FILE_PUT` - Update file metadata/parents [Alternative]120121**Key parameters**:122- `name`: Folder name123- `parent_id`: Parent folder ID (NOT name); omit for root124- `file_id`: File to move125- `add_parents`: Destination folder ID for move126- `remove_parents`: Source folder ID to remove from127128**Pitfalls**:129- `GOOGLEDRIVE_CREATE_FOLDER` requires `parent_id` as an ID, not a folder name130- Using `parent_id="root"` creates at top level; for nested paths, chain folder IDs131- `GOOGLEDRIVE_FIND_FILE` returns ~100 items/page; follow `nextPageToken` for large drives132- Move operations can leave items with multiple parents; use `remove_parents` for true moves133- Always verify parent folder exists before creating children134135## Common Patterns136137### ID Resolution138- **File/folder name -> ID**: `GOOGLEDRIVE_FIND_FILE` with `q` parameter139- **Root folder**: Use `folder_id='root'` or `'root' in parents`140- **Shared drive -> driveId**: `GOOGLEDRIVE_LIST_SHARED_DRIVES`141- **Contact name -> email**: `GMAIL_SEARCH_PEOPLE` (for sharing)142143### Query Syntax144Google Drive uses a specific query language:145- Name search: `"name contains 'report'"` or `"name = 'exact.pdf'"`146- Type filter: `"mimeType = 'application/pdf'"` or `"mimeType = 'application/vnd.google-apps.folder'"`147- Folder scoping: `"'FOLDER_ID' in parents"`148- Date filter: `"modifiedTime > '2024-01-01T00:00:00'"`149- Combine with `and`/`or`/`not`: `"name contains 'report' and trashed = false"`150- Boolean filters: `"sharedWithMe = true"`, `"starred = true"`, `"trashed = false"`151152### Pagination153- Follow `nextPageToken` until absent for complete results154- Set `pageSize` explicitly (default 100, max 1000)155- De-duplicate results if running multiple searches156157### Export Formats158For Google Workspace files, set `mime_type` to export:159- **Docs**: `application/pdf`, `text/plain`, `text/html`, `application/vnd.openxmlformats-officedocument.wordprocessingml.document`160- **Sheets**: `text/csv`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`161- **Slides**: `application/pdf`, `application/vnd.openxmlformats-officedocument.presentationml.presentation`162163## Known Pitfalls164165- **Internal storage required**: Upload requires files in internal S3 storage (s3key)166- **Export vs download**: Set `mime_type` ONLY for Google Workspace files; omit for native files167- **Temporary URLs**: Downloaded content via `s3url` is temporary; fetch promptly168- **Query complexity**: >5-10 OR clauses may error; split complex searches into multiple queries169- **Shared drive scoping**: Missing drive permissions yield empty results; verify access first170- **No wildcards**: Use `contains` operator instead of `*` for partial name matching171- **Folder creation chains**: Always pass folder IDs (not names) as `parent_id`172- **Multiple parents**: Move operations may leave items with multiple parents; use `remove_parents`173- **Rate limits**: Heavy searches/exports can trigger 403/429; implement backoff174175## Quick Reference176177| Task | Tool Slug | Key Params |178|------|-----------|------------|179| Search files | `GOOGLEDRIVE_FIND_FILE` | `q`, `corpora`, `pageSize` |180| List files | `GOOGLEDRIVE_LIST_FILES` | `folderId`, `q`, `orderBy` |181| Upload file | `GOOGLEDRIVE_UPLOAD_FILE` | `file_to_upload`, `folder_to_upload_to` |182| Resumable upload | `GOOGLEDRIVE_RESUMABLE_UPLOAD` | file data |183| Download file | `GOOGLEDRIVE_DOWNLOAD_FILE` | `file_id`, `mime_type` (Workspace only) |184| File metadata | `GOOGLEDRIVE_GET_FILE_METADATA` | `fileId`, `fields` |185| Create folder | `GOOGLEDRIVE_CREATE_FOLDER` | `name`, `parent_id` |186| Move file | `GOOGLEDRIVE_MOVE_FILE` | `file_id`, `add_parents`, `remove_parents` |187| Share file | `GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE` | `file_id`, `role`, `type`, `email_address` |188| List permissions | `GOOGLEDRIVE_LIST_PERMISSIONS` | `fileId` |189| Update permission | `GOOGLEDRIVE_UPDATE_PERMISSION` | file_id, permission_id |190| Delete permission | `GOOGLEDRIVE_DELETE_PERMISSION` | file_id, permission_id |191| List shared drives | `GOOGLEDRIVE_LIST_SHARED_DRIVES` | `pageSize` |192| Drive info | `GOOGLEDRIVE_GET_ABOUT` | (none) |193| Create shortcut | `GOOGLEDRIVE_CREATE_SHORTCUT_TO_FILE` | target file_id |194
Full transparency — inspect the skill content before installing.