Skip to main content

Google Drive

Connects to the Google Drive API for browsing and managing files. An agent can list and search files, read metadata, export/read text content, and create folders.

Add to an agent node's tools array with _node_type: "tool-google-drive". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
access_tokenYesOAuth2 access token for the Google Drive API, sent as Authorization: Bearer <token>. Typically populated from a stored OAuth connection via oauth_connection_id.
{
"name": "google_drive",
"_node_type": "tool-google-drive",
"oauth_connection_id": "{{ connections.google }}"
}

Tools

gdrive_list_files

List files and folders in Google Drive.

Parameters

ParameterTypeRequiredDescription
folder_idstringNoFolder ID to list files from (default root)
page_sizenumberNoNumber of files to return (default 20)
mime_typestringNoFilter by MIME type (e.g. application/vnd.google-apps.spreadsheet)

Returns: A list of files as - **<name>** (<type label>) modified: <date> id: <id> lines, or "No files found.".

gdrive_search_files

Search for files in Google Drive by name or content.

Parameters

ParameterTypeRequiredDescription
querystringYesSearch term (searches file names and full text)
page_sizenumberNoMax results (default 10)

Returns: A list of files as - **<name>** (<type label>)\n <link> id: <id> lines, or "No files found.".

gdrive_get_file

Get metadata and details of a Google Drive file.

Parameters

ParameterTypeRequiredDescription
file_idstringYesGoogle Drive file ID

Returns: A text block with the file name, type label, size in bytes, created/modified dates, and a link to view it.

gdrive_get_file_content

Export and read the text content of a Google Drive file (Google Docs exported as plain text, or download plain text files).

Parameters

ParameterTypeRequiredDescription
file_idstringYesGoogle Drive file ID (works for Google Docs, plain text files)

Returns: The file name as a heading followed by its content. Google Docs are exported as plain text and Google Sheets as CSV; other files are downloaded directly. Content longer than 10,000 characters is truncated with "...[truncated]".

gdrive_create_folder

Create a new folder in Google Drive.

Parameters

ParameterTypeRequiredDescription
namestringYesFolder name
parent_idstringNoParent folder ID (default root)

Returns: A confirmation message with the folder name, ID, and a link to view it.

Next