set_drive_file_permissions
Sets sharing settings for a Google Drive file or folder by toggling anyone-with-the-link access and controlling editor sharing or viewer copy permissions.
Instructions
Sets file-level sharing settings and controls link sharing for a Google Drive file or folder.
This is a high-level tool for the most common permission changes. Use this to toggle "anyone with the link" access or configure file-level sharing behavior. For managing individual user/group permissions, use share_drive_file or update_drive_permission instead.
Args: user_google_email (str): The user's Google email address. Required. file_id (str): The ID of the file or folder. Required. link_sharing (Optional[str]): Control "anyone with the link" access for the file. - "off": Disable "anyone with the link" access for this file. - "reader": Anyone with the link can view. - "commenter": Anyone with the link can comment. - "writer": Anyone with the link can edit. writers_can_share (Optional[bool]): Whether editors can change permissions and share. If False, only the owner can share. Defaults to None (no change). copy_requires_writer_permission (Optional[bool]): Whether viewers and commenters are prevented from copying, printing, or downloading. Defaults to None (no change).
Returns: str: Summary of all permission changes applied to the file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"user_google_email": "<user_google_email>",
"file_id": "<file_id>"
},
"name": "set_drive_file_permissions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | ||
| link_sharing | No | ||
| user_google_email | Yes | ||
| writers_can_share | No | ||
| copy_requires_writer_permission | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |