Skip to main content
Glama

Drive Share File

drive_share_file
Destructive

Share 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

NameRequiredDescriptionDefault
roleNoAccess 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.
typeNoWho 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).
domainNoDomain to share with, e.g. 'example.com'; required for type 'domain'.
file_idYesDrive file ID: the id field of Drive and search_workspace results, or the long ID in a Drive, Docs, Sheets or Slides URL.
email_addressNoEmail address of the person or Google group to share with; required for type user or group.
email_messageNoCreate mode: plain-text message added to the sharing notification email sent to a user or group.
permission_idNoExisting 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_timeNoRFC3339 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_expirationNoUpdate mode only: true clears the grant's expiration so access no longer ends; overrides expiration_time.
transfer_ownershipNoMust be true when role is 'owner', confirming that ownership of the file moves to the grantee.
allow_file_discoveryNoFor type 'domain' or 'anyone' only: whether people can find the file by searching instead of needing the link.
send_notification_emailNoCreate mode, type user or group: false shares silently. Omitted, Google emails the grantee; it cannot be false for an ownership transfer.

Output Schema

NameRequiredDescriptionDefault
modeNo
statusNoMachine-readable operation status.
permissionNoSharing grant; a field Google did not return is null.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, and the description goes well beyond them: it discloses the mandatory user confirmation prompt showing who gets which access, default email notification to new user/group grantees, and the 'cancelled' outcome if the user declines. It also enumerates the returned status modes and permission fields, so the mutation's side effects and safety gate are transparent.

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?

Front-loaded with the core action and the create/update distinction, and every sentence carries information (routing, return shape, confirmation, email default). The long parenthetical field list inside the return-value sentence makes it dense and slightly harder to scan than a bulleted structure would be.

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?

For a 12-parameter destructive share tool, the description covers what an agent must know: mode selection, sibling routing for revoke and lookup, confirmation behavior, notification side effects, and outcome states including cancellation. An output schema exists, so the additional return summary is a bonus rather than a gap.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real semantic value the schema does not: permission_id flips the tool into update mode and invalidates grantee fields, and the return payload fields are named. It stops short of explaining every parameter (expiration limits, transfer_ownership are left to the schema), so it is strong but not exhaustive.

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?

States a specific verb and resource (share a Drive file or folder) plus the grantee types it supports, and explicitly covers the dual create/update mode keyed on permission_id. It names the sibling it is not (drive_unshare_file) so an agent can distinguish it from the revoke path without opening either schema.

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?

Gives explicit routing: use drive_unshare_file to revoke, drive_list_permissions to obtain permission_id, and omit permission_id to create instead of update. It also states the mode-specific constraint that type/email_address/domain/email_message/send_notification_email are rejected in update mode, which is exactly the when-not guidance an agent needs.

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

Deploy Server

Other Tools