← Back to all apps

Google Sheets

Productivityby OpenAI

Connector for interacting with Google Sheets via the REST API. Supports reading spreadsheet data, applying raw spreadsheet batch updates, creating spreadsheets, and fetching the current user's profile.

11ChatGPT Tools
OpenAIDeveloper
ProductivityCategory

Available Tools

Add Sheet To Spreadsheet

add_sheet_to_spreadsheet
Full Description

Add a new sheet to an existing spreadsheet.

Parameters (2 required)
Required
sheet_namestring

Exact sheet tab title (e.g. Sheet1 or Q1 Plan). Do not add A1 quotes, !, or coordinates.

spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID.

Append Range

append_range
Full Description

Append values to the end of a logical table within a spreadsheet.

Preferred tool for adding new rows at the bottom of existing data.

Parameters (4 required)
Required
rangestring

Optional A1 range used to find the logical table to append to, e.g. A1:D1 or B:E. Do not include the sheet name here and avoid partial bounds like A1:D. Use append_range whenever the intent is 'add row(s) at the bottom' so Google Sheets picks the next row automatically (instead of manually targeting A{n+1}:...). Pass null to append using the whole sheet.

sheet_namestring

Sheet tab name only (no ! or coordinates). For A1 notation compatibility, quote names with spaces/punctuation (e.g. 'Q1 Plan'). If the name contains a single quote, escape it as two single quotes inside the quoted name (e.g. 'O''Reilly').

spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID.

valuesarray

Rows to append. Each inner list is one row. Keep column count consistent with your table schema.

Batch Update

batch_update
Full Description

Apply raw Google Sheets batchUpdate requests to a spreadsheet.

If editing a spreadsheet created earlier in the turn, wait for the create or duplicate action to return successfully before calling this action. Use only the spreadsheet ID or URL returned by that earlier action.

Parameters (1 required, 5 optional)
Required
requestsarray

Raw Google Sheets API batchUpdate requests, in execution order. Each item should use the Sheets REST request shape directly, for example {'addSheet': {...}} or {'updateCells': {...}}. Use Google field names and casing exactly. Send each request as a structured object, not as a JSON string or other stringified input.

Optional
include_spreadsheet_in_responseboolean

When true, include the updated spreadsheet resource in the response.

Default: False
response_include_grid_databoolean

When true, include grid data in updatedSpreadsheet. Only meaningful when include_spreadsheet_in_response is true.

Default: False
response_rangesarray

Optional A1 ranges to include in updatedSpreadsheet when include_spreadsheet_in_response is true.

Default: null
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null

Clear Range

clear_range
Full Description

Clear values from a range of cells within a spreadsheet.

Parameters (2 required, 1 optional)
Required
sheet_namestring

Sheet tab name only (no ! or coordinates). For A1 notation compatibility, quote names with spaces/punctuation (e.g. 'Q1 Plan'). If the name contains a single quote, escape it as two single quotes inside the quoted name (e.g. 'O''Reilly').

spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID.

Optional
rangestring

The range of cells to clear (A1 or R1C1 notation). Use null to clear the entire sheet.

Default: null

Create Chart

create_chart
Full Description

Create an embedded chart on a new sheet from the specified range.

Parameters (4 required, 12 optional)
Required
chart_titlestring

Title for the chart

rangestring

Primary chart source range in bounded A1 notation with explicit start/end cells, e.g. A1:B20. Do not include sheet name. Use exactly two columns here: first column for labels, second column for the first numeric series. Add any extra series through series_ranges/secondary_series_ranges.

sheet_namestring

Exact sheet tab name containing the chart data (for this tool, pass the literal tab name without A1 quoting).

spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID.

Optional
anchor_cellstring

Optional anchor cell like F1 (single cell only, no sheet prefix). Use null to create chart on a new sheet.

Default: null
chart_typestring

Chart type: COLUMN, LINE, BAR, SCATTER, AREA, COMBO, STEPPED_AREA. If using stacked_type, prefer COLUMN/AREA/BAR; LINE often rejects stacked_type. BAR can be stricter about series axis assignments in Google Sheets.

Default: COLUMN
header_countinteger

Number of header rows at the top of the range to use for labels (e.g., 1 to use row 1).

Default: null
legend_positionstring

Legend position: BOTTOM_LEGEND, TOP_LEGEND, LEFT_LEGEND, RIGHT_LEGEND, NO_LEGEND

Default: BOTTOM_LEGEND
secondary_series_rangesarray

Optional ranges for series on the right axis. Each entry must be a single-row or single-column bounded A1 range (e.g. D1:D20), with no sheet prefix.

Default: null
series_rangesarray

Optional additional series ranges on the left axis. Each entry must be a single-row or single-column bounded A1 range (e.g. C1:C20), with no sheet prefix.

Default: null
stacked_typestring

Stacking option: STACKED, PERCENT_STACKED, or NOT_STACKED. Set only when supported by chart_type.

Default: null
title_font_colorstring

Optional hex color or named color for the chart title text (e.g. '#1A2B3C' or 'black').

Default: null
title_font_familystring

Optional font family for the chart title, e.g. 'Arial'.

Default: null
title_font_sizeinteger

Optional font size (points) for the chart title.

Default: null
x_axis_titlestring

Custom title for X-axis

Default: X-Axis
y_axis_titlestring

Custom title for Y-axis

Default: Y-Axis

Create Spreadsheet

create_spreadsheet
Full Description

Create a new spreadsheet with an initial sheet.

This creation flow is eventually consistent. Do not mention or synthesize a Google Sheets URL until this action returns, and then use only the spreadsheet URL returned in the response.

Parameters (1 required, 1 optional)
Required
titlestring

The title of the spreadsheet document.

Optional
sheet_namestring

The name of the first sheet in the new spreadsheet. Use null for the default name 'Sheet1'.

Default: null

Duplicate Sheet

duplicate_sheet
Full Description

Duplicate an existing sheet within a spreadsheet.

Parameters (2 required, 2 optional)
Required
source_sheet_namestring

Exact sheet tab title (e.g. Sheet1 or Q1 Plan). Do not add A1 quotes, !, or coordinates.

spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID.

Optional
insert_indexinteger

Optional index where the new sheet should be inserted (0-based). Use null to append at end.

Default: null
new_sheet_namestring

Optional name for the duplicate sheet. Must be unique in the spreadsheet and 100 characters or fewer. Use null to let Google assign a unique name.

Default: null

Duplicate Sheet In New File

duplicate_sheet_in_new_file
Full Description

Duplicate an existing sheet into a newly created spreadsheet file.

This creation flow is eventually consistent. Do not mention or synthesize a Google Sheets URL until this action returns, and then use only the spreadsheet URL returned in the response.

Parameters (2 required, 3 optional)
Required
new_file_namestring
source_sheet_namestring
Optional
new_sheet_namestring
Default: null
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null

Export

export
Full Description

Export a Google Sheet to the requested MIME type.

Parameters (0 required, 3 optional)
Optional
mime_typestring

Export MIME type understood by Google Drive files.export, for example application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, or text/csv.

Default: application/pdf
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null

Get Cells

get_cells
Full Description

Read cell data from one or more bounded ranges using the Google Sheets CellData shape.

Prefer this action over get_range for most reads. Use get_range only when all you need is the sheet's plain values; use get_cells for formatting, formulas, validation, notes, hyperlinks, and other cell metadata.

Parameters (1 required, 3 optional)
Required
rangesarray

One or more A1 ranges including the sheet name, e.g. ['Sheet1!A1:C20']. Keep each range within existing sheet bounds.

Optional
cell_fieldsstring

Raw Google Sheets CellData field mask fragment. Examples: 'formattedValue,effectiveValue' or 'formattedValue,userEnteredValue,effectiveFormat(textFormat,numberFormat)'. Default: 'userEnteredValue,userEnteredFormat'. Prefer this action over `get_range` unless you only need the plain cell values; use this action for formatting, formulas, validation, notes, hyperlinks, and other cell metadata.

Default: null
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null

Get Profile

get_profile
Full Description

Return the connected Google account profile.

Get Range

get_range
Full Description

Read only the plain values from a range of cells within a spreadsheet.

Use get_cells instead when you need cell values together with formatting, formulas, validation, notes, hyperlinks, or other CellData.

Parameters (2 required, 3 optional)
Required
rangestring

Cell range only (A1 or R1C1), e.g. A1:B10, A:Z, or 1:200. Do not include the sheet name here (pass it only in sheet_name), and do not pass duplicated prefixes like Sheet1!Sheet1!A1:B10. Keep the range within existing sheet bounds. Use this action only when you need the plain values of a range; use `get_cells` when you need cell values together with formatting, formulas, validation, notes, hyperlinks, or other cell metadata.

sheet_namestring

Sheet tab name only (no ! or coordinates). For A1 notation compatibility, quote names with spaces/punctuation (e.g. 'Q1 Plan'). If the name contains a single quote, escape it as two single quotes inside the quoted name (e.g. 'O''Reilly').

Optional
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null
value_render_option

The option to render the values, e.g. 'FORMATTED_VALUE', 'UNFORMATTED_VALUE' or 'FORMULA'. Use null for default.

Default: null

Get Spreadsheet Comments

get_spreadsheet_comments
Full Description

Read user comments and replies on a Google Sheets spreadsheet for additional review context.

Parameters (0 required, 5 optional)
Optional
include_deletedboolean

When true, include deleted comments and deleted replies in the result.

Default: False
page_sizeinteger

Maximum comment threads to return on this page. Use the response nextPageToken to continue.

Default: 100
page_tokenstring

Opaque nextPageToken from a previous get_spreadsheet_comments response.

Default: null
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null

Get Spreadsheet Metadata

get_spreadsheet_metadata
Full Description

Get metadata about a spreadsheet.

Parameters (0 required, 4 optional)
Optional
charts_onlyboolean

When true, return only sheet properties and chart IDs/titles.

Default: False
include_conditional_format_rulesboolean

When true, include per-sheet conditional formatting rules in the response.

Default: False
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null

Insert Range

insert_range
Full Description

Insert one or more rows at the specified location and populate them with values.

Parameters (4 required)
Required
sheet_namestring

Exact sheet tab title (e.g. Sheet1 or Q1 Plan). Do not add A1 quotes, !, or coordinates.

spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID.

start_row_indexinteger

0-based index where to insert rows (0 = before first row, 1 = before second row, etc.)

valuesarray

Values to populate the inserted rows. The number of rows will be inferred from this.

Search Rows

search_rows
Full Description

Search for rows containing a query string and return matching rows as a Markdown table.

Usage guidance:

  • Retrieve the first row (e.g. with get_range using A1:Z1) to learn header names and

column positions; it is often a header row.

  • Then call this tool to search within a larger range. This returns only matching rows

and is preferable to retrieving the entire range, which can exhaust the context window.

  • The returned markdown table includes a leading Row column with 1-based row numbers

relative to the provided range (the header row is left blank).

Implementation notes: this tool fetches the full selected range, scans each row client-side, and returns all matching rows with the requested columns.

Parameters (3 required, 6 optional)
Required
querystring

String to search for in any cell within each row.

rangestring

Cell range to search (A1 or R1C1), e.g. A1:Z200. Do not include the sheet name here (passing Sheet1!A1:Z200 will fail because sheet_name is prepended automatically).

sheet_namestring

Sheet tab name only (no ! or coordinates). For A1 notation compatibility, quote names with spaces/punctuation (e.g. 'Q1 Plan'). If the name contains a single quote, escape it as two single quotes inside the quoted name (e.g. 'O''Reilly').

Optional
column_numbersarray

1-based column numbers to return. Use null to return all columns (up to max_columns).

Default: null
include_header_rowboolean

When true, always include the header row as the first data row in the output.

Default: True
max_columnsinteger

Maximum number of columns to return when column_numbers is null. Default is 100.

Default: 100
max_rowsinteger

Maximum number of rows to return from the selected range. Default is 500.

Default: 500
spreadsheet_idstring

Raw Google Sheets spreadsheet ID only (for example `1abcDEF...`). Use this when you already have the ID from a prior search result. Do not pass a full URL here.

Default: null
spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID. If you only know the spreadsheet title or title keywords, call `search_spreadsheets` first instead of asking the user for a URL.

Default: null

Search Spreadsheets

search_spreadsheets
Full Description

Search Google Drive for Google Sheets spreadsheets by title before reading or editing.

Parameters (1 required, 2 optional)
Required
querystring

Keyword query for finding a Google Sheets spreadsheet in Drive. Use the spreadsheet title or short title keywords, not a long natural-language instruction.

Optional
require_viewed_by_userboolean

When true, keep only spreadsheets viewed by the authenticated user.

Default: False
topninteger

Maximum spreadsheets to return. Parameter name is `topn`.

Default: 10

Write Range

write_range
Full Description

Write values to an exact range of cells within a spreadsheet.

Use this when you have a specific destination range (for example A2:D2 or A2:D200). This does not auto-append after the last populated row. If you need to add rows, use append_range (bottom) or insert_range (specific index).

Parameters (4 required)
Required
rangestring

Target cell range only (A1 or R1C1), e.g. A1:B10. Do not include the sheet name here. Use write_range only when you know the exact destination cells already exist and you intend to write/overwrite those cells. write_range does not grow sheet dimensions, so guessed next-row writes (like A3:D3) can fail with grid limit errors. For adding a new row at the bottom of existing data, use append_range instead.

sheet_namestring

Sheet tab name only (no ! or coordinates). For A1 notation compatibility, quote names with spaces/punctuation (e.g. 'Q1 Plan'). If the name contains a single quote, escape it as two single quotes inside the quoted name (e.g. 'O''Reilly').

spreadsheet_urlstring

Google Sheets spreadsheet URL in the format https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/... or a raw spreadsheet ID.

valuesarray

2D row-major matrix of values to write. Matrix height/width must not exceed the specified range bounds (e.g. two rows and three columns requires a range that can hold 2x3 cells).