manage_drive
Search, upload, download, share, comment, and manage files, folders, and permissions in Google Drive. Handles file operations and collaboration tasks.
Instructions
Search, upload, download, share, comment on, or manage files in Google Drive.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | File name in Drive. On `upload`, defaults to the local file's name. On `copy`, the name for the copy — without it Drive names it 'Copy of <original>'. On `update`, the new name (a rename). On `createFolder`, the folder name. | |
| role | No | Permission level. On `share`, the level to grant — defaults to `reader`. On `setRole`, the new level, and it is REQUIRED there: with no default to fall back on, an omitted role would silently demote the collaborator, and setRole sends no notification. | |
| type | No | Permission type (default: 'user'). Use 'group' for Google Groups, 'domain' to share with an entire G Suite domain, 'anyone' for public links. | |
| Yes | Account email address | ||
| query | No | Drive search query (e.g. "name contains 'budget'" or "mimeType='application/pdf'") | |
| domain | No | Domain name (required when type is 'domain'). | |
| fileId | No | File ID | |
| content | No | Comment text. On `replyToComment`, the reply text. | |
| filePath | No | Local file path to upload | |
| folderId | No | Folder ID (pass the id returned by createFolder or search) | |
| maxDepth | No | How many folder levels to descend (default 10). The tree is labelled partial when this limit stops the walk. | |
| mimeType | No | Target format (e.g. application/pdf, text/csv, text/plain, application/vnd.openxmlformats-officedocument.wordprocessingml.document) | |
| resolved | No | true to resolve, false to reopen | |
| commentId | No | Comment ID | |
| operation | Yes | search: find files by query | get: get file metadata | upload: upload a local file to Drive | viewImage: view an image file inline without saving to workspace (png, jpg, gif, webp). Use for quick preview — use download to save. | download: download file content to local path | copy: create a copy of a file (set name to rename the copy; parentFolderId to place it in a folder) | update: rename a file (set name) and/or move it between folders (addParents / removeParents — to move, set both) | delete: permanently delete a file (cannot be undone) | trash: move a file or folder to trash (recoverable for 30 days — use instead of delete when you only need to remove it) | export: export a Google Workspace document (Docs, Sheets, Slides) to a file format | createFolder: create a new folder (optionally nested under a parent folder) | listFolder: list the files and subfolders directly inside a folder | tree: print a recursive folder tree and count the files (subfolders excluded from the count) | listPermissions: list sharing permissions on a file | share: share a file with a user, group, domain, or anyone | unshare: remove sharing permission from a file | setRole: change an existing collaborator's role (no notification email is sent) | listComments: list comments on a file | getComment: get a specific comment by ID | addComment: add a comment to a file (optionally anchored to quoted text) | resolveComment: resolve or reopen a comment | replyToComment: reply to an existing comment | |
| addParents | No | Comma-separated folder ID(s) to add as parents (move into a folder) | |
| maxResults | No | Max results (default: 10, max: 50) | |
| outputPath | No | Local path to save the file | |
| quotedText | No | Text to anchor the comment to (optional — if provided, comment is anchored to first occurrence) | |
| shareEmail | No | Email address of the collaborator. On `share`, required when type is 'user' or 'group'; omit for 'domain' (use the `domain` param) or 'anyone'. On `setRole`, the existing collaborator whose role to change. | |
| permissionId | No | Permission ID to remove (from listPermissions) | |
| removeParents | No | Comma-separated folder ID(s) to remove as parents (move out of a folder) | |
| includeDeleted | No | Include deleted comments (default: false) | |
| parentFolderId | No | Destination folder ID. On `upload`, places the file in this folder. On `copy`, defaults to the source file's folder. On `createFolder`, nests the new folder under this parent. |