Google Productivity
Google Docs, Sheets, and Slides toolsets.
#Google productivity
GoogleDocsToolSet, GoogleSheetsToolSet, and GoogleSlidesToolSet wrap the Docs, Sheets, and Slides APIs respectively. They share the OAuth bearer token handling from google_workspace._shared.
All three toolsets are content-level editors -- they assume you already have the document/spreadsheet/presentation ID. To find one by name, use GoogleDriveToolSet.search_files(include_ids=True) and pass the returned file dict into any of these tools. The Docs / Sheets / Slides tools accept either a raw ID string or a Drive file dict (or a dict from another tool in the same toolset) and will pull the right ID out.
#GoogleDocsToolSet
from maivn_tools import GoogleDocsToolSet
connector = GoogleDocsToolSet(token=token_cache)#Agent-ready behavior
GoogleDocsToolSethas no list/search of its own -- useGoogleDriveToolSet.search_files(include_ids=True)to locate a Doc, then pass the returned file dict toget_document/batch_update/insert_text/replace_text/delete_content_range. The connector readsdoc_id/document_id/documentId/file_id/idout of the dict.create_documentreturns the new Doc resource; pass itsdocumentId(or the whole dict) to the edit tools to populate it.
# Find then edit, without unwrapping IDs by hand.
file = drive.search_files("name = 'Launch plan'", include_ids=True)["files"][0]
docs.insert_text(file, text="Status update\n")#Destructive tools
delete_content_range is tagged destructive and requires PermissionFlag.DELETE. Filter it off the toolset with exclude_tags=["destructive"] to exclude tagged destructive methods.
#GoogleSheetsToolSet
from maivn_tools import GoogleSheetsToolSet
connector = GoogleSheetsToolSet(token=token_cache)#Agent-ready behavior
GoogleSheetsToolSetis a value/range editor -- useGoogleDriveToolSet.search_files(include_ids=True)to locate a spreadsheet, then pass the returned file dict to any of these tools. The connector readssheet_ref_id/spreadsheet_id/spreadsheetId/file_id/idout of the dict.get_spreadsheetreturns the full Sheets resource; withinclude_grid_data=Trueandrangesyou also get cell-level values.create_spreadsheetreturns the new resource; pass itsspreadsheetId(or the whole dict) to the value / batch_update tools.
file = drive.search_files("name = 'Q4 forecast'", include_ids=True)["files"][0]
sheets.get_values(file, range="Plan!A1:D20")#Destructive tools
clear_values and delete_sheet are tagged destructive and require PermissionFlag.DELETE. clear_values removes cell contents but leaves formatting; delete_sheet removes an entire tab. Filter them off the toolset with exclude_tags=["destructive"] to exclude tagged destructive methods.
#GoogleSlidesToolSet
from maivn_tools import GoogleSlidesToolSet
connector = GoogleSlidesToolSet(token=token_cache)#Agent-ready behavior
GoogleSlidesToolSetis a slide/shape/text editor -- useGoogleDriveToolSet.search_files(include_ids=True)to locate a deck, then pass the returned file dict to any of these tools. The connector readspresentation_id/presentationId/file_id/idout of the dict.get_presentationreturns the full Slides resource withslides[*],masters[*],layouts[*]. Each slide'sobjectIdis thepage_object_idargument forget_page/get_page_thumbnail, and the input for theobject_idargument ofinsert_text/delete_object.create_presentationreturns the new resource; pass itspresentationId(or the whole dict) to the edit tools.
file = drive.search_files("name = 'All-hands deck'", include_ids=True)["files"][0]
deck = slides.get_presentation(file)
slides.replace_all_text(file, find="{{date}}", replace="2026-05-16")#Destructive tools
delete_object is tagged destructive and requires PermissionFlag.DELETE. It removes a slide, shape, or other page object permanently. Filter it off the toolset with exclude_tags=["destructive"] to exclude tagged destructive methods.