KosmoKrator

productivity

Google Sheets MCP, CLI, and Lua Integration for AI Agents

Google Sheets integration docs for AI agents: MCP gateway setup, Google Sheets CLI commands, Lua API reference, credentials, and function schemas.

20 functions 13 read 7 write OAuth browser flow auth

Google Sheets for agents

OAuth can be configured in web hosts through redirect and in CLI hosts through local/device authorization; runtime works with stored tokens.

Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.

Machine-Readable Metadata
integration_slug
google_sheets
route_slug
google-sheets
package
google
auth_strategy
oauth2_authorization_code OAuth browser flow
cli_setup_supported
true
cli_runtime_supported
true
mcp_gateway_supported
true
lua_supported
true
supports_multi_account
false

Quick Links

Google Sheets MCP Client Matrix

Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for Google Sheets.

Google Sheets CLI Matrix

Use these pages for direct Google Sheets CLI workflows in scripts, CI, cron, and agent wrappers.

Function Catalog

FunctionTypeParametersDescription
google_sheets.google_sheets_add_filter Write write 2 Apply filter dropdowns to a range in a Google Sheets sheet/tab.
google_sheets.google_sheets_add_sheet Write write 2 Add a new sheet/tab to a Google Spreadsheet.
google_sheets.google_sheets_append Read read 4 Append rows after the last data row in a Google Spreadsheet. Auto-detects the table boundary. Provide the range (e.g., "Sheet1" or "Sheet1!A:D") and a 2D array of rows to append.
google_sheets.google_sheets_batch_read Read read 3 Read multiple ranges from a Google Spreadsheet in one call. Provide an array of A1 notation ranges (e.g., ["Sheet1!A1:B5", "Sheet2!C1:D10"]). Returns results keyed by range.
google_sheets.google_sheets_batch_write Read read 3 Write to multiple ranges in a Google Spreadsheet in one call. Provide an array of {range, values} objects to update several areas at once.
google_sheets.google_sheets_clear Read read 2 Clear all values from a Google Sheets range (keeps formatting intact). Specify the range in A1 notation.
google_sheets.google_sheets_create Read read 1 Create a new empty Google Spreadsheet with a given title. Returns the new spreadsheet ID and URL.
google_sheets.google_sheets_delete_columns Write write 4 Delete columns from a Google Sheets sheet/tab. Uses 0-based indexing.
google_sheets.google_sheets_delete_rows Write write 4 Delete rows from a Google Sheets sheet/tab. Uses 0-based indexing.
google_sheets.google_sheets_delete_sheet Write write 2 Delete a sheet/tab from a Google Spreadsheet.
google_sheets.google_sheets_duplicate_sheet Write write 3 Copy a sheet/tab within the same Google Spreadsheet.
google_sheets.google_sheets_find Read read 5 Search for text within a Google Spreadsheet. Searches all sheets by default, or specify a sheet name to narrow the search. Returns match count and number of sheets containing matches.
google_sheets.google_sheets_get_metadata Read read 1 Get spreadsheet title and list of sheets/tabs with their names, IDs, and dimensions. Use this first to discover sheet names and structure before reading or writing data.
google_sheets.google_sheets_insert_columns Read read 4 Insert blank columns into a Google Sheets sheet/tab. Uses 0-based indexing.
google_sheets.google_sheets_insert_rows Read read 4 Insert blank rows into a Google Sheets sheet/tab. Uses 0-based indexing.
google_sheets.google_sheets_read_range Read read 3 Read cell values from a Google Sheets range using A1 notation. A1 notation examples: `Sheet1!A1:D10` (range), `Sheet1!A:A` (whole column), `Sheet1` (entire sheet). Sheet names with spaces need quotes: `'My Sheet'!A1:B2`.
google_sheets.google_sheets_remove_filter Write write 2 Remove the filter from a Google Sheets sheet/tab.
google_sheets.google_sheets_rename_sheet Read read 3 Rename a sheet/tab in a Google Spreadsheet.
google_sheets.google_sheets_sort_range Read read 4 Sort data by column(s) in a Google Sheets range.
google_sheets.google_sheets_write_range Read read 4 Write values to a Google Sheets range. Values format: `[["Name", "Age"], ["Alice", 30]]` — each inner array is one row. Formulas work with user_entered input mode (default): `[["=SUM(A1:A10)"]]`.