Google Sheets MCP

v1.2.1
io.github.A1-x-Tech/mcp-google-sheets Checked 1 hour ago Published 2 days ago

MCP server for the Google Sheets API: read and write ranges, sheets, formatting, charts, sharing.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

auth_status Google connection status

Shows whether this server is connected to Google: token presence and source (env variables or a stored in-chat login), expiry, the Google account email, granted vs missing OAuth scopes, where the credentials file lives and where the OAuth client comes from. Makes no network calls and never returns the token itself. Call it first when other tools report the server is not connected.

setup_instructions Setup instructions

This server ships with a built-in OAuth client, so connecting normally needs only start_login + finish_login; call this for the details or to switch to your own client. The checklist adapts to the client in use: with the built-in client it is just the two login calls, and it adds the steps for your OWN client — creating a Google Cloud project and a Desktop-app OAuth client, publishing the consent screen (mandatory — Testing-mode refresh tokens die after 7 days), downloading the client JSON and handing its PATH to set_client. Works without any credentials; with your own client already confi…

set_client Save the OAuth client

Saves the OAuth client credentials from the JSON file downloaded from Google Cloud Console ('Download JSON' on a Desktop-app client). Pass the file PATH — the secret must never be pasted into the chat. The client is stored once in the shared ~/.config/mcp-google-auth/client.json (owner-only) and reused by every mcp-google-* server; tokens stay per-server. After this, call start_login.

ParameterTypeDescription
path *stringAbsolute path to the client_secret_*.json file downloaded from Google Cloud Console.

start_login Start the Google login

First step of connecting from the chat, without editing config files or restarting the client. Returns authorizeUrl — show it to the user as a clickable link and ask them to open it in the browser ON THIS MACHINE, pick the Google account and approve access. A one-shot listener on 127.0.0.1 catches Google's redirect; the code is exchanged locally and never passes through the chat. Does not open the browser itself. The attempt lives 10 minutes; when the browser shows the success page, call finish_login.

finish_login Finish the Google login

Second step: waits up to 20 s for the browser consent to finish, saves the tokens to an owner-only file and verifies the login with a read-only identity call, returning the account email and the granted scopes. After success every tool works immediately — no client restart. If the user granted only part of the requested permissions, the login is still saved and missingScopes lists what will not work. Logging in under a different Google account replaces the previous login (its refresh token is revoked best-effort) and the response carries previousAccountEmail so the change never goes unnotice…

logout Disconnect from Google

Revokes the stored token at Google (oauth2.googleapis.com/revoke) and deletes the local credentials file. Tokens supplied via env variables are NOT touched — remove them from the MCP client config manually; envTokenStillSet in the response says whether any are still in effect.

create_spreadsheet Create a spreadsheet

Creates a new Google Sheets spreadsheet and returns it: spreadsheetId, spreadsheetUrl, properties (title, locale, timeZone) and sheets[] with each sheet's numeric sheetId. sheet_titles creates one tab per title in order (omitted = a single default "Sheet1"). The file lands in the authorized user's My Drive root — moving it into a folder needs the Drive API, which this server does not cover. Save the returned spreadsheetId: the Sheets API has no list endpoint of its own (search_spreadsheets exists, but it needs a Drive scope on the token).

ParameterTypeDescription
title *stringThe spreadsheet title (also the Drive file name).
localestringSpreadsheet locale as ISO code, e.g. "en_US" or "ru_RU" (affects number/date parsing).
sheet_titlesarrayTab titles to create, in order, e.g. ["Data","Summary"]. Omitted = one default sheet.
time_zonestringTime zone in CLDR format, e.g. "Europe/Moscow" (affects NOW()/TODAY()).

get_spreadsheet Get spreadsheet metadata

Returns the spreadsheet's structure: properties (title, locale, timeZone), sheets[] with properties (sheetId, title, index, gridProperties incl. rowCount/columnCount and frozenRowCount/frozenColumnCount), plus each sheet's protectedRanges, conditionalFormats, tables and charts, and the spreadsheet's namedRanges. Call this FIRST whenever a structural tool needs a sheetId, protectedRangeId, tableId, chartId or a conditional-format rule index — titles are not addresses. By default no cell data is returned; include_grid_data=true (optionally limited to ranges) embeds cells but is heavy — prefe…

ParameterTypeDescription
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
fieldsstringPartial-response field mask, e.g. "sheets.properties" or "namedRanges".
include_grid_databooleanEmbed cell data (values, formats) in the response. Heavy — prefer read_values.
rangesarrayLimit the returned sheets/grid data to these A1 ranges.

search_spreadsheets Search spreadsheets

Finds Google Sheets spreadsheets the authorized user can open (own files and shared drives; trashed files are excluded): id, name, createdTime, modifiedTime, owners and webViewLink per file, newest-modified first by default. name_contains filters by name substring; omit it to list everything. Paginate with page_token from nextPageToken. This is the one read that goes through the Drive API internally, so the OAuth token needs a Drive scope (drive, drive.readonly or drive.file for app-created files) — with only the spreadsheets scope it fails with 403 while every other tool still works.

ParameterTypeDescription
name_containsstringCase-insensitive name substring to filter by (omit to list all spreadsheets).
order_bystringDrive sort key, e.g. "modifiedTime desc" (default), "name", "createdTime desc", "viewedByMeTime desc".
page_sizeintegerMax files per page (1..1000; default 100).
page_tokenstringnextPageToken from the previous page.

read_values Read values

Reads one or more A1 ranges in a single call (one request against the quota, however many ranges) and returns valueRanges[] — each with its resolved range and a 2-D values array (outer = rows unless major_dimension=COLUMNS). Trailing empty rows/columns are omitted; a fully empty range has no values key at all. value_render_option: FORMATTED_VALUE (default, strings as displayed, honoring the cell's number format and locale), UNFORMATTED_VALUE (raw numbers/booleans), FORMULA (the formula text, e.g. "=SUM(A1:A10)" — the way to read formulas). With UNFORMATTED_VALUE, dates arrive as serial num…

ParameterTypeDescription
ranges *arrayOne or more A1 ranges to read in a single call.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
date_time_render_optionstringHow dates/times render with UNFORMATTED_VALUE (default SERIAL_NUMBER).
major_dimensionstringWhether the outer array is rows (default) or columns.
value_render_optionstringHow values are rendered (default FORMATTED_VALUE); FORMULA returns formula text.

write_values Write values to a range

Overwrites one A1 range with a 2-D values matrix (rows first) and returns updatedRange/updatedRows/updatedColumns/updatedCells. The matrix is anchored at the range's top-left corner; cells beyond the matrix keep their old content, and a null entry skips (does not clear) that cell — use clear_values to empty cells. value_input_option USER_ENTERED (default) parses input like typing in the UI: "=SUM(A1:A10)" becomes a live formula, "1,234" and "2026-01-15" become number/date per the spreadsheet locale; RAW stores everything as literal values. For several ranges use batch_write_values (one quota…

ParameterTypeDescription
range *stringA1-notation range, e.g. "Sheet1!A1:C10", "'My sheet'!B2:D" (quote titles with spaces) or a bare sheet title for the whole sheet.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
values *array2-D array of cell values, outer array = rows: [["Name","Score"],["Ada",42]]. null leaves the existing cell untouched.
include_values_in_responsebooleanReturn the written cells (as rendered) in the response.
value_input_optionstringUSER_ENTERED (default) parses formulas/numbers/dates; RAW stores literal strings.

batch_write_values Write values to many ranges

Overwrites several A1 ranges in ONE call — one write against the per-minute quota instead of one per range, so always prefer this over looping write_values. data is a list of {range, values} pairs; all are written with the same value_input_option (USER_ENTERED parses formulas/numbers/dates, RAW stores literally). Returns totalUpdatedCells and a per-range responses[] breakdown. Like write_values, null entries skip cells rather than clearing them.

ParameterTypeDescription
data *arrayThe ranges to write, each with its own 2-D values matrix.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
value_input_optionstringUSER_ENTERED (default) parses formulas/numbers/dates; RAW stores literal strings.

append_values Append rows

Appends rows after the last row of the data table that contains the given range — pass the table's region (e.g. "Sheet1!A1:D1" or just "Sheet1") and the API finds the first free row itself; the response's updates.updatedRange shows where the rows actually landed. insert_data_option INSERT_ROWS pushes existing data below down; OVERWRITE (default behaviour) writes into the free rows after the table. Never retried after an ambiguous failure — re-appending would duplicate the rows, so check the sheet first (read_values) before re-sending.

ParameterTypeDescription
range *stringA1 range identifying the table to append to (the API scans it for the last data row).
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
values *array2-D array of cell values, outer array = rows: [["Name","Score"],["Ada",42]]. null leaves the existing cell untouched.
insert_data_optionstringOVERWRITE writes after the table (default); INSERT_ROWS inserts new rows, shifting data below.
value_input_optionstringUSER_ENTERED (default) parses formulas/numbers/dates; RAW stores literal strings.

clear_values Clear values

Empties the VALUES of one or more A1 ranges in a single call — cell contents and formulas are gone (no undo through the API), while formatting, data validation, notes, conditional formats and merges all stay. To also remove formatting use format_cells or raw_request; to delete whole rows/columns (not just their content) use manage_dimensions action=delete.

ParameterTypeDescription
ranges *arrayThe A1 ranges to clear.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.

manage_sheets Manage sheets

Manages the sheets (tabs) of a spreadsheet. action=add creates a tab (title required; optional index position and row_count/column_count — default 1000×26). action=duplicate copies a tab within the same spreadsheet (sheet_id; optional title for the copy and index). action=rename changes a tab's title (sheet_id + title; the numeric sheetId never changes, so other tools keep working). action=delete removes the tab AND all its data — irreversible through the API, and deleting the last remaining sheet fails. action=copy_to copies a tab into ANOTHER spreadsheet (sheet_id + destination_spreadsh…

ParameterTypeDescription
action *stringWhat to do with the sheets.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
column_countintegeradd: grid columns for the new sheet (default 26).
destination_spreadsheet_idstringcopy_to: the spreadsheet to copy the sheet into.
indexintegeradd/duplicate: 0-based tab position for the new sheet (omit = after the existing tabs).
row_countintegeradd: grid rows for the new sheet (default 1000).
sheet_idintegerduplicate/rename/delete/copy_to: the target sheet.
titlestringadd: the new tab's title (required). rename: the new title (required). duplicate: the copy's title.

format_cells Format cells

Applies cell formatting to a range: background_color, text color/bold/italic/strikethrough/underline/font_size/font_family, horizontal/vertical alignment, wrap_strategy, and number format (number_format_type NUMBER/PERCENT/CURRENCY/DATE/TIME/DATE_TIME/SCIENTIFIC/TEXT with an optional number_format_pattern like "#,##0.00" or "dd.mm.yyyy"). Only the provided properties are touched — the update mask is computed automatically, so existing formatting outside it survives; at least one formatting field is required. The range is a grid rectangle addressed by sheet_id + 0-based indexes (get sheet_id…

ParameterTypeDescription
range *objectCell rectangle in grid coordinates: rows 1-10 × columns A-B = {start_row_index:0, end_row_index:10, start_column_index:0, end_column_index:2}.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
background_colorstringHex color "#RRGGBB", e.g. "#FF0000".
boldbooleanBold text.
font_familystringFont family, e.g. "Roboto".
font_sizeintegerFont size in points.
horizontal_alignmentstringHorizontal alignment.
italicbooleanItalic text.
number_format_patternstringFormat pattern, e.g. "#,##0.00", "0.0%", "dd.mm.yyyy" (requires number_format_type).
number_format_typestringNumber format category.
strikethroughbooleanStrikethrough text.
text_colorstringText color "#RRGGBB".
underlinebooleanUnderlined text.
vertical_alignmentstringVertical alignment.
wrap_strategystringHow long text behaves: overflow into empty neighbors, clip at the edge, or wrap.

set_frozen Freeze rows and columns

Freezes the first N rows and/or columns of a sheet so they stay visible while scrolling (typical: frozen_rows=1 pins the header). 0 unfreezes. At least one of frozen_rows / frozen_columns is required; the other stays as it is. You cannot freeze all rows or all columns of a sheet — at least one unfrozen row/column must remain.

ParameterTypeDescription
sheet_id *integerThe numeric sheetId (NOT the title) from get_spreadsheet sheets[].properties.sheetId; the first sheet of a new spreadsheet is 0.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
frozen_columnsintegerHow many left columns to freeze (0 = unfreeze).
frozen_rowsintegerHow many top rows to freeze (0 = unfreeze).

set_borders Set cell borders

Draws borders around and/or inside a grid range. top/bottom/left/right are the range's outer edges; inner_horizontal/inner_vertical are the grid lines between cells inside it. Each side takes {style, color?} — styles SOLID, SOLID_MEDIUM, SOLID_THICK, DOTTED, DASHED, DOUBLE, or NONE to remove that side's border. Only the provided sides change; at least one is required. Colors are "#RRGGBB" hex (default black).

ParameterTypeDescription
range *objectCell rectangle in grid coordinates: rows 1-10 × columns A-B = {start_row_index:0, end_row_index:10, start_column_index:0, end_column_index:2}.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
bottomobjectBorder line: {style, color?}.
inner_horizontalobjectHorizontal lines between rows inside the range.
inner_verticalobjectVertical lines between columns inside the range.
leftobjectBorder line: {style, color?}.
rightobjectBorder line: {style, color?}.
topobjectBorder line: {style, color?}.

manage_dimensions Manage rows and columns

Row/column operations on a run of rows (dimension=ROWS) or columns (dimension=COLUMNS), addressed by sheet_id + 0-based start_index (inclusive) and end_index (exclusive) — e.g. columns A-C = start 0, end 3. action=resize sets an exact pixel_size; auto_resize fits to content; insert adds empty rows/columns at start_index (inherit_from_before=true copies formatting from the row/column before instead of after); delete removes them WITH their data (irreversible; cell references below/right shift); hide/show toggle visibility without touching data; group/ungroup add or remove a collapsible outlin…

ParameterTypeDescription
action *stringWhat to do with the rows/columns.
dimension *stringWhether the run is rows or columns.
end_index *integerEnd of the run, exclusive (rows 1-3 = start 0, end 3).
sheet_id *integerThe numeric sheetId (NOT the title) from get_spreadsheet sheets[].properties.sheetId; the first sheet of a new spreadsheet is 0.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
start_index *integerFirst row/column of the run, 0-based inclusive.
inherit_from_beforebooleaninsert: new rows/columns copy formatting from before the insertion point (default: after).
pixel_sizeintegerresize: the new size in pixels.

set_data_validation Set data validation

Sets — or clears — a data-validation rule on a grid range. With condition_type set, every cell in the range gets the rule: ONE_OF_LIST with condition_values plus show_custom_ui=true is the classic in-cell dropdown; ONE_OF_RANGE takes a "=Sheet1!A1:A10" formula; NUMBER_/TEXT_/DATE_ conditions restrict input; CUSTOM_FORMULA takes a formula evaluated per cell. strict=true rejects invalid input outright, strict=false only shows a warning; input_message is the help text shown on the cell. OMIT condition_type (and the other rule fields) to REMOVE validation from the range. Overwrites any previou…

ParameterTypeDescription
range *objectCell rectangle in grid coordinates: rows 1-10 × columns A-B = {start_row_index:0, end_row_index:10, start_column_index:0, end_column_index:2}.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
condition_typestringSheets API condition type, e.g. ONE_OF_LIST, ONE_OF_RANGE, NUMBER_GREATER, NUMBER_LESS, NUMBER_BETWEEN, NUMBER_EQ, TEXT_CONTAINS, TEXT_STARTS_WITH, TEXT_EQ, TEXT_IS_EMAIL, DATE_AFTER, DATE_BEFORE, DAT…
condition_valuesarrayCondition arguments: list items for ONE_OF_LIST (["Yes","No"]), one number for NUMBER_GREATER (["100"]), two for NUMBER_BETWEEN, "=A1>B1"-style formula for CUSTOM_FORMULA and ONE_OF_RANGE ("=Sheet1!A1…
input_messagestringHelp text shown when the cell is selected.
show_custom_uibooleanShow a dropdown UI for ONE_OF_LIST / ONE_OF_RANGE conditions.
strictbooleantrue rejects invalid input; false (default) shows a warning.

manage_protected_ranges Manage protected ranges

Manages protections that stop other editors from changing cells. action=add protects a grid range (or a named range via named_range_id; a range with only sheet_id protects the whole sheet): warning_only=true merely warns before edits, otherwise only the listed editor_users/editor_groups (emails) plus the owner may edit — note the calling user is NOT added automatically. Returns the new protectedRangeId in the replies. action=update changes description/warning_only/editors of an existing protection (protected_range_id required; provided fields replace the old values). action=delete removes th…

ParameterTypeDescription
action *stringWhat to do with the protections.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
descriptionstringLabel shown in the Sheets UI protections list.
editor_groupsarrayEmails of Google Groups allowed to edit.
editor_usersarrayEmails of users allowed to edit the protected cells.
named_range_idstringadd: protect a named range instead of a grid range.
protected_range_idintegerupdate/delete: the protection's id from get_spreadsheet or the add reply.
rangeobjectadd: the cells to protect.
warning_onlybooleantrue = anyone can still edit after a warning; false = only the listed editors.

manage_conditional_formats Manage conditional formatting

Manages conditional-format rules that style cells when a condition holds (boolean rules; gradient color scales need raw_request). Rules are addressed by SHEET + INDEX in that sheet's rule list — get current rules and indexes from get_spreadsheet (sheets[].conditionalFormats), and re-read after every mutation because add/delete shift later indexes. action=add inserts a rule at index (default 0 = highest priority; rules are evaluated in order and the first match wins): needs ranges, condition_type (+condition_values; CUSTOM_FORMULA with a "=..." formula is the most flexible) and at least one f…

ParameterTypeDescription
action *stringWhat to do with the rules.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
background_colorstringFill for matching cells, "#RRGGBB".
boldbooleanBold text for matching cells.
condition_typestringSheets API condition type, e.g. ONE_OF_LIST, ONE_OF_RANGE, NUMBER_GREATER, NUMBER_LESS, NUMBER_BETWEEN, NUMBER_EQ, TEXT_CONTAINS, TEXT_STARTS_WITH, TEXT_EQ, TEXT_IS_EMAIL, DATE_AFTER, DATE_BEFORE, DAT…
condition_valuesarrayCondition arguments: list items for ONE_OF_LIST (["Yes","No"]), one number for NUMBER_GREATER (["100"]), two for NUMBER_BETWEEN, "=A1>B1"-style formula for CUSTOM_FORMULA and ONE_OF_RANGE ("=Sheet1!A1…
indexintegerRule position in the sheet's list. add: insert position (default 0); update/delete: required.
italicbooleanItalic text for matching cells.
rangesarrayadd/update: the cells the rule applies to.
sheet_idintegerupdate/delete: the sheet whose rule list is addressed.
text_colorstringText color for matching cells, "#RRGGBB".

manage_tables Manage tables

Manages structured tables (the "Convert to table" feature: named ranges with per-column types, filters and formatting). action=add creates a table over a grid range whose FIRST ROW becomes the header: name (must be unique in the spreadsheet) + range required; column_properties optionally types the columns — a list of raw TableColumnProperties objects, e.g. [{"columnIndex":0,"columnName":"Task","columnType":"TEXT"},{"columnIndex":1,"columnName":"Done","columnType":"BOOLEAN"}] (columnType TEXT/PERCENT/DROPDOWN/DOUBLE/CURRENCY/DATE/TIME/DATE_TIME/BOOLEAN; DROPDOWN adds dataValidationRule). The…

ParameterTypeDescription
action *stringWhat to do with the tables.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
column_propertiesarrayadd: raw TableColumnProperties list, e.g. [{"columnIndex":0,"columnName":"Task","columnType":"TEXT"}].
namestringadd (required) / update: the table's unique name.
rangeobjectadd (required) / update: the table's cells incl. the header row.
table_idstringupdate/delete: the tableId from get_spreadsheet or the add reply.

manage_charts Manage charts

Manages embedded charts. action=add builds a chart from chart_type (COLUMN/BAR/LINE/AREA/STEPPED_AREA/SCATTER/PIE), domain_range (x-axis labels / pie labels), series_ranges (one grid range per data series; PIE takes exactly one) and optional title/legend_position/header_count (rows of the ranges treated as headers, default 1) — place it with anchor {sheet_id,row_index,column_index} (the cell under the chart's top-left corner) or new_sheet=true for its own chart sheet; the reply carries the new chartId. Ranges should be single columns (or rows) including the header cell. For chart kinds beyon…

ParameterTypeDescription
action *stringWhat to do with the charts.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
anchorobjectadd: place the chart over the grid, top-left at this cell.
chart_idintegerupdate/delete: the chartId from get_spreadsheet or the add reply.
chart_typestringadd/update: the chart kind (required unless spec is given).
domain_rangeobjectThe x-axis (or pie label) values, incl. header cell.
header_countintegerHow many leading rows of the ranges are headers (default 1).
legend_positionstringBOTTOM_LEGEND, LEFT_LEGEND, RIGHT_LEGEND, TOP_LEGEND or NO_LEGEND (default: API's choice).
new_sheetbooleanadd: put the chart on its own new chart sheet instead.
series_rangesarrayOne range per data series, incl. header cells (PIE: exactly one).
specobjectRaw Sheets API ChartSpec — full control; overrides the simplified fields above.
titlestringChart title.

manage_permissions Manage spreadsheet access

Shares the spreadsheet (Drive permissions on the file — the OAuth token needs a Drive scope; the spreadsheets scope alone gets 403 here while every Sheets tool still works). action=list shows who has access: id, type, role, emailAddress/domain per permission; one page per call (shared-drive files cap a page at 100) — when the reply carries nextPageToken, pass it back as page_token for the rest. action=grant gives role reader/commenter/writer to type user/group (email_address required), domain (domain required, e.g. "example.com") or anyone (makes the link public — use deliberately); send…

ParameterTypeDescription
action *stringWhat to do with the file's permissions.
spreadsheet_id *stringThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
allow_file_discoverybooleangrant (domain/anyone): let the file appear in search results (default false).
domainstringgrant (domain): the domain, e.g. "example.com".
email_addressstringgrant (user/group): the grantee's email.
email_messagestringgrant: custom text for the notification email.
page_sizeintegerlist: max permissions per page (1..100; shared-drive files default to 100).
page_tokenstringlist: nextPageToken from the previous page.
permission_idstringupdate/revoke: the permission's id from action=list (or the grant reply).
rolestringgrant/update: the access level to give.
send_notification_emailbooleangrant: send the standard sharing notification (default true for users/groups).
typestringgrant: who the grantee is.

raw_request Raw Google Sheets API call

Escape hatch to call any Google Sheets API v4 path directly, for requests the typed tools don't cover — e.g. a batchUpdate with mergeCells, named ranges, banding, basic filters, slicers, sortRange, findReplace, gradient conditional-format rules, developer metadata, or several requests in one atomic call: path "v4/spreadsheets/<spreadsheetId>:batchUpdate", method POST, body {"requests":[...]}. The path may carry a query string. The Bearer token is added automatically; the method defaults to GET (values updates use PUT). Sheets API paths only — Drive paths are not reachable here.

ParameterTypeDescription
path *stringAPI path relative to https://sheets.googleapis.com, e.g. "v4/spreadsheets/<id>:batchUpdate".
bodyobjectJSON request body (POST/PUT only).
methodstringHTTP method (the Sheets API uses only these three). Defaults to GET.