Google Sheets
- MCP servers: use Google Sheets tools from ChatGPT, Claude and other MCP clients.
- Tasks: call Google Sheets from Python in an automation.
About Google Sheets
Read, create, and edit spreadsheets and cells with Google Sheets.
Build a Google Sheets MCP server with qbash
Connect Google Sheets to qbash, pick tools such as get spreadsheet, get values and batch get values, and publish them on a hosted MCP server.
MCP clients such as ChatGPT, Claude, Claude Code, Codex, Cursor, Grok and Muse Code all connect to the same remote endpoint.
Build Tasks with Google Sheets
A qbash Task is a Python script that calls Google Sheets alongside model calls and other connectors. qbash deploys each Task to a managed runtime with version history, run logs and credentials shared across your organization.
Run it on a schedule, call it through an API or webhook, or start it from an MCP client.
Google Sheets Task SDK methods (12)
Call these from Python with qbash.integrations.google_sheets.
qbash.integrations.google_sheets.get_spreadsheet(...)
Get a spreadsheet title, URL, and sheet tabs.
get_spreadsheet(spreadsheet_id: str)
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
Returns
{"status": "success", "spreadsheet_id": str, "spreadsheet_url": str, "title": str, "sheets": list[dict], "sheet_count": int}Notes
Pass a spreadsheet ID or full Google Sheets URL. To find existing spreadsheets, use the Google Drive connector or copy a URL from Sheets.
qbash.integrations.google_sheets.get_values(...)
Read cell values from one A1 range.
get_values(spreadsheet_id: str, range: str, major_dimension: str = "ROWS", value_render_option: str = "FORMATTED_VALUE", date_time_render_option: str = "SERIAL_NUMBER")
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
range: strrequiredA1 range such as Sheet1!A1:D20.
major_dimension: str = "ROWS"ROWS or COLUMNS.
value_render_option: str = "FORMATTED_VALUE"FORMATTED_VALUE, UNFORMATTED_VALUE, or FORMULA.
date_time_render_option: str = "SERIAL_NUMBER"SERIAL_NUMBER or FORMATTED_STRING; only applies to UNFORMATTED_VALUE.
Returns
{"status": "success", "spreadsheet_id": str, "range": str, "major_dimension": str, "values": list[list]}Notes
A1 range examples: Sheet1!A1:D20 or 'Sales 2026'!A1:D20. Missing or empty cells may be omitted by Google.
qbash.integrations.google_sheets.batch_get_values(...)
Read multiple A1 ranges in one request.
batch_get_values(spreadsheet_id: str, ranges: list[str], major_dimension: str = "ROWS", value_render_option: str = "FORMATTED_VALUE", date_time_render_option: str = "SERIAL_NUMBER")
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
ranges: list[str]requiredOne to 20 A1 ranges to read.
major_dimension: str = "ROWS"ROWS or COLUMNS.
value_render_option: str = "FORMATTED_VALUE"FORMATTED_VALUE, UNFORMATTED_VALUE, or FORMULA.
date_time_render_option: str = "SERIAL_NUMBER"SERIAL_NUMBER or FORMATTED_STRING; only applies to UNFORMATTED_VALUE.
Returns
{"status": "success", "spreadsheet_id": str, "value_ranges": list[dict], "range_count": int}Notes
Read up to 20 ranges from one spreadsheet.
qbash.integrations.google_sheets.create_spreadsheet(...)
Create a new Google spreadsheet.
create_spreadsheet(title: str)
Parameters
title: strrequiredTitle for the new spreadsheet.
Returns
{"status": "success", "spreadsheet_id": str, "spreadsheet_url": str, "title": str}Notes
Creates a spreadsheet in the connected Google account and returns its ID and URL.
qbash.integrations.google_sheets.update_values(...)
Write values to an A1 range, replacing cells in that range.
update_values(spreadsheet_id: str, range: str, values: list[list], major_dimension: str = "ROWS", value_input_option: str = "USER_ENTERED")
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
range: strrequiredA1 range such as Sheet1!A1:D20.
values: list[list]requiredTwo-dimensional array of cell values.
major_dimension: str = "ROWS"ROWS or COLUMNS.
value_input_option: str = "USER_ENTERED"USER_ENTERED or RAW.
Returns
{"status": "success", "spreadsheet_id": str, "updated_range": str, "updated_rows": int, "updated_columns": int, "updated_cells": int}Notes
Rows are a two-dimensional array. RAW stores strings literally; USER_ENTERED parses formulas, dates, and numbers as if typed into Sheets. Use clear_values to remove values.
qbash.integrations.google_sheets.append_values(...)
Append rows after a table in a sheet.
append_values(spreadsheet_id: str, range: str, values: list[list], major_dimension: str = "ROWS", value_input_option: str = "USER_ENTERED", insert_data_option: str = "INSERT_ROWS")
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
range: strrequiredA1 range such as Sheet1!A1:D20.
values: list[list]requiredTwo-dimensional array of cell values.
major_dimension: str = "ROWS"ROWS or COLUMNS.
value_input_option: str = "USER_ENTERED"USER_ENTERED or RAW.
insert_data_option: str = "INSERT_ROWS"INSERT_ROWS or OVERWRITE.
Returns
{"status": "success", "spreadsheet_id": str, "table_range": str | None, "updated_range": str, "updated_rows": int, "updated_cells": int}Notes
The range identifies the table to search for; Google appends after its last row. INSERT_ROWS inserts new rows. RAW stores strings literally; USER_ENTERED parses formulas, dates, and numbers.
qbash.integrations.google_sheets.clear_values(...)
Clear cell values in an A1 range.
clear_values(spreadsheet_id: str, range: str)
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
range: strrequiredA1 range such as Sheet1!A1:D20.
Returns
{"status": "success", "spreadsheet_id": str, "cleared_range": str}Notes
Clears values only; formatting and validation remain.
qbash.integrations.google_sheets.batch_update_values(...)
Write values to multiple ranges in one request.
batch_update_values(spreadsheet_id: str, data: list[dict], value_input_option: str = "USER_ENTERED")
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
data: list[dict]requiredOne to 20 range/value objects.
range: strrequiredA1 range to write.
values: list[list]requiredTwo-dimensional cell values.
major_dimension: str = "ROWS"ROWS or COLUMNS.
value_input_option: str = "USER_ENTERED"USER_ENTERED or RAW.
Returns
{"status": "success", "spreadsheet_id": str, "total_updated_rows": int, "total_updated_columns": int, "total_updated_cells": int, "total_updated_sheets": int, "responses": list[dict]}Notes
Each data item has range, values, and optional major_dimension (ROWS or COLUMNS). Up to 20 ranges are accepted.
qbash.integrations.google_sheets.add_sheet(...)
Add a tab to an existing spreadsheet.
add_sheet(spreadsheet_id: str, title: str)
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
title: strrequiredTitle for the new tab.
Returns
{"status": "success", "spreadsheet_id": str, "replies": list[dict]}Notes
Returns Google's addSheet reply, including the new tab's sheetId.
qbash.integrations.google_sheets.rename_sheet(...)
Rename a spreadsheet tab.
rename_sheet(spreadsheet_id: str, sheet_id: int, title: str)
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
sheet_id: intrequiredNumeric tab ID from get_spreadsheet.
title: strrequiredNew tab title.
Returns
{"status": "success", "spreadsheet_id": str, "replies": list[dict]}Notes
Get the numeric sheet_id from get_spreadsheet first.
qbash.integrations.google_sheets.delete_sheet(...)
Delete a spreadsheet tab.
delete_sheet(spreadsheet_id: str, sheet_id: int)
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
sheet_id: intrequiredNumeric tab ID from get_spreadsheet.
Returns
{"status": "success", "spreadsheet_id": str, "replies": list[dict]}Notes
Deletes the tab and its contents. Get the numeric sheet_id from get_spreadsheet first.
qbash.integrations.google_sheets.batch_update_spreadsheet(...)
Apply advanced spreadsheet changes such as formatting or protected ranges.
batch_update_spreadsheet(spreadsheet_id: str, requests: list[dict])
Parameters
spreadsheet_id: strrequiredSpreadsheet ID or full docs.google.com/spreadsheets/d/... URL.
requests: list[dict]requiredGoogle Sheets spreadsheets.batchUpdate request objects.
Returns
{"status": "success", "spreadsheet_id": str, "replies": list[dict]}Notes
Pass one to 20 Google Sheets API batchUpdate request objects. Google validates the whole batch and applies it atomically. Use this for formatting, filters, dimensions, and other sheet operations.
Related connectors
Connect Google Sheets to qbash
Sign up, connect your Google Sheets account, and use its tools across qbash.
Sign up free