CONNECT APP
Build with Google Drive
File Storage
- OAuth
MCP
Give your agent Google Drive tools
Every Google Drive action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Google Drive account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "google_drive",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Add Comment:
const result = await mcp.callTool({
name: "google_drive-add-comment",
arguments: {
drive: "Drive",
fileId: "File",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "google_drive",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Add Comment:
result = await session.call_tool("google_drive-add-comment", {
"drive": "Drive",
"fileId": "File",
})API PROXY
Call the Google Drive API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Google Drive API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://www.googleapis.com/drive/v3/about?fields=user",
})
// Any allowed Google Drive endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://www.googleapis.com/drive/v3/about?fields=user
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vZHJpdmUvdjMvYWJvdXQ_ZmllbGRzPXVzZXI?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Google Drive actions from your backend
Connect a user's Google Drive account once, then run Add Comment on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "google_drive-add-comment",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
google_drive: { authProvisionId: "apn_xxxxxxx" },
drive: "Drive",
fileId: "File",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="google_drive-add-comment",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"google_drive": {"authProvisionId": "apn_xxxxxxx"},
"drive": "Drive",
"fileId": "File",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "google_drive-add-comment",
"configured_props": {
"google_drive": { "authProvisionId": "apn_xxxxxxx" },
"drive": "Drive",
"fileId": "File"
}
}'TOOLS
Google Drive actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Add Comment
actionAdd an unanchored comment to a Google Doc (general feedback, no text highlighting). See the documentationWritev0.1.10 -
Copy File
actionCreate a copy of the specified file. See the documentation for more informationWritev0.1.25 -
Create Folder
actionCreate a new empty folder. See the documentation for more informationWritev0.1.26 -
Create New File From Template
actionCreate a new Google Docs file from a template. Optionally include placeholders in the template document that will get replaced from this action. See documentationWritev0.1.28 -
Create New File From Text
actionCreate a new file from plain text. See the documentation for more informationWritev0.2.18 -
Create Shared Drive
actionCreate a new shared drive. See the documentation for more informationWritev0.1.26 -
Create Text File
actionCreate a new Google Doc from text content in Google Drive. The file is created as a Google Docs document, which can be viewed and edited in the browser. Use this when the user asks to create a document, write a file, or save text to Drive. To place the file in a specific folder, pass theparentId— use Search Files withmimeType = 'application/vnd.google-apps.folder'to find the folder ID first. Supported content formats: plain text, Markdown, HTML, Rich Text, CSV. See the documentationWritev0.0.4 -
Delete Comment
actionDelete a specific comment (Requires ownership or permissions). See the documentationWritev0.0.14 -
Delete File
actionPermanently delete a file or folder without moving it to the trash. See the documentation for more informationWritev0.1.26 -
Delete Reply
actionDelete a reply on a specific comment. See the documentation for more informationWritev0.0.11 -
Delete Shared Drive
actionDelete a shared drive without any content. See the documentation for more informationWritev0.1.25 -
Download File
actionDownload one or more files from Google Drive to the/tmpdirectory or return their contents as buffers. Select multiple files to download a batch in a single run. Use to fetch a file's contents for processing in downstream steps — e.g., parsing a CSV, extracting text from a PDF, or re-uploading to another service. For Google Workspace files (Docs, Sheets, Slides, Drawings, Apps Script), exports to an Office-compatible format by default: Docs →.docx, Sheets →.xlsx, Slides →.pptx, Drawings → PNG, Apps Script → JSON. PassmimeTypeto force a specific format. Shortcuts are resolved to their target automatically. Folders, Forms, and My Maps cannot be downloaded via this action. See the documentationWritev0.2.2 -
Find File
actionSearch for a specific file by name. TheSearch Namefield uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like&or'. See the documentation for more informationRead-onlyv0.1.26 -
Find Folder
actionSearch for a specific folder by name. TheSearch Namefield uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like&or'. See the documentation for more informationRead-onlyv0.1.26 -
Find Forms
actionList Google Form documents or search for a Form by name. TheSearch Namefield uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like&or'. See the documentation for more informationRead-onlyv0.0.27 -
Find Spreadsheets
actionSearch for a specific spreadsheet by name. TheSearch Namefield uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like&or'. See the documentation for more informationRead-onlyv0.1.26 -
Get Comment By ID
actionGet comment by ID on a specific file. See the documentation for more informationRead-onlyv0.0.11 -
Get Current User
actionRetrieve Google Drive account metadata for the authenticated user viaabout.get, including display name, email, permission ID, and storage quota. Useful when flows or agents need to confirm the active Google identity or understand available storage. See the documentation.Read-onlyv0.0.12 -
Get File
actionGet full metadata for a file or folder by its ID. Returns name, MIME type, size, parent folders, sharing permissions, web links, creation/modification dates, and more. Use Search Files first to find the file ID if you only have the file name. By default returns all fields. Pass specific field names to
fieldsto reduce the response size.Common fields:
id,name,mimeType,size,parents,webViewLink,webContentLink,createdTime,modifiedTime,owners,permissions,description,trashed. See the documentationRead-onlyv0.0.4 -
Get File By ID
actionGet info on a specific file. See the documentation for more informationRead-onlyv0.0.22 -
Get Folder ID for a Path
actionRetrieve a folderId for a path. See the documentation for more informationRead-onlyv0.1.27 -
Get Reply By ID
actionGet reply by ID on a specific comment. See the documentation for more informationRead-onlyv0.0.11 -
Get Shared Drive
actionGet metadata for one or all shared drives. See the documentation for more informationRead-onlyv0.1.25 -
Get User Details
actionRetrieve the authenticated user's Google Drive identity and storage quota. Returns display name, email address, permission ID, and storage usage/limits. Use this tool when the user asks 'who am I?' or needs their identity for owner-based queries. When the user says 'my files' or 'my documents', call this first to get the owner email, then pass it to Search Files with a query like'user@example.com' in owners. See the documentationRead-onlyv0.0.4 -
Is Folder Ancestor
actionCheck if a specific folder is anywhere in the parent hierarchy of a file or folder. See the documentationRead-onlyv0.0.6 -
List Access Proposals
actionList access proposals for a file or folder. See the documentationRead-onlyv0.0.18 -
List Comments
actionList the comments on a file, including each comment's author, plain text and HTML content, the file text it is anchored to, whether it is resolved, and its full reply thread. Use Find File first to resolve a file's name to its ID. See the documentationRead-onlyv0.1.1 -
List Files
actionList files from a specific folder. SetMax Resultsto cap how many files are returned per run, then pass the returnednextPageTokenback in asPage Tokenon the next run to page through a large folder in fixed-size batches. See the documentation for more informationRead-onlyv1.0.2 -
List Mime Type Options
actionRetrieves available options for the Mime Type field.Read-onlyv0.0.5 -
List Permissions
actionList sharing permissions on a file or folder in Google Drive. Returns each permission's ID, type (user/group/domain/anyone), role (owner/writer/commenter/reader), and email address. Use Search Files first to find the file ID by name. Use this tool when the user asks 'who has access to this file?' or needs to audit sharing. Pass permission IDs from this response to Remove Sharing to revoke access. See the documentationRead-onlyv0.0.4 -
List Replies
actionList replies to a specific comment. See the documentation for more informationRead-onlyv0.0.11 -
List Shared Drives
actionList shared drives accessible to the authenticated user. Returns drive IDs, names, and metadata for each shared drive. Use this when the user asks about their shared drives or needs to scope a search to a specific drive. Pass a drive ID to Search FilesdriveIdparameter to search within a specific shared drive. Optionally filter by name using thequeryparameter (e.g.,name contains 'Engineering'). See the documentationRead-onlyv0.0.4 -
List Theme ID Options
actionRetrieves available options for the Theme ID field.Read-onlyv0.0.5 -
Move File
actionMove a file from one folder to another. See the documentation for more informationWritev0.1.25 -
Move File to Trash
actionMove a file or folder to trash. See the documentation for more informationWritev0.1.25 -
Remove File Sharing Permission
actionRemove a sharing permission from the sharing preferences of a file or folder. See the documentationWritev0.0.9 -
Remove Sharing
actionRemove a sharing permission from a file or folder in Google Drive. This revokes access for the specified permission. Use List Permissions first to find the permission ID to remove. The owner permission cannot be removed. Use Search Files to find the file ID by name if needed. See the documentationWritev0.0.4 -
Reply to Comment
actionAdd a reply to an existing comment. See the documentationWritev0.0.14 -
Resolve Access Proposals
actionAccept or deny a request for access to a file or folder in Google Drive. See the documentationWritev0.0.18 -
Resolve Comment
actionMark a comment as resolved. See the documentationWritev0.0.14 -
Search Files
actionSearch for files and folders in Google Drive using the Drive query language. This is the primary tool for finding files, folders, spreadsheets, forms, and any other Drive item. Returns matching files with their IDs, names, MIME types, and parent folder IDs.
Query syntax — pass a Drive search query string. Examples:
- Find by name:
name contains 'Budget' - Exact name match:
name = 'Q4 Report' - Folders only:
mimeType = 'application/vnd.google-apps.folder' - Google Docs:
mimeType = 'application/vnd.google-apps.document' - Spreadsheets:
mimeType = 'application/vnd.google-apps.spreadsheet' - Files in a folder:
'FOLDER_ID' in parents - Not trashed:
trashed = false - Modified after date:
modifiedTime > '2024-01-01T00:00:00' - Combine with AND:
name contains 'Report' and mimeType = 'application/vnd.google-apps.document' - Owner filter:
'user@example.com' in owners
When the user says 'my files', use Get User Details first to get the owner email. To scope to a shared drive, pass the
driveIdfrom List Shared Drives. See the documentationRead-onlyv0.0.4 - Find by name:
-
Search for Shared Drives
actionSearch for shared drives with query options. See the documentation for more informationRead-onlyv0.1.26 -
Share File
actionShare a file or folder in Google Drive by creating a sharing permission. Supports sharing with a specific user, a group, an entire domain, or anyone with the link. Use Search Files first to find the file ID by name.
Sharing types:
user— share with a specific person (requiresemailAddress)group— share with a Google Group (requiresemailAddress)domain— share with everyone in a Google Workspace domain (requiresdomain)anyone— share with anyone who has the link (no email/domain needed)
Roles:
reader(view only),commenter(can comment),writer(can edit). Use List Permissions to see existing sharing on a file. See the documentationWritev0.0.4 -
Share File or Folder
actionAdd a sharing permission to the sharing preferences of a file or folder and provide a sharing URL. See the documentationWritev0.2.17 -
Trash File
actionMove a file or folder to the trash in Google Drive. This is a reversible operation — the file can be restored from trash within 30 days. Use Search Files first to find the file ID by name. Use this instead of permanent deletion as the safer default. To find trashed files, use Search Files withtrashed = true. See the documentationWritev0.0.4 -
Update Comment
actionUpdate the content of a specific comment. See the documentation for more informationWritev0.0.11 -
Update File
actionUpdate a file's metadata and/or content. See the documentation for more informationWritev2.0.17 -
Update Reply
actionUpdate a reply on a specific comment. See the documentation for more informationWritev0.0.11 -
Update Shared Drive
actionUpdate an existing shared drive. See the documentation for more informationWritev0.1.25 -
Upload File
actionUpload a file to Google Drive. See the documentation for more informationWritev2.0.17
EVENTS
Google Drive triggers
Event sources your backend can deploy for users and receive through a webhook.
-
Changes to Files in Drive
triggerEmit new event when a change is made to one of the specified files. See the documentationv0.0.13 -
Changes to Specific Files
triggerWatches for changes to specific files, emitting an event when a change is made to one of those files. To watch for changes to shared drive files, use the Changes to Specific Files (Shared Drive) source instead.v0.3.11 -
Changes to Specific Files (Shared Drive)
triggerWatches for changes to specific files in a shared drive, emitting an event when a change is made to one of those filesv0.3.13 -
New Access Proposal
triggerEmit new event when a new access proposal is requested in Google Drivev0.0.16 -
New Files (Instant)
triggerEmit new event when a new file is added in your linked Google Drivev0.2.13 -
New Files (Polling)
triggerEmit new event when a new file is added in your linked Google Drivev0.0.11 -
New Files (Shared Drive)
triggerEmit new event when a new file is added in your shared Google Drivev0.1.13 -
New or Modified Comments (Instant)
triggerEmit new event when a comment is created or modified in the selected filev1.0.22 -
New or Modified Comments (Polling)
triggerEmit new event when a comment is created or modified in the selected filev0.0.11 -
New or Modified Files (Instant)
triggerEmit new event when a file in the selected Drive is created, modified or trashed.v0.4.13 -
New or Modified Files (Polling)
triggerEmit new event when a file in the selected Drive is created, modified or trashed. See the documentationv0.0.13 -
New or Modified Folders (Instant)
triggerEmit new event when a folder is created or modified in the selected Drivev0.2.16 -
New or Modified Folders (Polling)
triggerEmit new event when a folder is created or modified in the selected Drivev0.0.12 -
New Presentation (Instant)
triggerEmit new event each time a new presentation is created in a drive.v0.0.7 -
New Shared Drive
triggerEmits a new event any time a shared drive is created.v0.1.23 -
New Spreadsheet (Instant)
triggerEmit new event when a new spreadsheet is created in a drive.v0.1.26 -
New Spreadsheet (Polling)
triggerEmit new event when a new spreadsheet is created in a drive.v0.0.11
MULTI-APP
Use Google Drive with other popular apps
Most products don't stop at one integration. Pair Google Drive with the other apps your users rely on, and ship use cases that span both.
- App slug
- google_drive
- Authentication
- OAuth
- Categories
- File Storage
- Actions
- 50
- Triggers
- 17
- API proxy
- Available
OAuth scopes
These are the scopes Pipedream's managed Google Drive OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.
- https://www.googleapis.com/auth/drive
- profile
- openid