Adding nextPageToken for pagination in drive tools

This commit is contained in:
Francisco
2026-02-26 12:46:51 +13:00
parent 9631b9e3eb
commit 117c6af88b
3 changed files with 211 additions and 7 deletions

View File

@@ -181,6 +181,7 @@ def build_drive_list_params(
drive_id: Optional[str] = None,
include_items_from_all_drives: bool = True,
corpora: Optional[str] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
"""
Helper function to build common list parameters for Drive API calls.
@@ -191,6 +192,7 @@ def build_drive_list_params(
drive_id: Optional shared drive ID
include_items_from_all_drives: Whether to include items from all drives
corpora: Optional corpus specification
page_token: Optional page token for pagination (from a previous nextPageToken)
Returns:
Dictionary of parameters for Drive API list calls
@@ -203,6 +205,9 @@ def build_drive_list_params(
"includeItemsFromAllDrives": include_items_from_all_drives,
}
if page_token:
list_params["pageToken"] = page_token
if drive_id:
list_params["driveId"] = drive_id
if corpora: