Google Drive
Cloud files. List, search, upload, and organize files and folders, manage who can open them, and export docs to other formats.
| Property | Value |
|---|---|
| Slug | google_drive |
| Definition version | 0.1.0 |
| Base URL | https://www.googleapis.com |
| Auth schemes | oauth2 |
| Action tools | 27 |
| By class | 10 read, 10 write, 7 destructive |
| Triggers | 1 |
| Provider rate limit | not declared, so outbound calls are unpaced |
Measured routing accuracy
48 golden cases replayed through the router over the whole index: measured over corpus ea4f12ad2948 (65 toolkits, 2283 tools indexed and 13 declared uncallable), 27 cases written by hand and 18 cases from the paraphrase pass, plus 3 context cases whose intent names no app and is decided by the session. A case counts as top-1 when its gold tool ranked first and top-8 when it reached the slate at all.
| Measure | Cases | Share |
|---|---|---|
| top-1 | 22/48 | 45.8% |
| top-8 | 46/48 | 95.8% |
The sweep is offline: the reranker is a deterministic identity fake that returns candidates in the order retrieval produced them, so top-1 measures retrieval order rather than a reranked slate. just eval-live measures the same cases through the live reranker.
Authentication
Connect an entity with ConnectionsService.InitiateConnection, naming this toolkit's slug. Credentials stay in the connections vault; callers hold connected-account ids only.
oauth2
| Property | Value |
|---|---|
| Authorization URL | https://accounts.google.com/o/oauth2/v2/auth |
| Token URL | https://oauth2.googleapis.com/token |
| Default scopes | https://www.googleapis.com/auth/drive |
| Refresh tokens | yes, the refresh daemon renews ahead of expiry |
Tools
27 action tools. The catalog-wide slug is google_drive.<tool>, which is what search_tools returns and call_tool takes.
google_drive.list_files
List files and folders in the signed-in user's Drive, most recently modified first. Use for what's in my drive, my recent files, or one folder's contents by id. For keyword or content search across everything, use search_files.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
folder_id | string | no | Id of a folder to list, e.g. "1AbCdefGHijkLmnOpQrstuVwxyz". Omit to list broadly across the whole Drive, including trashed files; with a folder_id, trashed files in that folder are excluded. |
order_by | string, one of modifiedTime desc, modifiedTime, name, name_natural, createdTime desc | no | Sort order. Defaults to modifiedTime desc. |
page_size | integer | no | Results per page, max 100. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
files | array of object | |
files[].id | string | |
files[].mimeType | string | |
files[].modifiedTime | string (date-time) | |
files[].name | string | |
files[].size | string | |
files[].webViewLink | string | |
nextPageToken | string |
Also retrieved by: "what's in my drive", "show my recent files", "what's inside this folder", "browse my documents", "see everything I have saved".
google_drive.search_files
Search across all of Drive by name, content, or type using Drive query syntax. Use when the user wants to find, look up, or locate a file by keyword rather than browse a known folder. For a specific folder's contents, use list_files.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
page_size | integer | no | Results per page, max 100. |
q | string | yes | Drive query syntax, e.g. "name contains 'budget' and mimeType = 'application/vnd.google-apps.spreadsheet'" or "fullText contains 'quarterly report'". |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
files | array of object | |
files[].id | string | |
files[].mimeType | string | |
files[].modifiedTime | string (date-time) | |
files[].name | string | |
files[].size | string | |
files[].webViewLink | string | |
nextPageToken | string |
Also retrieved by: "find that spreadsheet I made", "look up a document by name", "dig up anything mentioning the budget", "where did I save that file", "hunt down a doc about this topic".
google_drive.get_file
Get one file or folder's metadata by id: name, type, size, owner, parent folder, and links. Use when the user names a specific file. For its actual content, use download_file or export_file.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file or folder id, e.g. "1AbCdefGHijkLmnOpQrstuVwxyz". |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
createdTime | string (date-time) | |
id | string | |
mimeType | string | |
modifiedTime | string (date-time) | |
name | string | |
owners | array of object | |
owners[].displayName | string | |
owners[].emailAddress | string | |
parents | array of string | |
size | string | |
starred | boolean | |
trashed | boolean | |
webViewLink | string |
Also retrieved by: "who owns this document", "pull up details on this file", "how big is this file", "check when this was last touched".
google_drive.download_file
Download the raw bytes of a file that already has a native format, such as a PDF, image, zip, or plain text upload. Use when the user wants to fetch, save, or read a file's content. Google Docs, Sheets, and Slides have no raw bytes; use export_file for those instead.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to download. |
Also retrieved by: "grab a copy of this file", "save this to my computer", "get the actual bytes of this upload", "fetch this pdf".
google_drive.export_file
Convert and download a Google Doc, Sheet, or Slide as another file format such as PDF, DOCX, XLSX, or CSV. Use when the user wants to export, download, or save a Google-native document in a common format.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files/{{params.file_id}}/export.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
export_mime_type | string | yes | Target MIME type, e.g. "application/pdf", "text/csv", "application/vnd.openxmlformats-officedocument.wordprocessingml.document". |
file_id | string | yes | Drive file id of the Google-native document to export. |
Also retrieved by: "turn this doc into a pdf", "save this spreadsheet as a csv", "give me this slide deck as a powerpoint file", "convert this to a word document".
google_drive.upload_file
Create a new file in Drive with the given text content. Use when the user wants to add, save, or upload a document, note, or CSV. Content is UTF-8 text, base64-encoded. For an empty folder, use create_folder.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls POST /upload/drive/v3/files.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
content | string | yes | File content, base64-encoded. |
mime_type | string | no | Target MIME type, e.g. "text/plain" or "text/csv". Defaults to text/plain. |
name | string | yes | File name including extension, e.g. "notes.txt". |
parent_ids | array of string | no | Destination folder id(s). Omit to create in My Drive's root. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
mimeType | string | |
name | string | |
webViewLink | string |
Also retrieved by: "save these notes to my drive", "put this text into a new document", "add a file with this content", "stash this write-up online".
google_drive.update_file_content
Replace an existing file's content with new text, keeping its name and location. Use when the user wants to overwrite, update, or rewrite what's inside a file. Content is UTF-8 text, base64-encoded.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls PATCH /upload/drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
content | string | yes | New file content, base64-encoded. |
file_id | string | yes | Drive file id whose content is being replaced. |
mime_type | string | no | New MIME type, if it is changing. Omit to keep the current one. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
modifiedTime | string (date-time) | |
name | string |
Also retrieved by: "overwrite what's in this file", "replace the text in that document", "rewrite this file with new content", "swap out what's inside this doc".
google_drive.create_folder
Create a new folder in Drive, optionally inside another folder. Use when the user wants to organize files into a new folder or directory.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls POST /drive/v3/files.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
name | string | yes | New folder name, e.g. "Q3 Reports". |
parent_ids | array of string | no | Parent folder id(s) to create this folder inside. Omit for My Drive's root. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
webViewLink | string |
Also retrieved by: "make a new directory for these files", "set up a folder to keep this organized", "I need a place to put all these documents".
google_drive.rename_file
Rename a file or folder, keeping its content and location unchanged. Use when the user wants to retitle or relabel something in Drive.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls PATCH /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file or folder id to rename. |
name | string | yes | New name. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string |
Also retrieved by: "retitle this document", "give this file a better name", "this is labeled wrong, fix the name".
google_drive.copy_file
Duplicate a file, optionally under a new name or in a different folder. Use when the user wants their own copy of a file or a template to build from.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls POST /drive/v3/files/{{params.file_id}}/copy.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to copy. |
name | string | no | Name for the copy. Defaults to "Copy of" plus the original name. |
parent_ids | array of string | no | Destination folder id(s) for the copy. Omit to copy alongside the original. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
webViewLink | string |
Also retrieved by: "I want my own version of this file", "duplicate this doc so I can edit it", "make a template from this spreadsheet".
google_drive.move_file
Move a file into a different folder by changing its parent. Use when the user wants to relocate, file away, or reorganize something into another folder.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls PATCH /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
add_parent_id | string | yes | Id of the destination folder. |
file_id | string | yes | Drive file id to move. |
remove_parent_id | string | no | Id of the source folder to remove, if known. Omit if unknown. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
parents | array of string |
Also retrieved by: "file this away somewhere else", "relocate this document to another folder", "this is in the wrong place, put it over there".
google_drive.star_file
Mark a file as starred, or remove its star. Use when the user wants to flag a file as important or bookmark it for quick access.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls PATCH /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to star or unstar. |
starred | boolean | yes | True to star the file, false to remove the star. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
starred | boolean |
Also retrieved by: "bookmark this file", "flag this as important", "I want quick access to this one later", "unmark this as a favorite".
google_drive.trash_file
Move a file to the trash. Use when the user wants to delete or remove a file. Trashed files are recoverable with restore_file until the trash is emptied.
Class destructive (held by the mutation gate until the call's own arguments carry "confirm": true). No scopes beyond the connection's defaults. Calls PATCH /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to trash. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
trashed | boolean |
Also retrieved by: "get rid of this document", "remove this file, I don't need it", "toss this old draft".
google_drive.restore_file
Restore a file out of the trash back to its previous location. Use when the user wants to undo a deletion or get a file back.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls PATCH /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to restore from the trash. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
trashed | boolean |
Also retrieved by: "bring that file back", "undo deleting this document", "I need that thing I just removed".
google_drive.delete_file
Permanently delete a file, bypassing the trash. Irreversible. Use only when the user explicitly wants a file gone for good, not just moved to trash.
Class destructive (held by the mutation gate until the call's own arguments carry "confirm": true). No scopes beyond the connection's defaults. Calls DELETE /drive/v3/files/{{params.file_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to permanently delete. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
deleted | boolean |
Also retrieved by: "wipe this file for good", "permanently get rid of this document", "I don't want this recoverable, nuke it".
google_drive.empty_trash
Permanently delete every file currently in the trash. Irreversible. Use when the user wants to clear, empty, or purge their Drive trash.
Class destructive (held by the mutation gate until the call's own arguments carry "confirm": true). No scopes beyond the connection's defaults. Calls DELETE /drive/v3/files/trash.
Takes no arguments.
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
emptied | boolean |
Also retrieved by: "clear out my deleted files", "purge everything I've thrown away", "free up space from old deleted stuff".
google_drive.list_permissions
List the collaborators on a file and their role: owner, editor, commenter, or viewer. Use when the user wants to see who can view or edit a file, before changing its sharing.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files/{{params.file_id}}/permissions.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to check access on. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
permissions | array of object | |
permissions[].displayName | string | |
permissions[].emailAddress | string | |
permissions[].id | string | |
permissions[].role | string | |
permissions[].type | string |
Also retrieved by: "who can see this document", "check the sharing settings on this file", "who has access here".
google_drive.share_file
Grant a person, group, or domain access to a file at a given role, the same viewer, commenter, editor, or owner roles Drive's own sharing dialog shows. Use when the user wants to share, invite, or add a new collaborator to a file.
Class destructive (held by the mutation gate until the call's own arguments carry "confirm": true). Scopes https://www.googleapis.com/auth/drive. Calls POST /drive/v3/files/{{params.file_id}}/permissions.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
email | string | no | Email address of the user or group. Required when type is user or group. |
file_id | string | yes | Drive file id to share. |
notify | boolean | no | Whether to send a notification email. Defaults to true. |
role | string, one of reader, commenter, writer, owner | yes | Access level to grant. |
type | string, one of user, group, domain, anyone | yes | Who the permission applies to. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
role | string | |
type | string |
Also retrieved by: "give someone access to this document", "invite a collaborator to this file", "let this person view my spreadsheet", "open this up to the whole team".
google_drive.update_permission
Change an existing collaborator's role on a file between viewer, commenter, and editor. Use when the user wants to change someone's access level without removing them.
Class destructive (held by the mutation gate until the call's own arguments carry "confirm": true). No scopes beyond the connection's defaults. Calls PATCH /drive/v3/files/{{params.file_id}}/permissions/{{params.permission_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id the permission is on. |
permission_id | string | yes | Id of the permission to change, from list_permissions. |
role | string, one of reader, commenter, writer, owner | yes | New access level. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
id | string | |
role | string |
Also retrieved by: "change what this person can do with the file", "bump their access up to editor", "downgrade them to view only".
google_drive.remove_permission
Revoke a person's or group's access to a file. Use when the user wants to unshare, remove access, or stop someone from seeing a file.
Class destructive (held by the mutation gate until the call's own arguments carry "confirm": true). No scopes beyond the connection's defaults. Calls DELETE /drive/v3/files/{{params.file_id}}/permissions/{{params.permission_id}}.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id the permission is on. |
permission_id | string | yes | Id of the permission to revoke, from list_permissions. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
removed | boolean |
Also retrieved by: "take away their access to this document", "stop this person from seeing the file", "unshare this with them".
google_drive.transfer_ownership
Transfer ownership of a file to another user. Use when the user wants to hand off, give away, or make someone else the owner of a file. The current owner keeps editor access.
Class destructive (held by the mutation gate until the call's own arguments carry "confirm": true). Scopes https://www.googleapis.com/auth/drive. Calls POST /drive/v3/files/{{params.file_id}}/permissions.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
email | string | yes | Email address of the new owner. |
file_id | string | yes | Drive file id to transfer. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
emailAddress | string | |
id | string | |
role | string |
Also retrieved by: "hand this document off to someone else", "make them the new owner of this file", "give away control of this spreadsheet".
google_drive.list_comments
List the comments left on a file, including whether each is resolved. Use when the user asks for feedback or notes people left on a document.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files/{{params.file_id}}/comments.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to read comments on. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
comments | array of object | |
comments[].author | object | |
comments[].author.displayName | string | |
comments[].content | string | |
comments[].createdTime | string (date-time) | |
comments[].id | string | |
comments[].resolved | boolean |
Also retrieved by: "what feedback did people leave", "read the notes on this document", "see what reviewers said".
google_drive.create_comment
Post a new comment on a file. Use when the user wants to leave a note, ask a question, or flag something on a document.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls POST /drive/v3/files/{{params.file_id}}/comments.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
content | string | yes | Comment text. |
file_id | string | yes | Drive file id to comment on. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
content | string | |
createdTime | string (date-time) | |
id | string |
Also retrieved by: "leave a note on this document", "flag this part of the doc for the team", "ask a question right on the file".
google_drive.reply_to_comment
Reply to an existing comment thread on a file. Use when the user wants to respond to, address, or resolve feedback someone left on a document.
Class write (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls POST /drive/v3/files/{{params.file_id}}/comments/{{params.comment_id}}/replies.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
comment_id | string | yes | Id of the comment to reply to, from list_comments. |
content | string | yes | Reply text. |
file_id | string | yes | Drive file id the comment is on. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
content | string | |
createdTime | string (date-time) | |
id | string |
Also retrieved by: "answer that note someone left", "respond to the feedback on this doc", "address what they flagged".
google_drive.list_revisions
List a file's revision history: who changed it and when. Use when the user asks about past versions or previous edits of a file.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/files/{{params.file_id}}/revisions.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
file_id | string | yes | Drive file id to list revisions for. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
revisions | array of object | |
revisions[].id | string | |
revisions[].lastModifyingUser | object | |
revisions[].lastModifyingUser.displayName | string | |
revisions[].modifiedTime | string (date-time) | |
revisions[].size | string |
Also retrieved by: "show me the version history", "what did this look like before", "who edited this and when".
google_drive.list_shared_drives
List the shared drives the signed-in user belongs to. Use when the user asks about team drives or shared drives rather than their personal My Drive.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/drives.
Arguments:
| Argument | Type | Required | Notes |
|---|---|---|---|
page_size | integer | no | Results per page, max 100. |
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
drives | array of object | |
drives[].id | string | |
drives[].name | string | |
nextPageToken | string |
Also retrieved by: "what team drives am I part of", "show the shared spaces I belong to", "which company drives can I open".
google_drive.get_storage_quota
Get Drive storage usage and limit for the signed-in account. Use when the user asks how much space they have left or how full their Drive is.
Class read (reads only). No scopes beyond the connection's defaults. Calls GET /drive/v3/about.
Takes no arguments.
Result fields (the payload is trimmed to these before it reaches the model):
| Field | Type | Notes |
|---|---|---|
storageQuota | object | |
storageQuota.limit | string | |
storageQuota.usage | string | |
storageQuota.usageInDrive | string | |
storageQuota.usageInDriveTrash | string | |
user | object | |
user.displayName | string | |
user.emailAddress | string |
Also retrieved by: "how much space do I have left", "check my storage usage", "is my drive almost full".
Triggers
Triggers are app-initiated. They are not retrievable as tools and cannot be called; subscribe with TriggersService.CreateSubscription and events arrive as signed deliveries.
file_changed
Fires when a watched file or the whole Drive changes: edited, renamed, moved, or trashed. Carries the Pub/Sub message whose base64 data holds the changed file id; read the file's current state with get_file after it fires.
Payload fields (anything the schema does not declare never reaches a subscriber):
| Field | Type | Notes |
|---|---|---|
message | object | |
message.data | string | |
message.messageId | string | |
message.publishTime | string | |
subscription | string |
Inbound webhooks
Providers post to /webhooks/google_drive. Posts that fail verification are rejected before anything is stored, and the ingest path refuses every post while the secret variable is unset.
| Property | Value |
|---|---|
| Verification scheme | token_query |
| Shared secret | AUTOMATON_GOOGLE_DRIVE_WEBHOOK_TOKEN (deployment environment) |
| Token query parameter | token |
Mappings are tried in order and the first match wins.
| Trigger | Matches when | Entity resolved from |
|---|---|---|
file_changed | every remaining post |