mcp-gsheets 1.5.4 β 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -25
- package/dist/index.js +16686 -9576
- package/package.json +16 -15
package/README.md
CHANGED
|
@@ -313,40 +313,68 @@ npm run dev # Watch mode with auto-reload
|
|
|
313
313
|
## π Available Tools
|
|
314
314
|
|
|
315
315
|
### Reading Data
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
|
|
317
|
+
| Tool | Description | Key Parameters |
|
|
318
|
+
|------|-------------|----------------|
|
|
319
|
+
| `sheets_get_values` | Read cell values from a single range | `spreadsheetId`, `range` (A1 notation), `valueRenderOption` |
|
|
320
|
+
| `sheets_batch_get_values` | Read cell values from multiple ranges in one request | `spreadsheetId`, `ranges` (array of A1 ranges) |
|
|
321
|
+
| `sheets_get_metadata` | Get spreadsheet metadata: title, locale, sheets list with IDs, row/column counts | `spreadsheetId` |
|
|
322
|
+
| `sheets_check_access` | Verify that the service account can access a spreadsheet | `spreadsheetId` |
|
|
320
323
|
|
|
321
324
|
### Writing Data
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
|
|
326
|
+
| Tool | Description | Key Parameters |
|
|
327
|
+
|------|-------------|----------------|
|
|
328
|
+
| `sheets_update_values` | Write values to a single range (overwrites existing content) | `spreadsheetId`, `range`, `values` (2D array), `valueInputOption` |
|
|
329
|
+
| `sheets_batch_update_values` | Write values to multiple ranges in one request | `spreadsheetId`, `data` (array of `{range, values}`), `valueInputOption` |
|
|
330
|
+
| `sheets_append_values` | Append rows after the last row of an existing table. **Default `insertDataOption` is `OVERWRITE`** β set `INSERT_ROWS` to push existing rows down | `spreadsheetId`, `range`, `values`, `valueInputOption`, `insertDataOption` |
|
|
331
|
+
| `sheets_clear_values` | Clear all values in a range (preserves formatting) | `spreadsheetId`, `range` |
|
|
332
|
+
| `sheets_insert_rows` | Insert blank or pre-filled rows at a specific position | `spreadsheetId`, `range` (anchor), `rows`, `position` (BEFORE/AFTER), `values` |
|
|
333
|
+
| `sheets_insert_link` | Insert a hyperlink formula into a cell | `spreadsheetId`, `range`, `url`, `label` |
|
|
334
|
+
| `sheets_insert_date` | Insert a date/datetime value formatted correctly into a cell | `spreadsheetId`, `range`, `date`, `format` |
|
|
327
335
|
|
|
328
336
|
### Sheet Management
|
|
329
|
-
- `sheets_insert_sheet` - Add new sheet
|
|
330
|
-
- `sheets_delete_sheet` - Remove sheet
|
|
331
|
-
- `sheets_duplicate_sheet` - Copy sheet
|
|
332
|
-
- `sheets_copy_to` - Copy to another spreadsheet
|
|
333
|
-
- `sheets_update_sheet_properties` - Update sheet settings
|
|
334
337
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
+
| Tool | Description | Key Parameters |
|
|
339
|
+
|------|-------------|----------------|
|
|
340
|
+
| `sheets_create_spreadsheet` | Create a new Google Sheets file | `title`, `sheets` (optional initial sheet configs) |
|
|
341
|
+
| `sheets_insert_sheet` | Add a new sheet tab to an existing spreadsheet | `spreadsheetId`, `title`, `index` |
|
|
342
|
+
| `sheets_delete_sheet` | Remove a sheet tab by its numeric sheet ID | `spreadsheetId`, `sheetId` |
|
|
343
|
+
| `sheets_duplicate_sheet` | Copy a sheet within the same spreadsheet | `spreadsheetId`, `sheetId`, `newSheetName`, `insertSheetIndex` |
|
|
344
|
+
| `sheets_copy_to` | Copy a sheet to a different spreadsheet | `spreadsheetId`, `sheetId`, `destinationSpreadsheetId` |
|
|
345
|
+
| `sheets_update_sheet_properties` | Rename a sheet, change tab colour, toggle grid lines, etc. | `spreadsheetId`, `sheetId`, `properties` |
|
|
346
|
+
| `sheets_batch_delete_sheets` | Delete multiple sheet tabs in one request | `spreadsheetId`, `sheetIds` (array) |
|
|
338
347
|
|
|
339
348
|
### Cell Formatting
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
349
|
+
|
|
350
|
+
| Tool | Description | Key Parameters |
|
|
351
|
+
|------|-------------|----------------|
|
|
352
|
+
| `sheets_format_cells` | Apply background colour, font style, alignment and number format to a range | `spreadsheetId`, `range`, `format` |
|
|
353
|
+
| `sheets_batch_format_cells` | Apply different formats to multiple ranges in one request | `spreadsheetId`, `requests` (array of `{range, format}`) |
|
|
354
|
+
| `sheets_update_borders` | Set or remove borders on a range (style, width, colour per side) | `spreadsheetId`, `range`, `borders` |
|
|
355
|
+
| `sheets_merge_cells` | Merge a range of cells | `spreadsheetId`, `range`, `mergeType` (MERGE_ALL / MERGE_COLUMNS / MERGE_ROWS) |
|
|
356
|
+
| `sheets_unmerge_cells` | Unmerge previously merged cells in a range | `spreadsheetId`, `range` |
|
|
357
|
+
| `sheets_add_conditional_formatting` | Add a conditional formatting rule (gradient or boolean) to a range | `spreadsheetId`, `range`, `rule` |
|
|
345
358
|
|
|
346
359
|
### Charts
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
360
|
+
|
|
361
|
+
| Tool | Description | Key Parameters |
|
|
362
|
+
|------|-------------|----------------|
|
|
363
|
+
| `sheets_create_chart` | Create a bar, line, pie, column or other chart on a sheet | `spreadsheetId`, `sheetId`, `chartSpec`, `position` |
|
|
364
|
+
| `sheets_update_chart` | Modify an existing chart's spec or position | `spreadsheetId`, `chartId`, `chartSpec`, `position` |
|
|
365
|
+
| `sheets_delete_chart` | Remove a chart from a spreadsheet | `spreadsheetId`, `chartId` |
|
|
366
|
+
|
|
367
|
+
### Read / Snapshot Tools
|
|
368
|
+
|
|
369
|
+
| Tool | Description | Key Parameters |
|
|
370
|
+
|------|-------------|----------------|
|
|
371
|
+
| `sheets_get_merged_cells` | Return all merged cell ranges for a sheet, with A1 notation and raw GridRange coordinates | `spreadsheetId`, `sheetName` |
|
|
372
|
+
| `sheets_get_sheet_dimensions` | Return column widths, row heights, frozen column/row counts, and hidden flags for every column and row | `spreadsheetId`, `sheetName` |
|
|
373
|
+
| `sheets_get_sheet_formatting` | Read raw cell formatting (background colour, font, borders, alignment, number format) for a range without returning cell values | `spreadsheetId`, `range` |
|
|
374
|
+
| `sheets_get_conditional_formatting` | Read all conditional formatting rules and banded (alternating-colour) ranges defined on a sheet | `spreadsheetId`, `sheetName` |
|
|
375
|
+
| `sheets_get_sheet_structure` | Lightweight structural metadata only β no per-cell data. Returns dimensions, frozen rows/cols, tab colour, column widths, row heights, hidden columns/rows, and all merges in A1 notation. Single fast API call | `spreadsheetId`, `sheetName` |
|
|
376
|
+
| `sheets_get_formatting_compact` | Read cell formatting for a range and return it as compact A1Rangeβformat pairs (run-length encoded). Identical adjacent cells are collapsed into rectangular ranges β reduces output by 90 %+ compared to per-cell data | `spreadsheetId`, `sheetName`, `range`, `useEffectiveFormat`, `fields` |
|
|
377
|
+
| `sheets_get_full_sheet_snapshot` | Master one-shot tool β returns all structural and formatting metadata (merges, dimensions, conditional formatting, and optionally cell formatting) in a single API call. Supports `fields` filter and `compactMode` to limit response size | `spreadsheetId`, `sheetName`, `includeFormattingRange`, `fields`, `compactMode` |
|
|
350
378
|
|
|
351
379
|
## π§ Code Quality
|
|
352
380
|
|
|
@@ -426,6 +454,51 @@ Use `sheets_get_metadata` to list all sheets with their IDs.
|
|
|
426
454
|
|
|
427
455
|
## π Tool Details
|
|
428
456
|
|
|
457
|
+
### sheets_get_sheet_structure
|
|
458
|
+
|
|
459
|
+
Returns lightweight structural/dimensional metadata for a sheet without any per-cell data. Much faster and cheaper than `sheets_get_full_sheet_snapshot` when you only need layout information.
|
|
460
|
+
|
|
461
|
+
**Parameters:**
|
|
462
|
+
- `spreadsheetId` (required): The ID of the spreadsheet
|
|
463
|
+
- `sheetName` (required): Name of the sheet (tab)
|
|
464
|
+
|
|
465
|
+
**Returns:** `sheetName`, `sheetId`, `sheetIndex`, `tabColor`, `tabColorStyle`, `dimensions` (`rowCount`, `columnCount`), `frozen` (`rowCount`, `columnCount`), `columnWidths` (array of pixel sizes), `rowHeights` (array of pixel sizes), `hiddenColumns` (0-based indices), `hiddenRows` (0-based indices), `mergeCount`, `merges` (A1 notation array)
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
### sheets_get_formatting_compact
|
|
470
|
+
|
|
471
|
+
Read cell formatting for a range and return it as compact A1Range β format pairs. Adjacent cells with identical formatting are collapsed into rectangular ranges (run-length encoded), reducing output by 90 %+ compared to per-cell data.
|
|
472
|
+
|
|
473
|
+
**Parameters:**
|
|
474
|
+
- `spreadsheetId` (required): The ID of the spreadsheet
|
|
475
|
+
- `sheetName` (required): Name of the sheet (tab)
|
|
476
|
+
- `range` (required): Range without sheet prefix, e.g. `"A1:Z85"`
|
|
477
|
+
- `useEffectiveFormat` (optional): `false` (default) = userEnteredFormat (only explicit overrides, smaller output); `true` = effectiveFormat (all inherited defaults)
|
|
478
|
+
- `fields` (optional): Array of format field names to include, e.g. `["backgroundColor", "textFormat", "borders"]`
|
|
479
|
+
|
|
480
|
+
**Returns:** `{ range, formatType, rangeCount, data: { "A1:C3": { backgroundColor: {...} }, ... } }`
|
|
481
|
+
|
|
482
|
+
**Supported fields:** `backgroundColor`, `backgroundColorStyle`, `textFormat`, `horizontalAlignment`, `verticalAlignment`, `wrapStrategy`, `textRotation`, `numberFormat`, `padding`, `borders`
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
### sheets_get_full_sheet_snapshot
|
|
487
|
+
|
|
488
|
+
Master one-shot tool that returns all structural and formatting metadata in a single API call.
|
|
489
|
+
|
|
490
|
+
**Parameters:**
|
|
491
|
+
- `spreadsheetId` (required): The ID of the spreadsheet
|
|
492
|
+
- `sheetName` (required): Name of the sheet (tab)
|
|
493
|
+
- `includeFormattingRange` (optional): If provided (e.g. `"A1:Z100"`), per-cell formatting is included in the response
|
|
494
|
+
- `useEffectiveFormat` (optional): Use effectiveFormat instead of userEnteredFormat when including cell formatting (default: `false`)
|
|
495
|
+
- `fields` (optional): Array of format field names to return, e.g. `["backgroundColor", "textFormat"]` β reduces API transfer size and response size
|
|
496
|
+
- `compactMode` (optional): When `true`, identical adjacent cells are collapsed into rectangular ranges (RLE). Reduces a typical 85Γ28 sheet from ~60 000 lines to ~500 lines (default: `false`)
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
429
502
|
### sheets_insert_rows
|
|
430
503
|
|
|
431
504
|
Insert new rows at a specific position in a spreadsheet with optional data.
|