{"slug":"google-drive-automation-2","title":"google-drive-automation","summary":"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.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-14T20:43:33.334819Z","repo":{"url":"https://github.com/davepoon/buildwithclaude","stars":3556,"forks":535,"license":"MIT","updatedAt":"2026-09-27T03:56:38Z"},"bodyHtml":"<hr>\n<h2>name: google-drive-automation\ndescription: 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.\nrequires:\nmcp: [rube]\ncategory: storage-docs</h2>\n<h1>Google Drive Automation via Rube MCP</h1>\n<p>Automate Google Drive workflows including file upload/download, search, folder management, sharing/permissions, and organization through Composio's Google Drive toolkit.</p>\n<p><strong>Toolkit docs</strong>: <a href=\"https://composio.dev/toolkits/googledrive\">composio.dev/toolkits/googledrive</a></p>\n<h2>Prerequisites</h2>\n<ul>\n<li>Rube MCP must be connected (RUBE_SEARCH_TOOLS available)</li>\n<li>Active Google Drive connection via <code>RUBE_MANAGE_CONNECTIONS</code> with toolkit <code>googledrive</code></li>\n<li>Always call <code>RUBE_SEARCH_TOOLS</code> first to get current tool schemas</li>\n</ul>\n<h2>Setup</h2>\n<p><strong>Get Rube MCP</strong>: Add <code>https://rube.app/mcp</code> as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.</p>\n<ol>\n<li>Verify Rube MCP is available by confirming <code>RUBE_SEARCH_TOOLS</code> responds</li>\n<li>Call <code>RUBE_MANAGE_CONNECTIONS</code> with toolkit <code>googledrive</code></li>\n<li>If connection is not ACTIVE, follow the returned auth link to complete Google OAuth</li>\n<li>Confirm connection status shows ACTIVE before running any workflows</li>\n</ol>\n<h2>Core Workflows</h2>\n<h3>1. Upload and Download Files</h3>\n<p><strong>When to use</strong>: User wants to upload files to or download files from Google Drive</p>\n<p><strong>Tool sequence</strong>:</p>\n<ol>\n<li><code>GOOGLEDRIVE_FIND_FILE</code> - Locate target folder for upload [Prerequisite]</li>\n<li><code>GOOGLEDRIVE_UPLOAD_FILE</code> - Upload a file (max 5MB) [Required]</li>\n<li><code>GOOGLEDRIVE_RESUMABLE_UPLOAD</code> - Upload large files [Fallback]</li>\n<li><code>GOOGLEDRIVE_DOWNLOAD_FILE</code> - Download a file by ID [Required]</li>\n<li><code>GOOGLEDRIVE_DOWNLOAD_FILE_OPERATION</code> - Track long-running downloads [Fallback]</li>\n<li><code>GOOGLEDRIVE_GET_FILE_METADATA</code> - Verify file after upload/download [Optional]</li>\n</ol>\n<p><strong>Key parameters</strong>:</p>\n<ul>\n<li><code>file_to_upload</code>: Object with <code>name</code>, <code>mimetype</code>, and <code>s3key</code> (file must be in internal storage)</li>\n<li><code>folder_to_upload_to</code>: Target folder ID (optional; uploads to root if omitted)</li>\n<li><code>file_id</code>: ID of file to download</li>\n<li><code>mime_type</code>: Export format for Google Workspace files only (omit for native files)</li>\n</ul>\n<p><strong>Pitfalls</strong>:</p>\n<ul>\n<li><code>GOOGLEDRIVE_UPLOAD_FILE</code> requires <code>file_to_upload.s3key</code>; files must already be in internal storage</li>\n<li>For non-Google formats (Excel, PDF), do NOT set <code>mime_type</code>; it causes errors for native files</li>\n<li>Download responses provide a temporary URL at <code>data.downloaded_file_content.s3url</code>, not inline bytes</li>\n<li>Use <code>GOOGLEDRIVE_RESUMABLE_UPLOAD</code> for files &gt;5MB or when basic uploads fail</li>\n</ul>\n<h3>2. Search and List Files</h3>\n<p><strong>When to use</strong>: User wants to find specific files or browse Drive contents</p>\n<p><strong>Tool sequence</strong>:</p>\n<ol>\n<li><code>GOOGLEDRIVE_FIND_FILE</code> - Search by name, content, type, date, or folder [Required]</li>\n<li><code>GOOGLEDRIVE_LIST_FILES</code> - Browse files with folder scoping [Alternative]</li>\n<li><code>GOOGLEDRIVE_LIST_SHARED_DRIVES</code> - Enumerate shared drives [Optional]</li>\n<li><code>GOOGLEDRIVE_GET_FILE_METADATA</code> - Get detailed file info [Optional]</li>\n<li><code>GOOGLEDRIVE_GET_ABOUT</code> - Check storage quota and supported formats [Optional]</li>\n</ol>\n<p><strong>Key parameters</strong>:</p>\n<ul>\n<li><code>q</code>: Drive query string (e.g., \"name contains 'report'\", \"mimeType = 'application/pdf'\")</li>\n<li><code>corpora</code>: Search scope ('user', 'domain', 'drive', 'allDrives')</li>\n<li><code>fields</code>: Response fields to include (e.g., 'files(id,name,mimeType)')</li>\n<li><code>orderBy</code>: Sort key ('modifiedTime desc', 'name', 'quotaBytesUsed desc')</li>\n<li><code>pageSize</code>: Results per page (max 1000)</li>\n<li><code>pageToken</code>: Pagination cursor from <code>nextPageToken</code></li>\n<li><code>folder_id</code>: Scope search to a specific folder</li>\n</ul>\n<p><strong>Pitfalls</strong>:</p>\n<ul>\n<li>403 PERMISSION_DENIED if OAuth scopes insufficient for shared drives</li>\n<li>Pagination required; files are in <code>response.data.files</code>; follow <code>nextPageToken</code> until exhausted</li>\n<li><code>corpora=\"domain\"</code> may trigger 400; try <code>\"allDrives\"</code> with <code>includeItemsFromAllDrives=true</code></li>\n<li>Query complexity limits: &gt;5-10 OR clauses may error \"The query is too complex\"</li>\n<li>Wildcards (*) NOT supported in <code>name</code>; use <code>contains</code> for partial matching</li>\n<li>'My Drive' is NOT searchable by name; use <code>folder_id='root'</code> for root folder</li>\n<li>User email searches: use <code>'user@example.com' in owners</code> (NOT <code>owner:user@example.com</code>)</li>\n</ul>\n<h3>3. Share Files and Manage Permissions</h3>\n<p><strong>When to use</strong>: User wants to share files or manage access permissions</p>\n<p><strong>Tool sequence</strong>:</p>\n<ol>\n<li><code>GOOGLEDRIVE_FIND_FILE</code> - Locate the file to share [Prerequisite]</li>\n<li><code>GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE</code> - Set sharing permission [Required]</li>\n<li><code>GOOGLEDRIVE_LIST_PERMISSIONS</code> - View current permissions [Optional]</li>\n<li><code>GOOGLEDRIVE_GET_PERMISSION</code> - Inspect a specific permission [Optional]</li>\n<li><code>GOOGLEDRIVE_UPDATE_PERMISSION</code> - Modify existing permission [Optional]</li>\n<li><code>GOOGLEDRIVE_DELETE_PERMISSION</code> - Revoke access [Optional]</li>\n</ol>\n<p><strong>Key parameters</strong>:</p>\n<ul>\n<li><code>file_id</code>: ID of file to share</li>\n<li><code>type</code>: 'user', 'group', 'domain', or 'anyone'</li>\n<li><code>role</code>: 'owner', 'organizer', 'fileOrganizer', 'writer', 'commenter', 'reader'</li>\n<li><code>email_address</code>: Required for type='user' or 'group'</li>\n<li><code>domain</code>: Required for type='domain'</li>\n<li><code>transfer_ownership</code>: Required when role='owner'</li>\n</ul>\n<p><strong>Pitfalls</strong>:</p>\n<ul>\n<li>Invalid type/email combinations trigger 4xx errors</li>\n<li>Using <code>type='anyone'</code> or powerful roles is risky; get explicit user confirmation</li>\n<li>Org policies may block certain sharing types, causing 403</li>\n<li>Permission changes may take time to propagate</li>\n<li>Use <code>GMAIL_SEARCH_PEOPLE</code> to resolve contact names to emails before sharing</li>\n</ul>\n<h3>4. Create and Organize Folders</h3>\n<p><strong>When to use</strong>: User wants to create folder structures or move files between folders</p>\n<p><strong>Tool sequence</strong>:</p>\n<ol>\n<li><code>GOOGLEDRIVE_FIND_FILE</code> - Check if folder already exists [Prerequisite]</li>\n<li><code>GOOGLEDRIVE_CREATE_FOLDER</code> - Create a new folder [Required]</li>\n<li><code>GOOGLEDRIVE_GET_FILE_METADATA</code> - Verify created folder [Optional]</li>\n<li><code>GOOGLEDRIVE_MOVE_FILE</code> - Move files between folders [Optional]</li>\n<li><code>GOOGLEDRIVE_UPDATE_FILE_PUT</code> - Update file metadata/parents [Alternative]</li>\n</ol>\n<p><strong>Key parameters</strong>:</p>\n<ul>\n<li><code>name</code>: Folder name</li>\n<li><code>parent_id</code>: Parent folder ID (NOT name); omit for root</li>\n<li><code>file_id</code>: File to move</li>\n<li><code>add_parents</code>: Destination folder ID for move</li>\n<li><code>remove_parents</code>: Source folder ID to remove from</li>\n</ul>\n<p><strong>Pitfalls</strong>:</p>\n<ul>\n<li><code>GOOGLEDRIVE_CREATE_FOLDER</code> requires <code>parent_id</code> as an ID, not a folder name</li>\n<li>Using <code>parent_id=\"root\"</code> creates at top level; for nested paths, chain folder IDs</li>\n<li><code>GOOGLEDRIVE_FIND_FILE</code> returns ~100 items/page; follow <code>nextPageToken</code> for large drives</li>\n<li>Move operations can leave items with multiple parents; use <code>remove_parents</code> for true moves</li>\n<li>Always verify parent folder exists before creating children</li>\n</ul>\n<h2>Common Patterns</h2>\n<h3>ID Resolution</h3>\n<ul>\n<li><strong>File/folder name -&gt; ID</strong>: <code>GOOGLEDRIVE_FIND_FILE</code> with <code>q</code> parameter</li>\n<li><strong>Root folder</strong>: Use <code>folder_id='root'</code> or <code>'root' in parents</code></li>\n<li><strong>Shared drive -&gt; driveId</strong>: <code>GOOGLEDRIVE_LIST_SHARED_DRIVES</code></li>\n<li><strong>Contact name -&gt; email</strong>: <code>GMAIL_SEARCH_PEOPLE</code> (for sharing)</li>\n</ul>\n<h3>Query Syntax</h3>\n<p>Google Drive uses a specific query language:</p>\n<ul>\n<li>Name search: <code>\"name contains 'report'\"</code> or <code>\"name = 'exact.pdf'\"</code></li>\n<li>Type filter: <code>\"mimeType = 'application/pdf'\"</code> or <code>\"mimeType = 'application/vnd.google-apps.folder'\"</code></li>\n<li>Folder scoping: <code>\"'FOLDER_ID' in parents\"</code></li>\n<li>Date filter: <code>\"modifiedTime &gt; '2024-01-01T00:00:00'\"</code></li>\n<li>Combine with <code>and</code>/<code>or</code>/<code>not</code>: <code>\"name contains 'report' and trashed = false\"</code></li>\n<li>Boolean filters: <code>\"sharedWithMe = true\"</code>, <code>\"starred = true\"</code>, <code>\"trashed = false\"</code></li>\n</ul>\n<h3>Pagination</h3>\n<ul>\n<li>Follow <code>nextPageToken</code> until absent for complete results</li>\n<li>Set <code>pageSize</code> explicitly (default 100, max 1000)</li>\n<li>De-duplicate results if running multiple searches</li>\n</ul>\n<h3>Export Formats</h3>\n<p>For Google Workspace files, set <code>mime_type</code> to export:</p>\n<ul>\n<li><strong>Docs</strong>: <code>application/pdf</code>, <code>text/plain</code>, <code>text/html</code>, <code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code></li>\n<li><strong>Sheets</strong>: <code>text/csv</code>, <code>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</code></li>\n<li><strong>Slides</strong>: <code>application/pdf</code>, <code>application/vnd.openxmlformats-officedocument.presentationml.presentation</code></li>\n</ul>\n<h2>Known Pitfalls</h2>\n<ul>\n<li><strong>Internal storage required</strong>: Upload requires files in internal S3 storage (s3key)</li>\n<li><strong>Export vs download</strong>: Set <code>mime_type</code> ONLY for Google Workspace files; omit for native files</li>\n<li><strong>Temporary URLs</strong>: Downloaded content via <code>s3url</code> is temporary; fetch promptly</li>\n<li><strong>Query complexity</strong>: &gt;5-10 OR clauses may error; split complex searches into multiple queries</li>\n<li><strong>Shared drive scoping</strong>: Missing drive permissions yield empty results; verify access first</li>\n<li><strong>No wildcards</strong>: Use <code>contains</code> operator instead of <code>*</code> for partial name matching</li>\n<li><strong>Folder creation chains</strong>: Always pass folder IDs (not names) as <code>parent_id</code></li>\n<li><strong>Multiple parents</strong>: Move operations may leave items with multiple parents; use <code>remove_parents</code></li>\n<li><strong>Rate limits</strong>: Heavy searches/exports can trigger 403/429; implement backoff</li>\n</ul>\n<h2>Quick Reference</h2>\n<table>\n<thead>\n<tr>\n<th>Task</th>\n<th>Tool Slug</th>\n<th>Key Params</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Search files</td>\n<td><code>GOOGLEDRIVE_FIND_FILE</code></td>\n<td><code>q</code>, <code>corpora</code>, <code>pageSize</code></td>\n</tr>\n<tr>\n<td>List files</td>\n<td><code>GOOGLEDRIVE_LIST_FILES</code></td>\n<td><code>folderId</code>, <code>q</code>, <code>orderBy</code></td>\n</tr>\n<tr>\n<td>Upload file</td>\n<td><code>GOOGLEDRIVE_UPLOAD_FILE</code></td>\n<td><code>file_to_upload</code>, <code>folder_to_upload_to</code></td>\n</tr>\n<tr>\n<td>Resumable upload</td>\n<td><code>GOOGLEDRIVE_RESUMABLE_UPLOAD</code></td>\n<td>file data</td>\n</tr>\n<tr>\n<td>Download file</td>\n<td><code>GOOGLEDRIVE_DOWNLOAD_FILE</code></td>\n<td><code>file_id</code>, <code>mime_type</code> (Workspace only)</td>\n</tr>\n<tr>\n<td>File metadata</td>\n<td><code>GOOGLEDRIVE_GET_FILE_METADATA</code></td>\n<td><code>fileId</code>, <code>fields</code></td>\n</tr>\n<tr>\n<td>Create folder</td>\n<td><code>GOOGLEDRIVE_CREATE_FOLDER</code></td>\n<td><code>name</code>, <code>parent_id</code></td>\n</tr>\n<tr>\n<td>Move file</td>\n<td><code>GOOGLEDRIVE_MOVE_FILE</code></td>\n<td><code>file_id</code>, <code>add_parents</code>, <code>remove_parents</code></td>\n</tr>\n<tr>\n<td>Share file</td>\n<td><code>GOOGLEDRIVE_ADD_FILE_SHARING_PREFERENCE</code></td>\n<td><code>file_id</code>, <code>role</code>, <code>type</code>, <code>email_address</code></td>\n</tr>\n<tr>\n<td>List permissions</td>\n<td><code>GOOGLEDRIVE_LIST_PERMISSIONS</code></td>\n<td><code>fileId</code></td>\n</tr>\n<tr>\n<td>Update permission</td>\n<td><code>GOOGLEDRIVE_UPDATE_PERMISSION</code></td>\n<td>file_id, permission_id</td>\n</tr>\n<tr>\n<td>Delete permission</td>\n<td><code>GOOGLEDRIVE_DELETE_PERMISSION</code></td>\n<td>file_id, permission_id</td>\n</tr>\n<tr>\n<td>List shared drives</td>\n<td><code>GOOGLEDRIVE_LIST_SHARED_DRIVES</code></td>\n<td><code>pageSize</code></td>\n</tr>\n<tr>\n<td>Drive info</td>\n<td><code>GOOGLEDRIVE_GET_ABOUT</code></td>\n<td>(none)</td>\n</tr>\n<tr>\n<td>Create shortcut</td>\n<td><code>GOOGLEDRIVE_CREATE_SHORTCUT_TO_FILE</code></td>\n<td>target file_id</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<p><em>Powered by <a href=\"https://composio.dev\">Composio</a></em></p>\n","files":[{"path":"SKILL.md","sizeBytes":10105,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-14T20:45:42.595669Z","sha256":"43E57EDD0DB6C498B0A7F5BEE0F401D7D030B4420EC55446B0CD2AD0A7D4EDF0","sizeBytes":3936},"review":null,"source":{"repositoryUrl":"https://github.com/davepoon/buildwithclaude","path":"plugins/all-skills/skills/google-drive-automation","license":"MIT","commit":"6178ae2b0900b3600419853206de1dddf0f28311","subtreeSha":"A0D30AA8CC454877CB1316BE7DEFB612317D75B87BC37D1171FFEC5A6124E2B3","lastSyncedAt":"2026-09-27T19:47:46.68834Z"},"reviewedAt":"2026-09-14T20:49:54.812693Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/davepoon/buildwithclaude/tree/main/plugins/all-skills/skills/google-drive-automation"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install davepoon-buildwithclaude@llmmart"},{"target":"git","command":"git clone https://github.com/davepoon/buildwithclaude.git"}]}