mcp-google-sheets-import-export

v1.0.4
com.mambabuilt/mcp-google-sheets-import-export Checked 18 hours ago Published 2 days ago

Read a Google Sheet into rows or write rows to a sheet: append, replace, or upsert by key

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

google_sheets_import_export Read or write a Google Sheet

Read a Google Sheet into rows, or write rows into a Google Sheet. Modes: read (one row per sheet row, keyed by the header row), append, replace (clear the tab, then write), and upsert (update rows whose key_column value already exists, add the rest). Writes need the buyer's own Google credential: a service account key JSON with the sheet shared to its client_email, or an OAuth refresh token with its client, or an OAuth access token. A sheet shared as anyone with the link reads with no credential. Pay per event on Apify: 0.01 USD per block of up to 100 rows written, 0.005 USD per block of up to…

ParameterTypeDescription
columnsarrayOptional, write modes. Only these keys are written, in this order. Default: every key in the rows, in first seen order.
dataset_idstringWrite modes. The Apify dataset whose items go into the sheet, for example the default dataset of another run. In an Apify integration, pass the triggering run's resource.defaultDatasetId variable. Fie…
header_rowbooleantrue (default) or false. When true, read rows are keyed by the header row, and writes match your row keys to the header columns and add new columns at the end. When false, read rows are keyed by colum…
key_columnstringUpsert mode. The column whose value identifies a row, for example email or url. A row whose value is already in that column is overwritten in place; the rest are added. Rows with no value in it are sk…
max_charge_usdstringOptional. The run stops before a charge that would pass this amount, and never writes a block of rows it could not charge. Summary rows are always returned.
max_rowsnumberMost rows to read or write in this run, 1 to 1,000,000 (default 100,000).
modestringread (default): the sheet becomes one dataset row per sheet row. append: add rows after the last row. replace: clear the tab, then write the rows. upsert: overwrite the rows whose key_column value is…
oauth_access_tokenstringInstead of the above: a current OAuth access token with the spreadsheets scope. It expires in about an hour, so it suits a single run.
oauth_client_idstringThe client ID that issued the refresh token.
oauth_client_secretstringThe client secret that issued the refresh token.
oauth_refresh_tokenstringInstead of a service account: a refresh token from your own Google OAuth client with the spreadsheets scope. Needs oauth_client_id and oauth_client_secret from the same client.
rangestringOptional, read mode. An A1 range without the tab name, for example A1:F500 or B:D. Default: the whole tab.
rowsarrayWrite modes, instead of a dataset. A JSON list of objects, one per sheet row, for example [{"name": "Ann", "email": "ann@example.com"}].
service_account_jsonstringYour own service account key file, pasted whole. Share the spreadsheet with its client_email as an Editor (Viewer to read). It is sent only to Google and is never stored, logged, or written to a row.
sheetstringOptional. The tab name, or its gid number. Default: the gid in the URL, else the first tab. In a write mode a tab name that does not exist is created.
spreadsheetstringThe Google Sheets URL as copied from the browser, or the spreadsheet ID. A #gid= in the URL picks that tab.
value_inputstringraw (default): every value is stored exactly as given, so text starting with = is not run as a formula. user_entered: Google parses values as if typed, so formulas run and dates and numbers are conver…