Skip to main content

Google Sheets

Connects to the Google Sheets API v4 (and the Drive API for file-level operations) for reading, writing, formatting, and managing spreadsheets. An agent can read and write ranges, manage sheets and structure, format cells, build charts and pivot tables, validate and protect data, and more.

Add to an agent node's tools array with _node_type: "tool-google-sheets". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
access_tokenYesGoogle OAuth access token, sent as Authorization: Bearer <access_token>. Typically resolved via oauth_connection_id. Spreadsheet-creation, deletion, and copy tools additionally require the drive.file OAuth scope.
{
"name": "google_sheets",
"_node_type": "tool-google-sheets",
"oauth_connection_id": "{{ connection.google }}"
}

Tools

Spreadsheet lifecycle

sheets_create_spreadsheet

Create a brand-new Google Sheets spreadsheet. Requires drive.file OAuth scope. Returns the spreadsheet ID and URL.

Parameters

ParameterTypeRequiredDescription
titlestringYesTitle of the new spreadsheet
localestringNoLocale (e.g. en_US). Optional.

Returns: A confirmation message with the spreadsheet's title, ID, and URL.

sheets_delete_spreadsheet

Permanently delete a Google Sheets spreadsheet via the Drive API. Requires drive.file scope.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID to delete

Returns: A confirmation message naming the deleted spreadsheet ID.

sheets_copy_spreadsheet

Create a full copy of a spreadsheet using the Drive API. Returns new spreadsheet ID and URL.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSource spreadsheet ID to copy
new_titlestringYesTitle for the copied spreadsheet

Returns: A confirmation message with the new title, new spreadsheet ID, and URL.

sheets_get_spreadsheet_meta

Get full spreadsheet metadata: title, locale, time zone, sheets, named ranges, and developer metadata.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID

Returns: Pretty-printed JSON of the spreadsheet's properties and sheets fields.

Data I/O

sheets_read_range

Read a range of cells. Returns tab-separated data.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
rangestringYesA1 notation range (e.g. Sheet1!A1:D10)

Returns: Tab-separated rows (one per line) of cell values, or "No data in range.".

sheets_read_formulas

Read cell formulas (=SUM(...) etc) instead of computed values.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
rangestringYesA1 notation range

Returns: Tab-separated rows of formula strings, or "No data in range.".

sheets_read_formatted_values

Read cells as they appear on screen (formatted strings like $1,234.56 or 12/31/2024).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
rangestringYesA1 notation range

Returns: Tab-separated rows of formatted display values, or "No data in range.".

sheets_write_range

Write values to a range. Supports strings, numbers, and formulas. Auto-batches large writes.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
rangestringYesA1 notation range. Sheet tab must exist.
valuesarray of arraysNo2D array of values (under 50 rows). Supports strings, numbers, and formulas.
csv_datastringNoTab-separated data with newlines. Use for 50+ rows.

Returns: A confirmation message with the number of cells updated and the target range. Returns an error if neither values nor csv_data is provided.

sheets_batch_write

Write large datasets using compact tab-separated format. Auto-batches in chunks of 1000 rows.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
csv_datastringYesTab-separated data with newlines
sheet_namestringNoSheet tab (default: Sheet1)
start_cellstringNoStarting cell (default: A1)

Returns: A confirmation message with the number of cells and rows written and the target range.

sheets_append_row

Append a single row at the bottom of a sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_namestringNoSheet tab (default: Sheet1)
rowarrayYesRow values to append

Returns: A confirmation message with the range the row was appended at.

sheets_batch_update_cells

Update multiple non-contiguous ranges in one call. Each range maps to tab-separated data.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
range_dataobject (map of string to string)YesMap of A1 ranges to tab-separated row data

Returns: A confirmation message with the total cells updated and the number of ranges.

sheets_clear_range

Clear all values in a range without deleting the cells.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
rangestringYesA1 notation range to clear

Returns: A confirmation message naming the cleared range.

sheets_find

Find cells matching a search string. Returns sheet name, cell reference, and value.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
querystringYesText to search for
sheet_namestringNoSpecific sheet to search (all if empty)
case_sensitivebooleanNoCase-sensitive search
max_resultsnumberNoMax matches to return (default: 50)

Returns: A count and list of <sheet>!<cell>: <value> matches, or "No matches found for '<query>'".

sheets_find_replace

Find and replace text across a sheet or the entire spreadsheet. Supports regex.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
findstringYesText to find
replacementstringYesReplacement text
sheet_idnumberNoLimit to this sheet ID (omit for all sheets)
rangestringNoLimit to this A1 range (omit for all)
match_casebooleanNoCase-sensitive match
match_entire_cellbooleanNoMatch entire cell contents only
search_by_regexbooleanNoTreat find as a regex pattern
include_formulasbooleanNoSearch inside formulas too

Returns: A confirmation message with the number of occurrences replaced.

sheets_paste_data

Paste raw delimited text data at a specific cell (like pasting CSV). Useful for importing.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
rownumberYes0-based row index to paste at
colnumberYes0-based column index to paste at
datastringYesRaw data to paste (comma or tab separated)
delimiterstringNoDelimiter: COMMA or CUSTOM (default: COMMA)
custom_delimiterstringNoCustom delimiter character when delimiter=CUSTOM

Returns: A confirmation message naming the row and column pasted at.

sheets_cut_paste

Cut a range and paste it to a new location (moves data, clears source).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
source_sheet_idnumberYesSource sheet numeric ID
source_startarray of 2 numbersYes[row, col] 0-based start of source range
source_endarray of 2 numbersYes[row, col] 0-based exclusive end of source range
dest_sheet_idnumberYesDestination sheet ID
dest_rownumberYesDestination row (0-based)
dest_colnumberYesDestination column (0-based)
paste_typestringNoPASTE_NORMAL, PASTE_VALUES, PASTE_FORMAT, PASTE_FORMULA (default: PASTE_NORMAL)

Returns: "Cut and paste complete."

sheets_copy_paste

Copy a range and paste it to a new location (source is preserved).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
source_sheet_idnumberYesSource sheet numeric ID
source_startarray of 2 numbersYes[row, col] 0-based start
source_endarray of 2 numbersYes[row, col] 0-based exclusive end
dest_sheet_idnumberYesDestination sheet ID
dest_startarray of 2 numbersYes[row, col] 0-based destination start
dest_endarray of 2 numbersYes[row, col] 0-based destination end
paste_typestringNoPASTE_NORMAL, PASTE_VALUES, PASTE_FORMAT, PASTE_FORMULA (default: PASTE_NORMAL)

Returns: "Copy and paste complete."

Structure — rows & columns

sheets_add_rows

Insert empty rows at a specific position.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYes0-based row index to insert before
countnumberYesNumber of rows to insert

Returns: A confirmation message with the number of rows inserted and the position.

sheets_add_columns

Insert empty columns at a specific position.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_colnumberYes0-based column index to insert before (A=0)
countnumberYesNumber of columns to insert

Returns: A confirmation message with the number of columns inserted and the column letter.

sheets_delete_rows

Delete a range of rows from a sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYes0-based start row index to delete
end_rownumberYes0-based exclusive end row index

Returns: A confirmation message naming the deleted row range.

sheets_delete_columns

Delete a range of columns from a sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_colnumberYes0-based start column index
end_colnumberYes0-based exclusive end column index

Returns: A confirmation message naming the deleted column range (as letters).

sheets_move_rows

Move rows to a different position within the same sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYes0-based start row index to move
end_rownumberYes0-based exclusive end row index
destination_indexnumberYes0-based index to move rows to

Returns: A confirmation message naming the moved row range and destination index.

sheets_move_columns

Move columns to a different position within the same sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_colnumberYes0-based start column index
end_colnumberYes0-based exclusive end column index
destination_indexnumberYes0-based index to move columns to

Returns: A confirmation message naming the moved column range and destination index.

Sheet management

sheets_get_info

Get all sheet tab names with their IDs, row/col counts, and frozen counts.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID

Returns: A multi-line summary listing the spreadsheet title and each sheet's title, sheetId, dimensions, and frozen row/column counts.

sheets_create_sheet

Create a new sheet tab. Returns the new sheet ID needed for formatting/charts.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
titlestringYesName for the new sheet tab
tab_colorstringNoTab color as hex (e.g. #4285F4)
rowsnumberNoInitial row count (default: 1000)
colsnumberNoInitial column count (default: 26)

Returns: A confirmation message with the new sheet's title and sheetId, or a message that the tab already exists.

sheets_delete_sheet

Delete a sheet tab by its numeric ID.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID

Returns: A confirmation message naming the deleted sheet ID.

sheets_rename_sheet

Rename a sheet tab.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
new_namestringYesNew name for the sheet tab

Returns: A confirmation message naming the sheet ID and new name.

sheets_copy_sheet

Copy a sheet tab to another spreadsheet (or the same one). Returns new sheet ID.

Parameters

ParameterTypeRequiredDescription
source_spreadsheet_idstringYesSource spreadsheet ID
source_sheet_idnumberYesNumeric sheet ID to copy
dest_spreadsheet_idstringYesDestination spreadsheet ID

Returns: A confirmation message with the new sheet's title and sheetId.

sheets_move_sheet

Move a sheet tab to a different position in the tab bar.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID to move
new_indexnumberYes0-based position to move the sheet to

Returns: A confirmation message naming the sheet ID and new index.

sheets_show_hide_sheet

Hide or show a sheet tab.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
hiddenbooleanYestrue to hide the sheet, false to show it

Returns: A confirmation message naming the sheet ID and the action taken (Shown/Hidden).

sheets_duplicate_sheet

Duplicate a sheet within the same spreadsheet with a new name.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID to duplicate
new_sheet_namestringYesName for the duplicate sheet
insert_sheet_indexnumberNoPosition for the new sheet (0-based)

Returns: A confirmation message with the new sheet's name and sheetId.

sheets_resize_sheet

Change the total row/column count of a sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
row_countnumberNoNew row count
col_countnumberNoNew column count

Returns: A confirmation message with the new dimensions. Returns an error if neither row_count nor col_count is given.

Formatting

sheets_format_cells

Format cells: background, font (bold/italic/underline/strikethrough/size/family/color), alignment, number format, borders, wrap, padding.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row index (0-based)
end_rownumberYesEnd row index (exclusive 0-based)
start_colnumberYesStart column index (0-based; A=0)
end_colnumberYesEnd column index (exclusive 0-based)
boldbooleanNoMake text bold
italicbooleanNoMake text italic
underlinebooleanNoUnderline text
strikethroughbooleanNoStrikethrough text
font_sizenumberNoFont size in points
font_familystringNoFont family (e.g. Arial, Roboto, Courier New)
font_colorstringNoFont color as hex (e.g. #FFFFFF)
background_colorstringNoCell background color as hex
h_alignstringNoHorizontal alignment: LEFT, CENTER, or RIGHT
v_alignstringNoVertical alignment: TOP, MIDDLE, or BOTTOM
number_formatstringNoNumber format pattern (e.g. #,##0.00, 0.0%, $#,##0.00, yyyy-mm-dd)
wrap_strategystringNoText wrap: OVERFLOW_CELL, CLIP, or WRAP
bordersstringNoBorder style: SOLID, DASHED, DOTTED, or SOLID_MEDIUM (applies to all four sides)
border_colorstringNoBorder color as hex (default: #000000)
paddingnumberNoCell padding in pixels (applied to all sides)

Returns: A confirmation message naming the formatted row/column range. Returns an error if no formatting options are specified.

sheets_auto_resize

Auto-resize columns to fit content.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_colnumberYesStart column index (0-based)
end_colnumberYesEnd column index (exclusive)

Returns: A confirmation message naming the resized column range.

sheets_set_column_width

Set a fixed pixel width for a range of columns.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_colnumberYesStart column index (0-based)
end_colnumberYesEnd column index (exclusive)
pixel_sizenumberYesColumn width in pixels

Returns: A confirmation message naming the column range and new width.

sheets_set_row_height

Set a fixed pixel height for a range of rows.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row index (0-based)
end_rownumberYesEnd row index (exclusive)
pixel_sizenumberYesRow height in pixels

Returns: A confirmation message naming the row range and new height.

sheets_merge_cells

Merge a range of cells.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)
merge_typestringNoMERGE_ALL (default), MERGE_COLUMNS, or MERGE_ROWS

Returns: A confirmation message naming the merged row/column range.

sheets_unmerge_cells

Unmerge previously merged cells.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)

Returns: A confirmation message naming the unmerged row/column range.

sheets_conditional_format

Add conditional formatting rules or color scale heatmaps.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)
rule_typestringYesNUMBER_GREATER, NUMBER_LESS, NUMBER_BETWEEN, TEXT_CONTAINS, CUSTOM_FORMULA, COLOR_SCALE
valuesarray of stringsNoComparison values. NUMBER_GREATER/LESS: [value]. NUMBER_BETWEEN: [min, max]. TEXT_CONTAINS: [text]. CUSTOM_FORMULA: [formula].
background_colorstringNoBackground color when condition is true (hex)
font_colorstringNoFont color when condition is true (hex)
min_colorstringNoCOLOR_SCALE: min color (hex)
mid_colorstringNoCOLOR_SCALE: midpoint color (hex)
max_colorstringNoCOLOR_SCALE: max color (hex)

Returns: A confirmation message naming the rule type and the affected row/column range.

sheets_clear_conditional_format

Delete a conditional formatting rule by its index.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
rule_indexnumberYes0-based index of the conditional format rule to delete

Returns: A confirmation message naming the deleted rule index and sheet ID.

sheets_set_borders

Set individual border styles (top/bottom/left/right/inner) independently on a range.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)
topstringNoTop border style: SOLID, DASHED, DOTTED, SOLID_MEDIUM, SOLID_THICK, DOUBLE, or NONE
bottomstringNoBottom border style
leftstringNoLeft border style
rightstringNoRight border style
inner_horizontalstringNoInner horizontal border style
inner_verticalstringNoInner vertical border style
colorstringNoBorder color as hex (default: #000000)

Returns: A confirmation message naming the bordered row/column range. Returns an error if no border side is specified.

sheets_set_text_rotation

Rotate cell text at an angle or stack vertically.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)
anglenumberYesRotation angle in degrees (-90 to 90). Use 90 for vertical text.
verticalbooleanNoSet to true for stacked vertical text instead of angled

Returns: A confirmation message naming the affected row/column range.

sheets_freeze

Freeze rows and/or columns (header pinning).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
frozen_rowsnumberNoNumber of rows to freeze (0 = none)
frozen_colsnumberNoNumber of columns to freeze (0 = none)

Returns: A confirmation message naming the number of rows/columns frozen and the sheet ID.

sheets_unfreeze

Remove all row/column freezing from a sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID

Returns: A confirmation message naming the sheet ID.

sheets_hide_rows

Hide a range of rows.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row index (0-based)
end_rownumberYesEnd row index (exclusive)

Returns: A confirmation message naming the hidden row range.

sheets_hide_columns

Hide a range of columns.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_colnumberYesStart column index (0-based)
end_colnumberYesEnd column index (exclusive)

Returns: A confirmation message naming the hidden column range (as letters).

sheets_unhide_rows

Unhide a range of rows.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row index (0-based)
end_rownumberYesEnd row index (exclusive)

Returns: A confirmation message naming the unhidden row range.

sheets_unhide_columns

Unhide a range of columns.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_colnumberYesStart column index (0-based)
end_colnumberYesEnd column index (exclusive)

Returns: A confirmation message naming the unhidden column range (as letters).

sheets_set_tab_color

Change the color of a sheet tab.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
colorstringYesTab color as hex (e.g. #FF0000)

Returns: A confirmation message naming the new tab color and sheet ID.

Named ranges

sheets_add_named_range

Create a named range so formulas can reference it by name (e.g. =SUM(SalesData)).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
namestringYesName for the range (e.g. SalesData)
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)

Returns: A confirmation message with the new named range's name and ID.

sheets_delete_named_range

Delete a named range by its ID.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
named_range_idstringYesNamed range ID (from sheets_list_named_ranges)

Returns: A confirmation message naming the deleted named range ID.

sheets_list_named_ranges

List all named ranges in the spreadsheet with their IDs and cell ranges.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID

Returns: A list of named ranges with their IDs and row/column extents, or "No named ranges found.".

Data validation

sheets_add_data_validation

Add data validation (dropdowns, number ranges, date constraints, custom formulas) to a range.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)
condition_typestringYesONE_OF_LIST, ONE_OF_RANGE, NUMBER_BETWEEN, NUMBER_GREATER, NUMBER_LESS, TEXT_CONTAINS, DATE_BEFORE, DATE_AFTER, CUSTOM_FORMULA
valuesarray of stringsNoValues for the condition (dropdown items, range, formula, etc.)
show_dropdownbooleanNoShow a dropdown UI for ONE_OF_LIST
input_messagestringNoHelp text shown when cell is selected
strictbooleanNoReject invalid input (true) vs. just warn (false)

Returns: A confirmation message naming the condition type and affected row/column range.

sheets_clear_data_validation

Remove data validation rules from a range.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)

Returns: A confirmation message naming the cleared row/column range.

Filters & sorting

sheets_set_basic_filter

Enable the basic auto-filter on a range (adds the dropdown arrows in the header row).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)

Returns: A confirmation message naming the filtered row/column range.

sheets_clear_basic_filter

Remove the basic auto-filter from a sheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID

Returns: A confirmation message naming the sheet ID.

sheets_add_filter_view

Create a saved filter view (named filters that can be toggled without affecting other viewers).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
titlestringYesName for the filter view
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)

Returns: A confirmation message with the filter view's title and ID.

sheets_delete_filter_view

Delete a saved filter view by ID.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
filter_view_idnumberYesFilter view ID to delete

Returns: A confirmation message naming the deleted filter view ID.

sheets_sort_range

Sort a range of rows by a specific column.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)
sort_col_indexnumberYes0-based column index to sort by (relative to start_col)
ascendingbooleanYestrue for ascending (A-Z / 0-9), false for descending

Returns: A confirmation message naming the sorted row range, sort column, and order.

Pivot tables

sheets_create_pivot_table

Create a pivot table summarizing source data with row/column groupings and value aggregation.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
source_sheet_idnumberYesSheet ID containing source data
source_start_rownumberYesSource data start row (0-based)
source_end_rownumberYesSource data end row (exclusive)
source_start_colnumberYesSource data start column (0-based)
source_end_colnumberYesSource data end column (exclusive)
dest_sheet_idnumberYesSheet ID to place the pivot table
dest_rownumberYesRow to anchor pivot table (0-based)
dest_colnumberYesColumn to anchor pivot table (0-based)
row_group_colsarray of numbersYes0-based source column indices to use as row groups
col_group_colsarray of numbersNo0-based source column indices to use as column groups
value_colnumberYes0-based source column index to aggregate
value_functionstringNoAggregation: SUM, COUNT, AVERAGE, MAX, MIN, COUNTA (default: SUM)

Returns: A confirmation message describing the pivot table's location and aggregation.

Charts

sheets_create_chart

Create an embedded chart from spreadsheet data. Supports bar, column, line, area, scatter, pie, combo, histogram, candlestick, waterfall, and treemap.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID where data lives
chart_typestringYesBAR, COLUMN, LINE, AREA, SCATTER, PIE, COMBO, STEPPED_AREA, CANDLESTICK, HISTOGRAM, WATERFALL, TREEMAP
titlestringNoChart title
subtitlestringNoChart subtitle
data_start_rownumberYesStart row of data (0-based inclusive)
data_end_rownumberYesEnd row of data (0-based exclusive)
data_start_colnumberYesStart column (0-based) — used as the chart's domain/category axis
data_end_colnumberYesEnd column (0-based exclusive) — remaining columns become data series
header_countnumberNoNumber of header rows (default: 1)
position_rownumberNoRow to anchor the chart (0-based)
position_colnumberNoColumn to anchor the chart (0-based, default: just past data_end_col)
width_pixelsnumberNoChart width in pixels (default: 600)
height_pixelsnumberNoChart height in pixels (default: 371)
stackedbooleanNoStack series (BAR/COLUMN/AREA)
legend_positionstringNoBOTTOM_LEGEND, TOP_LEGEND, LEFT_LEGEND, RIGHT_LEGEND, NO_LEGEND (default: BOTTOM_LEGEND)

Returns: A confirmation message with the chart type, title, and new chart ID.

sheets_delete_chart

Delete an embedded chart by its ID.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
chart_idnumberYesChart ID to delete (from sheets_create_chart or sheets_list_charts)

Returns: A confirmation message naming the deleted chart ID.

sheets_list_charts

List all embedded charts in the spreadsheet with their IDs, types, and titles.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID

Returns: A list of chartId=<id> title="<title>" lines, or "No charts found.".

Protection

sheets_protect_range

Protect a range from edits. Can be warning-only or strictly locked to specific editors.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
start_rownumberYesStart row (0-based)
end_rownumberYesEnd row (exclusive)
start_colnumberYesStart column (0-based)
end_colnumberYesEnd column (exclusive)
descriptionstringNoDescription of why this range is protected
warning_onlybooleanNoShow warning but still allow edits
editor_emailsarray of stringsNoEmail addresses allowed to edit (used only when warning_only is false)

Returns: A confirmation message naming the protected row/column range and the new protected range ID.

sheets_protect_sheet

Protect an entire sheet tab from edits.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID to protect
descriptionstringNoDescription
warning_onlybooleanNoWarning only mode
editor_emailsarray of stringsNoEmails allowed to edit (used only when warning_only is false)

Returns: A confirmation message naming the protected sheet ID and the new protected range ID.

sheets_remove_protection

Remove a protection rule by its ID.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
protected_range_idnumberYesProtected range ID to remove (from sheets_list_protections)

Returns: A confirmation message naming the removed protection ID.

sheets_list_protections

List all protection rules (ranges and sheets) in the spreadsheet.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID

Returns: A list of id=<id> desc="<description>" warningOnly=<bool> lines, or "No protections found.".

Notes & comments

sheets_add_note

Add or update a cell note (comment) at a specific cell.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
rownumberYesRow index (0-based)
colnumberYesColumn index (0-based)
notestringYesNote text content

Returns: A confirmation message naming the cell reference (e.g. B3).

sheets_clear_note

Remove the note from a specific cell.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
sheet_idnumberYesNumeric sheet ID
rownumberYesRow index (0-based)
colnumberYesColumn index (0-based)

Returns: A confirmation message naming the cell reference the note was cleared from.

Developer metadata

sheets_add_developer_metadata

Attach key-value developer metadata to the spreadsheet (useful for tagging with external IDs).

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
keystringYesMetadata key
valuestringYesMetadata value
visibilitystringNoDOCUMENT or PROJECT (default: DOCUMENT)

Returns: A confirmation message with the key, value, and new metadata ID.

sheets_get_developer_metadata

Retrieve developer metadata entries matching a key.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
keystringYesMetadata key to look up

Returns: A list of id=<id> key="<key>" value="<value>" lines, or "No metadata found for key=\"<key>\"".

Spreadsheet settings

sheets_update_spreadsheet_properties

Update spreadsheet-level settings: title, locale, timezone, default number format.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
titlestringNoNew spreadsheet title
localestringNoLocale code (e.g. en_US, fr_FR)
time_zonestringNoTime zone (e.g. America/New_York)
default_number_formatstringNoDefault number format pattern for new cells

Returns: A confirmation message listing the updated property names. Returns an error if no properties are provided.

sheets_set_iterative_calculation

Enable/disable iterative calculation for circular references, and set max iterations and convergence threshold.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
enable_iterationbooleanYestrue to enable iterative calculation (for circular references)
max_iterationsnumberNoMax iteration count (default: 100)
convergence_thresholdnumberNoStop iterating when change is smaller than this (default: 0.001)

Returns: A confirmation message stating whether iterative calculation is enabled.

Raw batch update (escape hatch)

sheets_batch_update

Execute raw batchUpdate requests for any advanced operation not covered by other tools.

Parameters

ParameterTypeRequiredDescription
spreadsheet_idstringYesSpreadsheet ID
requests_jsonstringYesJSON array of Sheets API batchUpdate request objects

Returns: A confirmation message with the number of requests executed. Returns an error if requests_json is not valid JSON.

Next