Automate Google Sheets operations (read, write, format, filter, manage spreadsheets) via Rube MCP (Composio). Read/write data, manage tabs, apply formatting, and search rows programmatically.
Add this skill
npx mdskills install sickn33/googlesheets-automationComprehensive Google Sheets automation with detailed workflows, pitfalls, and parameter guidance
1---2name: googlesheets-automation3description: "Automate Google Sheets operations (read, write, format, filter, manage spreadsheets) via Rube MCP (Composio). Read/write data, manage tabs, apply formatting, and search rows programmatically."4requires:5 mcp: [rube]6---78# Google Sheets Automation via Rube MCP910Automate Google Sheets workflows including reading/writing data, managing spreadsheets and tabs, formatting cells, filtering rows, and upserting records through Composio's Google Sheets toolkit.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active Google Sheets connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `googlesheets`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `googlesheets`253. If connection is not ACTIVE, follow the returned auth link to complete Google OAuth264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. Read and Write Data3132**When to use**: User wants to read data from or write data to a Google Sheet3334**Tool sequence**:351. `GOOGLESHEETS_SEARCH_SPREADSHEETS` - Find spreadsheet by name if ID unknown [Prerequisite]362. `GOOGLESHEETS_GET_SHEET_NAMES` - Enumerate tab names to target the right sheet [Prerequisite]373. `GOOGLESHEETS_BATCH_GET` - Read data from one or more ranges [Required]384. `GOOGLESHEETS_BATCH_UPDATE` - Write data to a range or append rows [Required]395. `GOOGLESHEETS_VALUES_UPDATE` - Update a single specific range [Alternative]406. `GOOGLESHEETS_SPREADSHEETS_VALUES_APPEND` - Append rows to end of table [Alternative]4142**Key parameters**:43- `spreadsheet_id`: Alphanumeric ID from the spreadsheet URL (between '/d/' and '/edit')44- `ranges`: A1 notation array (e.g., 'Sheet1!A1:Z1000'); always use bounded ranges45- `sheet_name`: Tab name (case-insensitive matching supported)46- `values`: 2D array where each inner array is a row47- `first_cell_location`: Starting cell in A1 notation (omit to append)48- `valueInputOption`: 'USER_ENTERED' (parsed) or 'RAW' (literal)4950**Pitfalls**:51- Mis-cased or non-existent tab names error "Sheet 'X' not found"52- Empty ranges may omit `valueRanges[i].values`; treat missing as empty array53- `GOOGLESHEETS_BATCH_UPDATE` values must be a 2D array (list of lists), even for a single row54- Unbounded ranges like 'A:Z' on sheets with >10,000 rows may cause timeouts; always bound with row limits55- Append follows the detected `tableRange`; use returned `updatedRange` to verify placement5657### 2. Create and Manage Spreadsheets5859**When to use**: User wants to create a new spreadsheet or manage tabs within one6061**Tool sequence**:621. `GOOGLESHEETS_CREATE_GOOGLE_SHEET1` - Create a new spreadsheet [Required]632. `GOOGLESHEETS_ADD_SHEET` - Add a new tab/worksheet [Required]643. `GOOGLESHEETS_UPDATE_SHEET_PROPERTIES` - Rename, hide, reorder, or color tabs [Optional]654. `GOOGLESHEETS_GET_SPREADSHEET_INFO` - Get full spreadsheet metadata [Optional]665. `GOOGLESHEETS_FIND_WORKSHEET_BY_TITLE` - Check if a specific tab exists [Optional]6768**Key parameters**:69- `title`: Spreadsheet or sheet tab name70- `spreadsheetId`: Target spreadsheet ID71- `forceUnique`: Auto-append suffix if tab name exists (default true)72- `properties.gridProperties`: Set row/column counts, frozen rows7374**Pitfalls**:75- Sheet names must be unique within a spreadsheet76- Default sheet names are locale-dependent ('Sheet1' in English, 'Hoja 1' in Spanish)77- Don't use `index` when creating multiple sheets in parallel (causes 'index too high' errors)78- `GOOGLESHEETS_GET_SPREADSHEET_INFO` can return 403 if account lacks access7980### 3. Search and Filter Rows8182**When to use**: User wants to find specific rows or apply filters to sheet data8384**Tool sequence**:851. `GOOGLESHEETS_LOOKUP_SPREADSHEET_ROW` - Find first row matching exact cell value [Required]862. `GOOGLESHEETS_SET_BASIC_FILTER` - Apply filter/sort to a range [Alternative]873. `GOOGLESHEETS_CLEAR_BASIC_FILTER` - Remove existing filter [Optional]884. `GOOGLESHEETS_BATCH_GET` - Read filtered results [Optional]8990**Key parameters**:91- `query`: Exact text value to match (matches entire cell content)92- `range`: A1 notation range to search within93- `case_sensitive`: Boolean for case-sensitive matching (default false)94- `filter.range`: Grid range with sheet_id for basic filter95- `filter.criteria`: Column-based filter conditions96- `filter.sortSpecs`: Sort specifications9798**Pitfalls**:99- `GOOGLESHEETS_LOOKUP_SPREADSHEET_ROW` matches entire cell content, not substrings100- Sheet names with spaces must be single-quoted in ranges (e.g., "'My Sheet'!A:Z")101- Bare sheet names without ranges are not supported for lookup; always specify a range102103### 4. Upsert Rows by Key104105**When to use**: User wants to update existing rows or insert new ones based on a unique key column106107**Tool sequence**:1081. `GOOGLESHEETS_UPSERT_ROWS` - Update matching rows or append new ones [Required]109110**Key parameters**:111- `spreadsheetId`: Target spreadsheet ID112- `sheetName`: Tab name113- `keyColumn`: Column header name used as unique identifier (e.g., 'Email', 'SKU')114- `headers`: List of column names for the data115- `rows`: 2D array of data rows116- `strictMode`: Error on mismatched column counts (default true)117118**Pitfalls**:119- `keyColumn` must be an actual header name, NOT a column letter (e.g., 'Email' not 'A')120- If `headers` is NOT provided, first row of `rows` is treated as headers121- With `strictMode=true`, rows with more values than headers cause an error122- Auto-adds missing columns to the sheet123124### 5. Format Cells125126**When to use**: User wants to apply formatting (bold, colors, font size) to cells127128**Tool sequence**:1291. `GOOGLESHEETS_GET_SPREADSHEET_INFO` - Get numeric sheetId for target tab [Prerequisite]1302. `GOOGLESHEETS_FORMAT_CELL` - Apply formatting to a range [Required]1313. `GOOGLESHEETS_UPDATE_SHEET_PROPERTIES` - Change frozen rows, column widths [Optional]132133**Key parameters**:134- `spreadsheet_id`: Spreadsheet ID135- `worksheet_id`: Numeric sheetId (NOT tab name); get from GET_SPREADSHEET_INFO136- `range`: A1 notation (e.g., 'A1:F1') - preferred over index fields137- `bold`, `italic`, `underline`, `strikethrough`: Boolean formatting options138- `red`, `green`, `blue`: Background color as 0.0-1.0 floats (NOT 0-255 ints)139- `fontSize`: Font size in points140141**Pitfalls**:142- Requires numeric `worksheet_id`, not tab title; get from spreadsheet metadata143- Color channels are 0-1 floats (e.g., 1.0 for full red), NOT 0-255 integers144- Responses may return empty reply objects ([{}]); verify formatting via readback145- Format one range per call; batch formatting requires separate calls146147## Common Patterns148149### ID Resolution150- **Spreadsheet name -> ID**: `GOOGLESHEETS_SEARCH_SPREADSHEETS` with `query`151- **Tab name -> sheetId**: `GOOGLESHEETS_GET_SPREADSHEET_INFO`, extract from sheets metadata152- **Tab existence check**: `GOOGLESHEETS_FIND_WORKSHEET_BY_TITLE`153154### Rate Limits155Google Sheets enforces strict rate limits:156- Max 60 reads/minute and 60 writes/minute157- Exceeding limits causes errors; batch operations where possible158- Use `GOOGLESHEETS_BATCH_GET` and `GOOGLESHEETS_BATCH_UPDATE` for efficiency159160### Data Patterns161- Always read before writing to understand existing layout162- Use `GOOGLESHEETS_UPSERT_ROWS` for CRM syncs, inventory updates, and dedup scenarios163- Append mode (omit `first_cell_location`) is safest for adding new records164- Use `GOOGLESHEETS_CLEAR_VALUES` to clear content while preserving formatting165166## Known Pitfalls167168- **Tab names**: Locale-dependent defaults; 'Sheet1' may not exist in non-English accounts169- **Range notation**: Sheet names with spaces need single quotes in A1 notation170- **Unbounded ranges**: Can timeout on large sheets; always specify row bounds (e.g., 'A1:Z10000')171- **2D arrays**: All value parameters must be list-of-lists, even for single rows172- **Color values**: Floats 0.0-1.0, not integers 0-255173- **Formatting IDs**: `FORMAT_CELL` needs numeric sheetId, not tab title174- **Rate limits**: 60 reads/min and 60 writes/min; batch to stay within limits175- **Delete dimension**: `GOOGLESHEETS_DELETE_DIMENSION` is irreversible; double-check bounds176177## Quick Reference178179| Task | Tool Slug | Key Params |180|------|-----------|------------|181| Search spreadsheets | `GOOGLESHEETS_SEARCH_SPREADSHEETS` | `query`, `search_type` |182| Create spreadsheet | `GOOGLESHEETS_CREATE_GOOGLE_SHEET1` | `title` |183| List tabs | `GOOGLESHEETS_GET_SHEET_NAMES` | `spreadsheet_id` |184| Add tab | `GOOGLESHEETS_ADD_SHEET` | `spreadsheetId`, `title` |185| Read data | `GOOGLESHEETS_BATCH_GET` | `spreadsheet_id`, `ranges` |186| Read single range | `GOOGLESHEETS_VALUES_GET` | `spreadsheet_id`, `range` |187| Write data | `GOOGLESHEETS_BATCH_UPDATE` | `spreadsheet_id`, `sheet_name`, `values` |188| Update range | `GOOGLESHEETS_VALUES_UPDATE` | `spreadsheet_id`, `range`, `values` |189| Append rows | `GOOGLESHEETS_SPREADSHEETS_VALUES_APPEND` | `spreadsheetId`, `range`, `values` |190| Upsert rows | `GOOGLESHEETS_UPSERT_ROWS` | `spreadsheetId`, `sheetName`, `keyColumn`, `rows` |191| Lookup row | `GOOGLESHEETS_LOOKUP_SPREADSHEET_ROW` | `spreadsheet_id`, `query` |192| Format cells | `GOOGLESHEETS_FORMAT_CELL` | `spreadsheet_id`, `worksheet_id`, `range` |193| Set filter | `GOOGLESHEETS_SET_BASIC_FILTER` | `spreadsheetId`, `filter` |194| Clear values | `GOOGLESHEETS_CLEAR_VALUES` | `spreadsheet_id`, range |195| Delete rows/cols | `GOOGLESHEETS_DELETE_DIMENSION` | `spreadsheet_id`, `sheet_name`, dimension |196| Spreadsheet info | `GOOGLESHEETS_GET_SPREADSHEET_INFO` | `spreadsheet_id` |197| Update tab props | `GOOGLESHEETS_UPDATE_SHEET_PROPERTIES` | `spreadsheetId`, properties |198
Full transparency — inspect the skill content before installing.