atmon docs

REFERENCE/TOOLKITS/GOOGLE_DRIVE.MD

Google Drive

Cloud files. List, search, upload, and organize files and folders, manage who can open them, and export docs to other formats.

PropertyValue
Sluggoogle_drive
Definition version0.1.0
Base URLhttps://www.googleapis.com
Auth schemesoauth2
Action tools27
By class10 read, 10 write, 7 destructive
Triggers1
Provider rate limitnot 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.

MeasureCasesShare
top-122/4845.8%
top-846/4895.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

PropertyValue
Authorization URLhttps://accounts.google.com/o/oauth2/v2/auth
Token URLhttps://oauth2.googleapis.com/token
Default scopeshttps://www.googleapis.com/auth/drive
Refresh tokensyes, 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:

ArgumentTypeRequiredNotes
folder_idstringnoId 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_bystring, one of modifiedTime desc, modifiedTime, name, name_natural, createdTime descnoSort order. Defaults to modifiedTime desc.
page_sizeintegernoResults per page, max 100.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
filesarray of object
files[].idstring
files[].mimeTypestring
files[].modifiedTimestring (date-time)
files[].namestring
files[].sizestring
files[].webViewLinkstring
nextPageTokenstring

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:

ArgumentTypeRequiredNotes
page_sizeintegernoResults per page, max 100.
qstringyesDrive 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):

FieldTypeNotes
filesarray of object
files[].idstring
files[].mimeTypestring
files[].modifiedTimestring (date-time)
files[].namestring
files[].sizestring
files[].webViewLinkstring
nextPageTokenstring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file or folder id, e.g. "1AbCdefGHijkLmnOpQrstuVwxyz".

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
createdTimestring (date-time)
idstring
mimeTypestring
modifiedTimestring (date-time)
namestring
ownersarray of object
owners[].displayNamestring
owners[].emailAddressstring
parentsarray of string
sizestring
starredboolean
trashedboolean
webViewLinkstring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive 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:

ArgumentTypeRequiredNotes
export_mime_typestringyesTarget MIME type, e.g. "application/pdf", "text/csv", "application/vnd.openxmlformats-officedocument.wordprocessingml.document".
file_idstringyesDrive 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:

ArgumentTypeRequiredNotes
contentstringyesFile content, base64-encoded.
mime_typestringnoTarget MIME type, e.g. "text/plain" or "text/csv". Defaults to text/plain.
namestringyesFile name including extension, e.g. "notes.txt".
parent_idsarray of stringnoDestination folder id(s). Omit to create in My Drive's root.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
mimeTypestring
namestring
webViewLinkstring

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:

ArgumentTypeRequiredNotes
contentstringyesNew file content, base64-encoded.
file_idstringyesDrive file id whose content is being replaced.
mime_typestringnoNew 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):

FieldTypeNotes
idstring
modifiedTimestring (date-time)
namestring

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:

ArgumentTypeRequiredNotes
namestringyesNew folder name, e.g. "Q3 Reports".
parent_idsarray of stringnoParent 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):

FieldTypeNotes
idstring
namestring
webViewLinkstring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file or folder id to rename.
namestringyesNew name.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
namestring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to copy.
namestringnoName for the copy. Defaults to "Copy of" plus the original name.
parent_idsarray of stringnoDestination 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):

FieldTypeNotes
idstring
namestring
webViewLinkstring

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:

ArgumentTypeRequiredNotes
add_parent_idstringyesId of the destination folder.
file_idstringyesDrive file id to move.
remove_parent_idstringnoId of the source folder to remove, if known. Omit if unknown.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
namestring
parentsarray 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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to star or unstar.
starredbooleanyesTrue to star the file, false to remove the star.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
starredboolean

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to trash.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
trashedboolean

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to restore from the trash.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
trashedboolean

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to permanently delete.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
deletedboolean

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):

FieldTypeNotes
emptiedboolean

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to check access on.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
permissionsarray of object
permissions[].displayNamestring
permissions[].emailAddressstring
permissions[].idstring
permissions[].rolestring
permissions[].typestring

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:

ArgumentTypeRequiredNotes
emailstringnoEmail address of the user or group. Required when type is user or group.
file_idstringyesDrive file id to share.
notifybooleannoWhether to send a notification email. Defaults to true.
rolestring, one of reader, commenter, writer, owneryesAccess level to grant.
typestring, one of user, group, domain, anyoneyesWho the permission applies to.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
rolestring
typestring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id the permission is on.
permission_idstringyesId of the permission to change, from list_permissions.
rolestring, one of reader, commenter, writer, owneryesNew access level.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
idstring
rolestring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id the permission is on.
permission_idstringyesId of the permission to revoke, from list_permissions.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
removedboolean

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:

ArgumentTypeRequiredNotes
emailstringyesEmail address of the new owner.
file_idstringyesDrive file id to transfer.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
emailAddressstring
idstring
rolestring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to read comments on.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
commentsarray of object
comments[].authorobject
comments[].author.displayNamestring
comments[].contentstring
comments[].createdTimestring (date-time)
comments[].idstring
comments[].resolvedboolean

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:

ArgumentTypeRequiredNotes
contentstringyesComment text.
file_idstringyesDrive file id to comment on.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
contentstring
createdTimestring (date-time)
idstring

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:

ArgumentTypeRequiredNotes
comment_idstringyesId of the comment to reply to, from list_comments.
contentstringyesReply text.
file_idstringyesDrive file id the comment is on.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
contentstring
createdTimestring (date-time)
idstring

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:

ArgumentTypeRequiredNotes
file_idstringyesDrive file id to list revisions for.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
revisionsarray of object
revisions[].idstring
revisions[].lastModifyingUserobject
revisions[].lastModifyingUser.displayNamestring
revisions[].modifiedTimestring (date-time)
revisions[].sizestring

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:

ArgumentTypeRequiredNotes
page_sizeintegernoResults per page, max 100.

Result fields (the payload is trimmed to these before it reaches the model):

FieldTypeNotes
drivesarray of object
drives[].idstring
drives[].namestring
nextPageTokenstring

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):

FieldTypeNotes
storageQuotaobject
storageQuota.limitstring
storageQuota.usagestring
storageQuota.usageInDrivestring
storageQuota.usageInDriveTrashstring
userobject
user.displayNamestring
user.emailAddressstring

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):

FieldTypeNotes
messageobject
message.datastring
message.messageIdstring
message.publishTimestring
subscriptionstring

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.

PropertyValue
Verification schemetoken_query
Shared secretAUTOMATON_GOOGLE_DRIVE_WEBHOOK_TOKEN (deployment environment)
Token query parametertoken

Mappings are tried in order and the first match wins.

TriggerMatches whenEntity resolved from
file_changedevery remaining post