Remove someone’s access
unshare_docRevoke access to a Google Doc after verifying the current role first. Built-in role check ensures safe, intentional removal of sharing permissions.
Instructions
Revoke a grant on a Google Doc. Pass email for a person or a group. A grant with no email — a domain-wide grant, or anyone-with-link — has no email to pass, so address it by permissionId from list_permissions (run that first; it also tells you the role you are about to remove). Refuses to touch the owner. expectRole is REQUIRED — run list_permissions first and echo the role back; a permission change is recorded nowhere and cannot be restored from version history, so this is the only thing standing between a misaimed call and a silent, unrecoverable revocation. Note a doc created under a Workspace domain may carry a domain grant nobody explicitly added.
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": {
"path": "<path>",
"expectRole": "<expectRole>"
},
"name": "unshare_doc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The doc: a Drive id or URL, or /folder/doc. A tab path names its doc. | |
| No | person or group to revoke; omit when using permissionId | ||
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| expectRole | Yes | REQUIRED — the grant's current role as list_permissions reported it (reader/commenter/writer). Verified first: if it changed since you looked, nothing is removed. Revoking leaves no record anywhere, so this makes you look before you cut. | |
| expectTitle | No | the doc’s title; verified before revoking so a wrong id is refused | |
| permissionId | No | id from list_permissions — the only way to revoke a domain or anyone-with-link grant |