Skip to main content
Glama

Remove someone’s access

unshare_doc

Revoke a person's, group's, or link-based access grant on a Google Doc after verifying the current role, preventing accidental and unrecoverable permission removal.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailNoperson or group to revoke; omit when using permissionId
accountNoGoogle account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account.
documentIdYes
expectRoleYesREQUIRED — 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.
expectTitleNothe doc’s title; verified before revoking so a wrong id is refused
permissionIdNoid from list_permissions — the only way to revoke a domain or anyone-with-link grant
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so thoroughly. It discloses that the operation is irreversible ('recorded nowhere and cannot be restored'), refuses to touch the owner, and verifies the current role before removal so nothing is deleted if the grant changed. This goes well beyond a generic 'revoke access' statement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action and includes dense, high-value warnings. However, the instruction to run list_permissions first is stated multiple times, and the irreversibility warning is repeated in slightly different forms, adding mild redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as an irreversible, potentially destructive operation with no annotations or output schema, the description covers all essential operational context: how to identify the target, the mandatory expectRole check, the domain-grant caveat, and owner protection. No critical gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite high schema coverage (83%), the description adds significant meaning by mapping email to person/group, permissionId to domain or anyone-with-link grants, and explaining that expectRole is a safety echo from list_permissions. It also clarifies that expectTitle prevents wrong-document revocations, enriching the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Revoke a grant on a Google Doc,' which is a specific verb and resource, and the title 'Remove someone’s access' reinforces the intent. It clearly distinguishes from the sibling share_doc (granting access) and list_permissions (reading permissions).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly instructs to run list_permissions first, and explains when to use email (person/group) versus permissionId (domain-wide or anyone-with-link grants). It also mandates that expectRole must be echoed from list_permissions, giving clear preconditions and preventing misuse.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dasasian/gdocs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server