addPermission
Shares a Google Drive file or folder by adding a permission for a user, group, domain, or anyone with the link, with configurable access role and notification options.
Instructions
Shares a Drive file or folder by adding a new sharing permission. Supports sharing with a user, group, entire domain, or anyone with the link. Use listPermissions to see existing shares, updatePermission to change a role, or removePermission to revoke access.
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": {
"fileId": "<fileId>",
"type": "<type>",
"role": "<role>"
},
"name": "addPermission"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | Yes | Access level granted. Use owner only with transferOwnership=true. | |
| type | Yes | Grantee type. 'user' and 'group' require emailAddress; 'domain' requires domain; 'anyone' is link sharing. | |
| domain | No | Domain to share with (required when type is 'domain'). | |
| fileId | Yes | The ID of the file or folder to share. | |
| emailAddress | No | Email address of the user or group (required when type is 'user' or 'group'). | |
| emailMessage | No | Custom message to include in the notification email (only applies when sendNotificationEmail is true). | |
| transferOwnership | No | Set to true when transferring ownership (role must be 'owner'). | |
| allowFileDiscovery | No | For type 'domain' or 'anyone': whether the file can be discovered via search. Defaults to false (link-only). | |
| sendNotificationEmail | No | Whether Google should send a notification email (default: true for user/group, false for domain/anyone). |