Google Sheets
Connect your agent to Google Sheets to read, write, and manage spreadsheet data. Perfect for data tracking, reporting, logging, and building data pipelines.
Setup
Use the same Google Cloud project. Enable the Google Sheets API and generate a refresh token with the https://www.googleapis.com/auth/spreadsheets scope.
Tools
| Tool | Description |
|---|---|
| gsheets_create | Create a new spreadsheet with optional sheet names and headers |
| gsheets_get_info | Get spreadsheet metadata — sheet names, row/column counts |
| gsheets_read | Read data from a range (A1 notation) |
| gsheets_write | Write/overwrite data in a specific range |
| gsheets_append | Append rows to the end of a sheet |
| gsheets_clear | Clear values from a range (keeps formatting) |
A1 Notation
Ranges use standard spreadsheet notation:
Sheet1!A1:D10 — Columns A-D, rows 1-10 Sheet1!A:C — All of columns A-C Sheet1 — Entire sheet A1:B5 — First sheet, A1 to B5
Reading Data
The gsheets_read tool returns data as a structured object with headers (first row) and rows. The agent can interpret column structure and answer questions about the data.
Writing Data
Use gsheets_write to overwrite a specific range, or gsheets_append to add rows at the bottom. Values are interpreted automatically — numbers, dates, and formulas are parsed.
Events
| Event | When |
|---|---|
| gsheets.spreadsheet_created | A new spreadsheet is created |
| gsheets.data_written | Data is written to a range |
| gsheets.rows_appended | Rows are appended to a sheet |
Example
User: "Create an expense tracker spreadsheet with columns Date, Description, Amount, Category, and add my lunch expense of $15 today"
Agent: Creates the spreadsheet with headers, then appends a row with today's date, "Lunch", 15, and "Food".
Integration Ideas
Use with Scheduled Actions for daily data collection (e.g., "every day, fetch API metrics and append to the tracking sheet"). Combine with Email to send spreadsheet summaries. Pair with Automations to log events automatically.
