google-drive-automation
Original:🇺🇸 English
Not Translated
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.
2installs
Sourceaaaaqwq/agi-super-skills
Added on
NPX Install
npx skill4agent add aaaaqwq/agi-super-skills google-drive-automationSKILL.md Content
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 with toolkit
RUBE_MANAGE_CONNECTIONSgoogledrive - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
Setup
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSgoogledrive - 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:
- - Locate target folder for upload [Prerequisite]
GOOGLEDRIVE_FIND_FILE - - Upload a file (max 5MB) [Required]
GOOGLEDRIVE_UPLOAD_FILE - - Upload large files [Fallback]
GOOGLEDRIVE_RESUMABLE_UPLOAD - - Download a file by ID [Required]
GOOGLEDRIVE_DOWNLOAD_FILE - - Track long-running downloads [Fallback]
GOOGLEDRIVE_DOWNLOAD_FILE_OPERATION - - Verify file after upload/download [Optional]
GOOGLEDRIVE_GET_FILE_METADATA
Key parameters:
- : Object with
file_to_upload,name, andmimetype(file must be in internal storage)s3key - : Target folder ID (optional; uploads to root if omitted)
folder_to_upload_to - : ID of file to download
file_id - : Export format for Google Workspace files only (omit for native files)
mime_type
Pitfalls:
- requires
GOOGLEDRIVE_UPLOAD_FILE; files must already be in internal storagefile_to_upload.s3key - For non-Google formats (Excel, PDF), do NOT set ; it causes errors for native files
mime_type - Download responses provide a temporary URL at , not inline bytes
data.downloaded_file_content.s3url - Use for files >5MB or when basic uploads fail
GOOGLEDRIVE_RESUMABLE_UPLOAD
2. Search and List Files
When to use: User wants to find specific files or browse Drive contents
Tool sequence:
- - Search by name, content, type, date, or folder [Required]
GOOGLEDRIVE_FIND_FILE - - Browse files with folder scoping [Alternative]
GOOGLEDRIVE_LIST_FILES - - Enumerate shared drives [Optional]
GOOGLEDRIVE_LIST_SHARED_DRIVES - - Get detailed file info [Optional]
GOOGLEDRIVE_GET_FILE_METADATA - - Check storage quota and supported formats [Optional]
GOOGLEDRIVE_GET_ABOUT
Key parameters:
- : Drive query string (e.g., "name contains 'report'", "mimeType = 'application/pdf'")
q - : Search scope ('user', 'domain', 'drive', 'allDrives')
corpora - : Response fields to include (e.g., 'files(id,name,mimeType)')
fields - : Sort key ('modifiedTime desc', 'name', 'quotaBytesUsed desc')
orderBy - : Results per page (max 1000)
pageSize - : Pagination cursor from
pageTokennextPageToken - : Scope search to a specific folder
folder_id
Pitfalls:
- 403 PERMISSION_DENIED if OAuth scopes insufficient for shared drives
- Pagination required; files are in ; follow
response.data.filesuntil exhaustednextPageToken - may trigger 400; try
corpora="domain"with"allDrives"includeItemsFromAllDrives=true - Query complexity limits: >5-10 OR clauses may error "The query is too complex"
- Wildcards (*) NOT supported in ; use
namefor partial matchingcontains - 'My Drive' is NOT searchable by name; use for root folder
folder_id='root' - User email searches: use (NOT
'user@example.com' in owners)owner:user@example.com
3. Share Files and Manage Permissions
When to use: User wants to share files or manage access permissions
Tool sequence:
- - Locate the file to share [Prerequisite]
GOOGLEDRIVE_FIND_FILE - - Set sharing permission [Required]
GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE - - View current permissions [Optional]
GOOGLEDRIVE_LIST_PERMISSIONS - - Inspect a specific permission [Optional]
GOOGLEDRIVE_GET_PERMISSION - - Modify existing permission [Optional]
GOOGLEDRIVE_UPDATE_PERMISSION - - Revoke access [Optional]
GOOGLEDRIVE_DELETE_PERMISSION
Key parameters:
- : ID of file to share
file_id - : 'user', 'group', 'domain', or 'anyone'
type - : 'owner', 'organizer', 'fileOrganizer', 'writer', 'commenter', 'reader'
role - : Required for type='user' or 'group'
email_address - : Required for type='domain'
domain - : Required when role='owner'
transfer_ownership
Pitfalls:
- Invalid type/email combinations trigger 4xx errors
- Using or powerful roles is risky; get explicit user confirmation
type='anyone' - Org policies may block certain sharing types, causing 403
- Permission changes may take time to propagate
- Use to resolve contact names to emails before sharing
GMAIL_SEARCH_PEOPLE
4. Create and Organize Folders
When to use: User wants to create folder structures or move files between folders
Tool sequence:
- - Check if folder already exists [Prerequisite]
GOOGLEDRIVE_FIND_FILE - - Create a new folder [Required]
GOOGLEDRIVE_CREATE_FOLDER - - Verify created folder [Optional]
GOOGLEDRIVE_GET_FILE_METADATA - - Move files between folders [Optional]
GOOGLEDRIVE_MOVE_FILE - - Update file metadata/parents [Alternative]
GOOGLEDRIVE_UPDATE_FILE_PUT
Key parameters:
- : Folder name
name - : Parent folder ID (NOT name); omit for root
parent_id - : File to move
file_id - : Destination folder ID for move
add_parents - : Source folder ID to remove from
remove_parents
Pitfalls:
- requires
GOOGLEDRIVE_CREATE_FOLDERas an ID, not a folder nameparent_id - Using creates at top level; for nested paths, chain folder IDs
parent_id="root" - returns ~100 items/page; follow
GOOGLEDRIVE_FIND_FILEfor large drivesnextPageToken - Move operations can leave items with multiple parents; use for true moves
remove_parents - Always verify parent folder exists before creating children
Common Patterns
ID Resolution
- File/folder name -> ID: with
GOOGLEDRIVE_FIND_FILEparameterq - Root folder: Use or
folder_id='root''root' in parents - Shared drive -> driveId:
GOOGLEDRIVE_LIST_SHARED_DRIVES - Contact name -> email: (for sharing)
GMAIL_SEARCH_PEOPLE
Query Syntax
Google Drive uses a specific query language:
- Name search: or
"name contains 'report'""name = 'exact.pdf'" - Type filter: or
"mimeType = 'application/pdf'""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 until absent for complete results
nextPageToken - Set explicitly (default 100, max 1000)
pageSize - De-duplicate results if running multiple searches
Export Formats
For Google Workspace files, set to export:
mime_type- Docs: ,
application/pdf,text/plain,text/htmlapplication/vnd.openxmlformats-officedocument.wordprocessingml.document - Sheets: ,
text/csvapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet - Slides: ,
application/pdfapplication/vnd.openxmlformats-officedocument.presentationml.presentation
Known Pitfalls
- Internal storage required: Upload requires files in internal S3 storage (s3key)
- Export vs download: Set ONLY for Google Workspace files; omit for native files
mime_type - Temporary URLs: Downloaded content via is temporary; fetch promptly
s3url - 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 operator instead of
containsfor 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 | | |
| List files | | |
| Upload file | | |
| Resumable upload | | file data |
| Download file | | |
| File metadata | | |
| Create folder | | |
| Move file | | |
| Share file | | |
| List permissions | | |
| Update permission | | file_id, permission_id |
| Delete permission | | file_id, permission_id |
| List shared drives | | |
| Drive info | | (none) |
| Create shortcut | | target file_id |