Skip to content

Documentation navigation

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

Python
from maivn_tools import GoogleDocsToolSet

connector = GoogleDocsToolSet(token=token_cache)
ToolPermissionDescription
get_document(document_id)READFetch a Doc. Accepts a raw doc ID or a Drive file dict.
create_document(title)WRITECreate a blank Doc.
batch_update(document_id, requests, write_control)WRITEApply Docs API update requests.
insert_text(document_id, text, index)WRITEInsert text.
replace_text(document_id, find, replace, match_case)WRITEFind/replace.
delete_content_range(document_id, start_index, end_index)DELETE (destructive)Delete a range.

#Agent-ready behavior

  • GoogleDocsToolSet has no list/search of its own -- use GoogleDriveToolSet.search_files(include_ids=True) to locate a Doc, then pass the returned file dict to get_document / batch_update / insert_text / replace_text / delete_content_range. The connector reads doc_id / document_id / documentId / file_id / id out of the dict.
  • create_document returns the new Doc resource; pass its documentId (or the whole dict) to the edit tools to populate it.
Python
# 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

Python
from maivn_tools import GoogleSheetsToolSet

connector = GoogleSheetsToolSet(token=token_cache)
ToolPermissionDescription
get_spreadsheet(spreadsheet_id, include_grid_data, ranges)READMetadata + grid data. Accepts a raw ID or a Drive file dict.
create_spreadsheet(title, sheets)WRITECreate a spreadsheet.
get_values(spreadsheet_id, range, major_dimension, value_render_option, date_time_render_option)READRead a range.
batch_get_values(spreadsheet_id, ranges, major_dimension, value_render_option)READMulti-range read.
update_values(spreadsheet_id, range, values, value_input_option)WRITEOverwrite a range.
append_values(spreadsheet_id, range, values, value_input_option, insert_data_option)WRITEAppend rows.
clear_values(spreadsheet_id, range)DELETE (destructive)Clear a range.
batch_update(spreadsheet_id, requests)WRITESpreadsheet-level updates.
add_sheet(spreadsheet_id, title, row_count, column_count)WRITEAdd a sheet.
delete_sheet(spreadsheet_id, sheet_id)DELETE (destructive)Remove a sheet.

#Agent-ready behavior

  • GoogleSheetsToolSet is a value/range editor -- use GoogleDriveToolSet.search_files(include_ids=True) to locate a spreadsheet, then pass the returned file dict to any of these tools. The connector reads sheet_ref_id / spreadsheet_id / spreadsheetId / file_id / id out of the dict.
  • get_spreadsheet returns the full Sheets resource; with include_grid_data=True and ranges you also get cell-level values.
  • create_spreadsheet returns the new resource; pass its spreadsheetId (or the whole dict) to the value / batch_update tools.
Python
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

Python
from maivn_tools import GoogleSlidesToolSet

connector = GoogleSlidesToolSet(token=token_cache)
ToolPermissionDescription
get_presentation(presentation_id)READFetch presentation. Accepts a raw ID or a Drive file dict.
get_page(presentation_id, page_object_id)READOne slide / master / layout.
get_page_thumbnail(presentation_id, page_object_id, thumbnail_size, mime_type)READSlide thumbnail URL.
create_presentation(title)WRITENew deck.
batch_update(presentation_id, requests)WRITESlides API update requests.
create_slide(presentation_id, insertion_index, layout, object_id)WRITEInsert a slide.
insert_text(presentation_id, object_id, text, insertion_index)WRITEAdd text to a shape.
replace_all_text(presentation_id, find, replace, match_case)WRITEFind/replace.
delete_object(presentation_id, object_id)DELETE (destructive)Remove a slide / shape.

#Agent-ready behavior

  • GoogleSlidesToolSet is a slide/shape/text editor -- use GoogleDriveToolSet.search_files(include_ids=True) to locate a deck, then pass the returned file dict to any of these tools. The connector reads presentation_id / presentationId / file_id / id out of the dict.
  • get_presentation returns the full Slides resource with slides[*], masters[*], layouts[*]. Each slide's objectId is the page_object_id argument for get_page / get_page_thumbnail, and the input for the object_id argument of insert_text / delete_object.
  • create_presentation returns the new resource; pass its presentationId (or the whole dict) to the edit tools.
Python
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.