Skip to content

feat: add shared drive support to all Drive operations #41

@aliwatters

Description

@aliwatters

Summary

Drive tools only search/list files in the user's personal "My Drive". Shared drive files are invisible. This affects drive_search, drive_list, drive_get, drive_download, and all other drive operations.

Root Cause

The Google Drive API requires two flags to access shared drive content:

  • IncludeItemsFromAllDrives(true)
  • SupportsAllDrives(true)

Neither is set in the current implementation (internal/drive/drive_service.go and internal/drive/drive_tools_testable.go).

Impact

  • drive_search with fullText contains only returns results from My Drive
  • drive_list can't browse shared drive folders
  • Users in Google Workspace orgs (where shared drives are common) can't access most of their files

Fix

Add both flags to all Drive API calls:

// files.list (search, list)
srv.Files.List().
    Q(query).
    IncludeItemsFromAllDrives(true).
    SupportsAllDrives(true).
    // ...

// files.get
srv.Files.Get(fileId).
    SupportsAllDrives(true).
    // ...

// files.create, files.update, files.delete, etc.
srv.Files.Create(file).
    SupportsAllDrives(true).
    // ...

Also consider adding a corpora parameter to drive_search to let users scope searches:

  • user — My Drive only (current default)
  • allDrives — My Drive + shared drives
  • drive — specific shared drive (requires driveId)

Default should be allDrives for the most useful behavior.

Acceptance Criteria

  • drive_search returns results from shared drives
  • drive_list can browse shared drive folders
  • drive_get, drive_download, drive_upload, drive_move, drive_copy, drive_trash, drive_delete all work with shared drive files
  • drive_share and drive_get_permissions work with shared drive files
  • Add optional corpora parameter to drive_search (default: allDrives)
  • Update tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions