All data sources

Google Drive

OAuthdrive

Google Drive connector for listing, searching, downloading, and uploading files. CRITICAL USAGE RULES: 1. Use listFiles() first to discover folder and file IDs. 2. downloadFile() returns file content as base64 (decode client-side if needed). Google Workspace files are auto-exported. 3. searchFiles() searches by name across the entire drive. 4. uploadFile() requires filename + exactly one of contentBase64, contentText, sourceUrl, or fileContent (Buffer/Uint8Array). Prefer sourceUrl (server fetches the bytes) over contentBase64 for large files. 5. listFiles() supports pageSize, pageToken, orderBy, and q (query) for advanced filtering. 6. getFileById(), getFileByPath(), createFolder(), deleteFile(), moveFile(), copyFile(), and createShareLink() are available for file management.

Provenance

PublisherGoogle Drive

Freshness & coverage

FreshnessFreshness not declared
GeographicNot declared
TemporalNot declared
AuthenticationCredentials required (OAuth)

Methods (11)

  • listFiles

    read

    List Google Drive files in the root or a specific folder.

    Input schema
    {
      "type": "object",
      "properties": {
        "folderId": {
          "type": "string",
          "description": "Optional parent folder ID."
        },
        "pageSize": {
          "type": "number",
          "description": "Maximum files to return."
        },
        "pageToken": {
          "type": "string",
          "description": "Pagination token."
        },
        "orderBy": {
          "type": "string",
          "description": "Drive ordering expression."
        },
        "q": {
          "type": "string",
          "description": "Optional advanced Drive query."
        },
        "fields": {
          "type": "string"
        },
        "spaces": {
          "type": "string"
        },
        "corpora": {
          "type": "string"
        },
        "driveId": {
          "type": "string"
        },
        "includeItemsFromAllDrives": {
          "type": "boolean"
        },
        "supportsAllDrives": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    }
  • searchFiles

    read

    Search Google Drive by text query.

    Required paramsquery
    Input schema
    {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "Search text.",
          "x-patchops-inference": "literal-search-term"
        },
        "pageSize": {
          "type": "number",
          "description": "Maximum files to return."
        },
        "pageToken": {
          "type": "string",
          "description": "Pagination token."
        },
        "orderBy": {
          "type": "string"
        },
        "fields": {
          "type": "string"
        },
        "spaces": {
          "type": "string"
        }
      },
      "additionalProperties": true,
      "required": [
        "query"
      ]
    }
  • downloadFile

    read

    Download a Google Drive file by ID, auto-exporting Google Workspace formats.

    Required paramsfileId
    Input schema
    {
      "type": "object",
      "properties": {
        "fileId": {
          "type": "string",
          "description": "Google Drive file ID."
        }
      },
      "additionalProperties": true,
      "required": [
        "fileId"
      ]
    }
  • uploadFile

    write

    Upload a file to Google Drive. Provide exactly one of contentBase64, contentText, or sourceUrl.

    Required paramsfilename
    Input schema
    {
      "type": "object",
      "properties": {
        "filename": {
          "type": "string",
          "description": "Filename to create."
        },
        "fileName": {
          "type": "string"
        },
        "contentBase64": {
          "type": "string",
          "description": "Base64-encoded file content."
        },
        "contentText": {
          "type": "string",
          "description": "UTF-8 text content to upload."
        },
        "fileContent": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "object",
              "properties": {
                "byteLength": {
                  "type": "number"
                },
                "slice": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                }
              },
              "required": [
                "byteLength",
                "slice"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "slice": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "subarray": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "write": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "toString": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "toJSON": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "equals": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "compare": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "copy": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeBigInt64BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeBigInt64LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeBigUInt64BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeBigUint64BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeBigUInt64LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeBigUint64LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUIntLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUintLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUIntBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUintBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeIntLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeIntBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readBigUInt64BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readBigUint64BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readBigUInt64LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readBigUint64LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readBigInt64BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readBigInt64LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUIntLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUintLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUIntBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUintBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readIntLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readIntBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUInt8": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUint8": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUInt16LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUint16LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUInt16BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUint16BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUInt32LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUint32LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUInt32BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readUint32BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readInt8": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readInt16LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readInt16BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readInt32LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readInt32BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readFloatLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readFloatBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readDoubleLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "readDoubleBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "reverse": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "swap16": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "swap32": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "swap64": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUInt8": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUint8": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUInt16LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUint16LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUInt16BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUint16BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUInt32LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUint32LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUInt32BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeUint32BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeInt8": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeInt16LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeInt16BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeInt32LE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeInt32BE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeFloatLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeFloatBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeDoubleLE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "writeDoubleBE": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "fill": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "indexOf": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "lastIndexOf": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "includes": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "BYTES_PER_ELEMENT": {
                  "type": "number"
                },
                "buffer": {
                  "type": "object",
                  "properties": {
                    "byteLength": {},
                    "slice": {}
                  },
                  "required": [
                    "byteLength",
                    "slice"
                  ],
                  "additionalProperties": false
                },
                "byteLength": {
                  "type": "number"
                },
                "byteOffset": {
                  "type": "number"
                },
                "copyWithin": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "every": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "filter": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "find": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "findIndex": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "forEach": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "join": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "length": {
                  "type": "number"
                },
                "map": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "reduce": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "reduceRight": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "set": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "some": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "sort": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "toLocaleString": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "valueOf": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "entries": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "keys": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "values": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "at": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                }
              },
              "required": [
                "slice",
                "subarray",
                "write",
                "toString",
                "toJSON",
                "equals",
                "compare",
                "copy",
                "writeBigInt64BE",
                "writeBigInt64LE",
                "writeBigUInt64BE",
                "writeBigUint64BE",
                "writeBigUInt64LE",
                "writeBigUint64LE",
                "writeUIntLE",
                "writeUintLE",
                "writeUIntBE",
                "writeUintBE",
                "writeIntLE",
                "writeIntBE",
                "readBigUInt64BE",
                "readBigUint64BE",
                "readBigUInt64LE",
                "readBigUint64LE",
                "readBigInt64BE",
                "readBigInt64LE",
                "readUIntLE",
                "readUintLE",
                "readUIntBE",
                "readUintBE",
                "readIntLE",
                "readIntBE",
                "readUInt8",
                "readUint8",
                "readUInt16LE",
                "readUint16LE",
                "readUInt16BE",
                "readUint16BE",
                "readUInt32LE",
                "readUint32LE",
                "readUInt32BE",
                "readUint32BE",
                "readInt8",
                "readInt16LE",
                "readInt16BE",
                "readInt32LE",
                "readInt32BE",
                "readFloatLE",
                "readFloatBE",
                "readDoubleLE",
                "readDoubleBE",
                "reverse",
                "swap16",
                "swap32",
                "swap64",
                "writeUInt8",
                "writeUint8",
                "writeUInt16LE",
                "writeUint16LE",
                "writeUInt16BE",
                "writeUint16BE",
                "writeUInt32LE",
                "writeUint32LE",
                "writeUInt32BE",
                "writeUint32BE",
                "writeInt8",
                "writeInt16LE",
                "writeInt16BE",
                "writeInt32LE",
                "writeInt32BE",
                "writeFloatLE",
                "writeFloatBE",
                "writeDoubleLE",
                "writeDoubleBE",
                "fill",
                "indexOf",
                "lastIndexOf",
                "includes",
                "BYTES_PER_ELEMENT",
                "buffer",
                "byteLength",
                "byteOffset",
                "copyWithin",
                "every",
                "filter",
                "find",
                "findIndex",
                "forEach",
                "join",
                "length",
                "map",
                "reduce",
                "reduceRight",
                "set",
                "some",
                "sort",
                "toLocaleString",
                "valueOf",
                "entries",
                "keys",
                "values",
                "at"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "BYTES_PER_ELEMENT": {
                  "type": "number"
                },
                "buffer": {
                  "type": "object",
                  "properties": {
                    "byteLength": {},
                    "slice": {}
                  },
                  "required": [
                    "byteLength",
                    "slice"
                  ],
                  "additionalProperties": false
                },
                "byteLength": {
                  "type": "number"
                },
                "byteOffset": {
                  "type": "number"
                },
                "copyWithin": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "every": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "fill": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "filter": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "find": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "findIndex": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "forEach": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "indexOf": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "join": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "lastIndexOf": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "length": {
                  "type": "number"
                },
                "map": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "reduce": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "reduceRight": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "reverse": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "set": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "slice": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "some": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "sort": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "subarray": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "toLocaleString": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "toString": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "valueOf": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "entries": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "keys": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "values": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "includes": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "at": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                }
              },
              "required": [
                "BYTES_PER_ELEMENT",
                "buffer",
                "byteLength",
                "byteOffset",
                "copyWithin",
                "every",
                "fill",
                "filter",
                "find",
                "findIndex",
                "forEach",
                "indexOf",
                "join",
                "lastIndexOf",
                "length",
                "map",
                "reduce",
                "reduceRight",
                "reverse",
                "set",
                "slice",
                "some",
                "sort",
                "subarray",
                "toLocaleString",
                "toString",
                "valueOf",
                "entries",
                "keys",
                "values",
                "includes",
                "at"
              ],
              "additionalProperties": false
            }
          ]
        },
        "sourceUrl": {
          "type": "string",
          "description": "Public/HTTPS URL the server fetches server-side (use INSTEAD of contentBase64 to avoid inlining large files)."
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type for the upload."
        },
        "parentId": {
          "type": "string"
        },
        "folderPath": {
          "type": "string",
          "description": "Optional parent folder path."
        },
        "folderId": {
          "type": "string",
          "description": "Optional parent folder ID."
        }
      },
      "additionalProperties": true,
      "required": [
        "filename"
      ]
    }
  • createFolder

    write

    Create a folder in Google Drive.

    Required paramsname
    Input schema
    {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Folder name."
        },
        "parentId": {
          "type": "string",
          "description": "Optional parent folder ID. Defaults to \"root\"."
        },
        "folderPath": {
          "type": "string",
          "description": "Optional path-based parent (creates intermediate folders if missing)."
        }
      },
      "additionalProperties": true,
      "required": [
        "name"
      ]
    }
  • moveFile

    write

    Move a file to a different parent folder. The destination is named parentId — pass the folder ID returned by createFolder/listFiles.

    Required paramsfileIdparentId
    Input schema
    {
      "type": "object",
      "properties": {
        "fileId": {
          "type": "string",
          "description": "Google Drive file ID to move."
        },
        "parentId": {
          "type": "string",
          "description": "Destination folder ID. NOTE: this field is named parentId, not destinationFolderId."
        },
        "removeParents": {
          "type": "string"
        }
      },
      "additionalProperties": true,
      "required": [
        "fileId",
        "parentId"
      ]
    }
  • copyFile

    write

    Make a copy of a Drive file.

    Required paramsfileId
    Input schema
    {
      "type": "object",
      "properties": {
        "fileId": {
          "type": "string",
          "description": "Source file ID."
        },
        "name": {
          "type": "string",
          "description": "Optional new filename for the copy."
        },
        "parentId": {
          "type": "string",
          "description": "Optional destination folder ID for the copy."
        }
      },
      "additionalProperties": true,
      "required": [
        "fileId"
      ]
    }
  • deleteFile

    write

    Delete a Drive file (moves to Trash by default).

    Required paramsfileId
    Input schema
    {
      "type": "object",
      "properties": {
        "fileId": {
          "type": "string",
          "description": "Google Drive file ID to delete."
        }
      },
      "additionalProperties": true,
      "required": [
        "fileId"
      ]
    }
  • getFileById

    read

    Fetch a Drive file metadata block by ID.

    Required paramsfileId
    Input schema
    {
      "type": "object",
      "properties": {
        "fileId": {
          "type": "string",
          "description": "Google Drive file ID."
        },
        "fields": {
          "type": "string"
        }
      },
      "additionalProperties": true,
      "required": [
        "fileId"
      ]
    }
  • getFileByPath

    read

    Look up a Drive file by path-like name (e.g. "/Reports/2024/summary.pdf").

    Required paramspath
    Input schema
    {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Slash-separated path from My Drive root."
        },
        "fields": {
          "type": "string"
        }
      },
      "additionalProperties": true,
      "required": [
        "path"
      ]
    }