Drive Share File
drive_share_fileShare Google Drive files or folders with users, groups, domains, or anyone with the link, and update existing permissions, roles, expiry, or discoverability.
Instructions
Share a Drive file or folder with a person, group, domain or anyone with the link, or with permission_id change an existing grant's role, expiry or discoverability. To revoke access use drive_unshare_file; find permission_id with drive_list_permissions. Returns status 'ok', mode 'created' or 'updated' and permission (id, type, role, email_address, domain, display_name, allow_file_discovery, pending_owner, expires_at; deleted is null), or status 'cancelled' if the user declines. Every share or change asks the user to confirm first, shown who gets which access; Google emails new user and group grantees by default.
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": {
"file_id": "<file_id>"
},
"name": "drive_share_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Access level: reader, commenter, writer, fileOrganizer or organizer (shared drives only), or owner (ownership transfer). Required to create a grant; in update mode omit it to keep the current role. | |
| type | No | Who receives access, required to create a grant: 'user' or 'group' (set email_address), 'domain' (everyone in a Google Workspace domain; set domain), or 'anyone' (anyone with the link, no sign-in). | |
| domain | No | Domain to share with, e.g. 'example.com'; required for type 'domain'. | |
| file_id | Yes | Drive file ID: the id field of Drive and search_workspace results, or the long ID in a Drive, Docs, Sheets or Slides URL. | |
| email_address | No | Email address of the person or Google group to share with; required for type user or group. | |
| email_message | No | Create mode: plain-text message added to the sharing notification email sent to a user or group. | |
| permission_id | No | Existing grant to change, from drive_list_permissions; selects update mode, where type, email_address, domain, email_message and send_notification_email are rejected because a grant's grantee cannot change. Omit to create a new grant. | |
| expiration_time | No | RFC3339 time at which the access expires, e.g. '2026-12-31T23:59:59Z'; must be in the future and at most a year ahead. Applies to user and group grants only. | |
| remove_expiration | No | Update mode only: true clears the grant's expiration so access no longer ends; overrides expiration_time. | |
| transfer_ownership | No | Must be true when role is 'owner', confirming that ownership of the file moves to the grantee. | |
| allow_file_discovery | No | For type 'domain' or 'anyone' only: whether people can find the file by searching instead of needing the link. | |
| send_notification_email | No | Create mode, type user or group: false shares silently. Omitted, Google emails the grantee; it cannot be false for an ownership transfer. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| status | No | Machine-readable operation status. | |
| permission | No | Sharing grant; a field Google did not return is null. |