Google Drive ACTION
Update File
Update a file's metadata and/or content. See the documentation for more information
- Action
- Writes data
- Destructive
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Google Drive account once, then configure and run Update File from your backend or agent.
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-update-file",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
google_drive: { authProvisionId: "apn_xxxxxxx" },
drive: "Drive",
fileId: "File",
},
})
console.log(result)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-update-file",
"configured_props": {
"google_drive": { "authProvisionId": "apn_xxxxxxx" },
"drive": "Drive",
"fileId": "File"
}
}'// 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()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "google_drive-update-file",
arguments: {
drive: "Drive",
fileId: "File",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
drive Drive | string | Select a specific drive to search. Defaults to All Drives (My Drive and all Shared Drives you have access to) when no selection is made. To limit to your personal drive or a Shared Drive, select it from this list. Optional Dynamic |
fileId File | string | The file to update Required Dynamic |
filePath File Path or URL | string | The file content to upload. Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFile.txt) Optional |
name Name | string | The new name of the file Optional |
mimeType Mime Type | string | The file's MIME type (e.g., image/jpeg). The value cannot be changed unless a new revision is uploaded. Optional Dynamic |
addParents Add Parents | string[] | A list of parent folder IDs to add Optional Dynamic |
removeParents Remove Parents | string[] | A list of parent folder IDs to remove Optional Dynamic |
keepRevisionForever Keep Revision Forever | boolean | Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. Optional |
ocrLanguage OCR Language | string | A language hint for OCR processing during image import (ISO 639-1 code) Optional |
useContentAsIndexableText Use Content As Indexable Text | boolean | Whether to use the uploaded content as indexable text Optional |
advanced Additional Options | object | Any additional parameters to pass in the request. See the documentation for all available parameters. Optional |
syncDir SyncDir | dir | Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- google_drive-update-file
- Version
- 2.0.17
- App
- Google Drive
- Authentication
- OAuth
- Read-only
- No
- Destructive
- Yes
- Open world
- Yes
- Source
- View on GitHub ↗