manage_drive_access
Manage Google Drive file and folder access by granting, batch-granting, updating, revoking permissions, and transferring ownership in a single action.
Instructions
Consolidated tool for managing Google Drive file and folder access permissions.
Supports granting, batch-granting, updating, revoking permissions, and transferring file ownership -- all through a single entry point.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file or folder. Required. action (str): The access management action to perform. Required. One of: - "grant": Share with a single user, group, domain, or anyone. - "grant_batch": Share with multiple recipients in one call. - "update": Modify an existing permission (role or expiration). - "revoke": Remove an existing permission. - "transfer_owner": Transfer file ownership to another user. share_with (Optional[str]): Email address (user/group), domain name (domain), or omit for 'anyone'. Used by "grant". role (Optional[str]): Permission role -- 'reader', 'commenter', or 'writer'. Used by "grant" (defaults to 'reader') and "update". share_type (str): Type of sharing -- 'user', 'group', 'domain', or 'anyone'. Used by "grant". Defaults to 'user'. permission_id (Optional[str]): The permission ID to modify or remove. Required for "update" and "revoke" actions. recipients (Optional[List[Dict[str, Any]]]): List of recipient objects for "grant_batch". Each should have: email (str), role (str, optional), share_type (str, optional), expiration_time (str, optional). For domain shares use 'domain' field instead of 'email'. send_notification (bool): Whether to send notification emails. Defaults to True. Used by "grant" and "grant_batch". email_message (Optional[str]): Custom notification email message. Used by "grant" and "grant_batch". expiration_time (Optional[str]): Expiration in RFC 3339 format (e.g., "2025-01-15T00:00:00Z"). Used by "grant" and "update". allow_file_discovery (Optional[bool]): For 'domain'/'anyone' shares, whether the file appears in search. Used by "grant". new_owner_email (Optional[str]): Email of the new owner. Required for "transfer_owner". move_to_new_owners_root (bool): Move file to the new owner's My Drive root. Defaults to False. Used by "transfer_owner".
Returns: str: Confirmation with details of the permission change applied.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | ||
| action | Yes | ||
| file_id | Yes | ||
| recipients | No | ||
| share_type | No | user | |
| share_with | No | ||
| email_message | No | ||
| permission_id | No | ||
| expiration_time | No | ||
| new_owner_email | No | ||
| send_notification | No | ||
| user_google_email | Yes | ||
| allow_file_discovery | No | ||
| move_to_new_owners_root | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |