# Google Sheets

## Links

- Product page URL: https://www.agentpmt.com/marketplace/google-sheets-api
- Product markdown URL: https://www.agentpmt.com/marketplace/google-sheets-api?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/google-sheets-api?format=agent-json

## Overview

- Product ID: 696302894cf4309309cac7b2
- Vendor: Apoth3osis
- Type: connector
- Unit type: request
- Price: 500 credits
- Categories: Financial Modeling, Data Science, Mathematical Computing, Data Storage & Persistence, Data Processing, Data Formatting & Conversion, List & Array Operations, Sorting & Ordering, Finance & Accounting, Portfolio Management, E-commerce & Product Catalog, Survey & Feedback Collection, Marketing Automation, Team Collaboration & Workspaces, Task & Workflow Automation
- Generated at: 2026-05-30T20:16:05.599Z

### Page Description

Comprehensive Google Sheets integration tool that enables AI agents to perform all spreadsheet operations through OAuth authentication. This tool provides full access to Google Sheets functionality including creating and managing spreadsheets, reading and writing data with support for formulas and batch operations, managing sheets and tabs with adding deleting and renaming capabilities, applying advanced cell formatting with colors fonts and number formats, inserting and deleting rows and columns with automatic resizing, sorting and filtering data with complex criteria, and executing find and replace operations across entire spreadsheets. The tool supports both single and batch operations for optimal performance, handles all Google Sheets data types including formulas dates and currency, provides granular control over cell formatting and sheet properties, and includes advanced features like merging cells setting filters and protecting ranges. Perfect for data analysis reporting automation spreadsheet generation and collaborative document management workflows.

### Agent Description

Google Sheets: read/write cells, formulas, formatting. Manage sheets, rows, columns. Sort, filter, find/replace. Batch operations supported.

## Details

### Details

Comprehensive Google Sheets integration tool that enables AI agents to perform all spreadsheet operations through OAuth authentication. This tool provides full access to Google Sheets functionality including creating and managing spreadsheets, reading and writing data with support for formulas and batch operations, managing sheets and tabs with adding deleting and renaming capabilities, applying advanced cell formatting with colors fonts and number formats, inserting and deleting rows and columns with automatic resizing, sorting and filtering data with complex criteria, and executing find and replace operations across entire spreadsheets. The tool supports both single and batch operations for optimal performance, handles all Google Sheets data types including formulas dates and currency, provides granular control over cell formatting and sheet properties, and includes advanced features like merging cells setting filters and protecting ranges. Perfect for data analysis reporting automation spreadsheet generation and collaborative document management workflows.

### Actions

- `create_spreadsheet` (5 credits): Create a new Google Sheets spreadsheet.
- `get_spreadsheet` (5 credits): Get spreadsheet metadata including title, sheets, locale, and timezone.
- `update_spreadsheet_properties` (5 credits): Update spreadsheet-level properties such as the title.
- `search_spreadsheets` (5 credits): Search for Google Sheets spreadsheets by name. Returns results sorted by most recently modified.
- `list_sheets` (5 credits): List all sheets/tabs in a spreadsheet.
- `add_sheet` (5 credits): Add a new sheet/tab to a spreadsheet.
- `delete_sheet` (5 credits): Delete a sheet/tab from a spreadsheet.
- `duplicate_sheet` (5 credits): Duplicate an existing sheet within the same spreadsheet.
- `rename_sheet` (5 credits): Rename a sheet/tab.
- `update_sheet_properties` (5 credits): Update sheet-level properties (title, tab color, visibility).
- `get_values` (5 credits): Read values from a single range.
- `batch_get_values` (5 credits): Read values from multiple ranges at once.
- `get_sheet_data` (5 credits): Get all data from a specific sheet.
- `search_values` (5 credits): Search for text within a spreadsheet.
- `update_values` (5 credits): Write values to a single range (overwrites existing data).
- `batch_update_values` (5 credits): Write values to multiple ranges at once.
- `append_values` (5 credits): Append rows after the last row of existing data.
- `clear_values` (5 credits): Clear values from a range (preserves formatting).
- `batch_clear_values` (5 credits): Clear values from multiple ranges at once.
- `format_cells` (5 credits): Apply text and cell formatting to a range.
- `set_number_format` (5 credits): Apply number formatting to a range.
- `merge_cells` (5 credits): Merge cells in a range.
- `unmerge_cells` (5 credits): Unmerge previously merged cells.
- `set_borders` (5 credits): Set borders on cells in a range.
- `insert_rows` (5 credits): Insert rows at a specified position.
- `insert_columns` (5 credits): Insert columns at a specified position.
- `delete_rows` (5 credits): Delete rows by index range.
- `delete_columns` (5 credits): Delete columns by index range.
- `resize_dimensions` (5 credits): Set row height or column width in pixels.
- `auto_resize_dimensions` (5 credits): Auto-fit row height or column width to content.
- `sort_range` (5 credits): Sort data in a range by one or more columns.
- `find_replace` (5 credits): Find and replace text across the spreadsheet or a specific sheet.
- `copy_paste` (5 credits): Copy and paste a range to another location.
- `cut_paste` (5 credits): Cut and paste a range to another location.
- `set_basic_filter` (5 credits): Apply a basic filter to a data range.
- `clear_filter` (5 credits): Remove the basic filter from a sheet.
- `protect_range` (5 credits): Protect a range from editing.
- `unprotect_range` (5 credits): Remove protection from a range.
- `add_named_range` (5 credits): Create a named range in the spreadsheet.
- `delete_named_range` (5 credits): Delete a named range.
- `set_data_validation` (5 credits): Set data validation rules on a range.
- `add_conditional_formatting` (5 credits): Add conditional formatting rules to a range.
- `batch_update` (5 credits): Execute multiple raw Google Sheets API requests in a single call for advanced operations.
- `share_spreadsheet` (5 credits): Share a spreadsheet with a user, group, domain, or anyone.

### Use Cases

automated report generation, data import and export, spreadsheet templating, bulk data updates, financial modeling, inventory management, dashboard creation, collaborative data entry, formula automation, batch formatting operations

### Workflows Using This Tool

#### GitHub Dev Announcements

Generate user-facing development update announcements from recent GitHub commits across one or more repositories. The user supplies a list of repos on the first run (wildcards like `org/*` allowed); the workflow stores them in a Google Sheet so subsequent runs need no input. For each run, the agent fetches commits since the last run (or last 7 days on first run), categorizes them into New Features / Updates / Bug Fixes, applies a security filter to strip internal paths, endpoints, secrets, and vulnerability details, drafts the announcement in a Google Doc, polishes the writing with a quality check tool, and logs the run (date, repos, commit count, doc URL, status) back in the sheet. Designed as a starting template — users can remix it to add their own follow-up steps such as posting to Slack or emailing subscribers.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/github-dev-announcements
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/github-dev-announcements?format=agent-md
- Published: 2026-04-30T17:43:08.504Z

#### Bank Statement OCR and Expense Categorization

Accepts uploaded bank statements, extracts transactions via OCR, categorizes each transaction by expense type, logs categorized data to a spreadsheet, and generates a spending breakdown chart. Perfect for personal finance analysis or small business bookkeeping.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/bank-statement-ocr-and-expense-categorization
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/bank-statement-ocr-and-expense-categorization?format=agent-md
- Published: 2026-04-19T18:29:42.593Z

#### Invoice OCR and Booking Pipeline

Automates accounts payable by accepting uploaded vendor invoices, extracting invoice data via OCR (vendor name, invoice number, date, line items, totals), categorizing expenses to the correct chart of accounts, booking them as bills in Zoho Books, and logging a processing summary. Eliminates manual invoice data entry for accounting teams.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/invoice-ocr-and-booking-pipeline
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/invoice-ocr-and-booking-pipeline?format=agent-md
- Published: 2026-04-19T18:29:42.593Z

#### Real Estate Open House Thank You Card Mailer

Automates personalized thank-you greeting cards for open house attendees. Pulls the latest attendee list from Google Sheets (names, addresses, and interests), scrapes the property listing photo AND property details from realtor.com, verifies address match, then creates and mails a custom folded greeting card to each attendee. The front features the listing photo, the back has the agent's logo, and the inside contains a personalized thank-you message with action-provoking phrases that reference ONLY factual property features verified from the listing.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/real-estate-open-house-thank-you-card-mailer
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/real-estate-open-house-thank-you-card-mailer?format=agent-md
- Published: 2026-03-02T00:17:40.261Z

#### Gluten Free Recipe Ingredients to Google Sheet

Fetches 5 gluten-free recipes from the web, extracts and aggregates all ingredients, deduplicates the list, and writes the final ingredient list to a new Google Sheet.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/gluten-free-recipe-ingredients-to-google-sheet
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/gluten-free-recipe-ingredients-to-google-sheet?format=agent-md
- Published: 2026-02-26T16:38:31.786Z

#### Kroger Grocery Order From Google Sheet

Reads your grocery list from a Google Sheet, searches Kroger for each item to find the best-priced match, adds them to your Kroger cart, then sends you a notification that your order is ready for checkout.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/kroger-grocery-order-from-google-sheet
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/kroger-grocery-order-from-google-sheet?format=agent-md
- Published: 2026-02-23T02:41:28.633Z

#### Accounts Receivable Follow-Up

Automates collections by pulling overdue invoices from Zoho Books, calculating days overdue, drafting collection emails with appropriate urgency levels, sending reminders to customers, and tracking collection efforts in a spreadsheet. Improves cash flow by ensuring consistent follow-up on unpaid invoices.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/accounts-receivable-follow-up
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/accounts-receivable-follow-up?format=agent-md
- Published: 2026-02-15T19:19:27.272Z

### Related Content

No related content is currently linked to this product.

## Integration Details

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp?platform=claude#videos
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp?platform=chatgpt#videos
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp?platform=cursor#videos
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp?platform=windsurf#videos

Use the local router for command-based MCP clients. It forwards requests to `https://api.agentpmt.com/mcp` and does not execute tools locally.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "696302894cf4309309cac7b2",
    "parameters": {
      "action": "create_spreadsheet",
      "title": "example_title"
    }
  }'
```

### Autonomous Agents

Autonomous agents can access this tool through AgentAddress credit balances or direct x402 payments. Use the Autonomous Agent API reference for endpoint shapes after choosing the access pattern below.

- Autonomous Agent API reference URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents
- Autonomous Agent API reference markdown URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents?format=agent-md
- Credit-Based Access Using AgentAddress: https://www.agentpmt.com/docs/autonomous-agents/credit-based-tool-usage-with-agentaddress
- AgentAddress is preferred for persistent file access, stored platform state, and maximum tool use ability across repeated calls.
- Direct x402 is for independent one-off tool calls that do not require shared files or stored platform state.
- Direct x402 public payments: USDC on Base, Arbitrum, Optimism, Polygon, and Avalanche.

### Schema

#### Credentials

These runtime credentials should be provided under `parameters._credentials` when required.

- Google OAuth (`google_oauth`, oauth_token, required)
  Help: Connect your Google account.
  Connection ID: 69616abea90ed54743f01957

#### Parameters

- Schema type: actions

```json
{
  "actions": {
    "create_spreadsheet": {
      "description": "Create a new Google Sheets spreadsheet.",
      "properties": {
        "title": {
          "type": "string",
          "description": "Title for the new spreadsheet",
          "required": true
        },
        "initial_data": {
          "type": "object",
          "description": "Initial data for the first sheet. Contains 'sheet_name' (string) and 'values' (2D array).",
          "required": false,
          "properties": {
            "sheet_name": {
              "type": "string",
              "description": "Name for the initial sheet (defaults to Sheet1)",
              "required": false
            },
            "values": {
              "type": "array",
              "description": "2D array of initial values",
              "required": false,
              "items": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "get_spreadsheet": {
      "description": "Get spreadsheet metadata including title, sheets, locale, and timezone.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        }
      }
    },
    "update_spreadsheet_properties": {
      "description": "Update spreadsheet-level properties such as the title.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "title": {
          "type": "string",
          "description": "New title for the spreadsheet",
          "required": false
        }
      }
    },
    "search_spreadsheets": {
      "description": "Search for Google Sheets spreadsheets by name. Returns results sorted by most recently modified.",
      "properties": {
        "query": {
          "type": "string",
          "description": "Search query matching against spreadsheet name (contains match). Omit to list recent spreadsheets.",
          "required": false
        },
        "max_results": {
          "type": "integer",
          "description": "Maximum results to return (1-100)",
          "required": false,
          "default": 20,
          "minimum": 1,
          "maximum": 100
        }
      }
    },
    "list_sheets": {
      "description": "List all sheets/tabs in a spreadsheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        }
      }
    },
    "add_sheet": {
      "description": "Add a new sheet/tab to a spreadsheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "new_sheet_name": {
          "type": "string",
          "description": "Name for the new sheet",
          "required": true
        },
        "tab_color": {
          "type": "object",
          "description": "RGB color for sheet tab (values 0-1)",
          "required": false,
          "properties": {
            "red": {
              "type": "number",
              "description": "Red component (0-1)",
              "required": false,
              "minimum": 0,
              "maximum": 1
            },
            "green": {
              "type": "number",
              "description": "Green component (0-1)",
              "required": false,
              "minimum": 0,
              "maximum": 1
            },
            "blue": {
              "type": "number",
              "description": "Blue component (0-1)",
              "required": false,
              "minimum": 0,
              "maximum": 1
            }
          }
        },
        "hidden": {
          "type": "boolean",
          "description": "Whether the sheet should be hidden",
          "required": false
        },
        "num_rows": {
          "type": "integer",
          "description": "Number of rows for the new sheet",
          "required": false,
          "minimum": 1
        },
        "num_columns": {
          "type": "integer",
          "description": "Number of columns for the new sheet",
          "required": false,
          "minimum": 1
        }
      }
    },
    "delete_sheet": {
      "description": "Delete a sheet/tab from a spreadsheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Name of the sheet to delete",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric ID of the sheet",
          "required": false
        },
        "sheet_index": {
          "type": "integer",
          "description": "0-based index of the sheet",
          "required": false
        }
      }
    },
    "duplicate_sheet": {
      "description": "Duplicate an existing sheet within the same spreadsheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Name of the sheet to duplicate",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric ID of the sheet to duplicate",
          "required": false
        },
        "sheet_index": {
          "type": "integer",
          "description": "0-based index of the sheet to duplicate",
          "required": false
        },
        "new_sheet_name": {
          "type": "string",
          "description": "Name for the duplicated sheet",
          "required": false
        }
      }
    },
    "rename_sheet": {
      "description": "Rename a sheet/tab.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "new_sheet_name": {
          "type": "string",
          "description": "New name for the sheet",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Current name of the sheet to rename",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric ID of the sheet",
          "required": false
        },
        "sheet_index": {
          "type": "integer",
          "description": "0-based index of the sheet",
          "required": false
        }
      }
    },
    "update_sheet_properties": {
      "description": "Update sheet-level properties (title, tab color, visibility).",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Name of the sheet to update",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric ID of the sheet",
          "required": false
        },
        "new_sheet_name": {
          "type": "string",
          "description": "New name for the sheet",
          "required": false
        },
        "tab_color": {
          "type": "object",
          "description": "RGB color for sheet tab (values 0-1)",
          "required": false,
          "properties": {
            "red": {
              "type": "number",
              "description": "Red component (0-1)",
              "required": false,
              "minimum": 0,
              "maximum": 1
            },
            "green": {
              "type": "number",
              "description": "Green component (0-1)",
              "required": false,
              "minimum": 0,
              "maximum": 1
            },
            "blue": {
              "type": "number",
              "description": "Blue component (0-1)",
              "required": false,
              "minimum": 0,
              "maximum": 1
            }
          }
        },
        "hidden": {
          "type": "boolean",
          "description": "Whether sheet should be hidden",
          "required": false
        },
        "right_to_left": {
          "type": "boolean",
          "description": "Whether sheet should use right-to-left layout",
          "required": false
        }
      }
    },
    "get_values": {
      "description": "Read values from a single range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range (e.g., 'Sheet1!A1:C10')",
          "required": true
        },
        "value_render_option": {
          "type": "string",
          "description": "How to return values",
          "required": false,
          "default": "FORMATTED_VALUE",
          "enum": [
            "FORMATTED_VALUE",
            "UNFORMATTED_VALUE",
            "FORMULA"
          ]
        },
        "major_dimension": {
          "type": "string",
          "description": "Whether to interpret arrays as rows or columns",
          "required": false,
          "default": "ROWS",
          "enum": [
            "ROWS",
            "COLUMNS"
          ]
        }
      }
    },
    "batch_get_values": {
      "description": "Read values from multiple ranges at once.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "ranges": {
          "type": "array",
          "description": "Array of A1 notation ranges",
          "required": true,
          "items": {
            "type": "string"
          }
        },
        "value_render_option": {
          "type": "string",
          "description": "How to return values",
          "required": false,
          "default": "FORMATTED_VALUE",
          "enum": [
            "FORMATTED_VALUE",
            "UNFORMATTED_VALUE",
            "FORMULA"
          ]
        },
        "major_dimension": {
          "type": "string",
          "description": "Whether to interpret arrays as rows or columns",
          "required": false,
          "default": "ROWS",
          "enum": [
            "ROWS",
            "COLUMNS"
          ]
        }
      }
    },
    "get_sheet_data": {
      "description": "Get all data from a specific sheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Name of the sheet (defaults to 'Sheet1')",
          "required": false
        }
      }
    },
    "search_values": {
      "description": "Search for text within a spreadsheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "find": {
          "type": "string",
          "description": "Text to search for (or use 'search_query' as alias)",
          "required": false
        },
        "search_query": {
          "type": "string",
          "description": "Alias for 'find'",
          "required": false
        },
        "range": {
          "type": "string",
          "description": "A1 notation range to limit the search",
          "required": false
        },
        "match_case": {
          "type": "boolean",
          "description": "Whether search is case-sensitive",
          "required": false
        },
        "match_entire_cell": {
          "type": "boolean",
          "description": "Whether to match entire cell contents only",
          "required": false
        }
      }
    },
    "update_values": {
      "description": "Write values to a single range (overwrites existing data).",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range",
          "required": true
        },
        "values": {
          "type": "array",
          "description": "2D array of values (outer array = rows, inner arrays = columns)",
          "required": true,
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "value_input_option": {
          "type": "string",
          "description": "How to interpret input values",
          "required": false,
          "default": "USER_ENTERED",
          "enum": [
            "USER_ENTERED",
            "RAW"
          ]
        },
        "major_dimension": {
          "type": "string",
          "description": "Whether to interpret arrays as rows or columns",
          "required": false,
          "default": "ROWS",
          "enum": [
            "ROWS",
            "COLUMNS"
          ]
        },
        "include_values_in_response": {
          "type": "boolean",
          "description": "Whether to return updated values in response",
          "required": false
        },
        "response_value_render_option": {
          "type": "string",
          "description": "How to render values in response",
          "required": false,
          "default": "FORMATTED_VALUE",
          "enum": [
            "FORMATTED_VALUE",
            "UNFORMATTED_VALUE",
            "FORMULA"
          ]
        }
      }
    },
    "batch_update_values": {
      "description": "Write values to multiple ranges at once.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "data": {
          "type": "array",
          "description": "Array of range/values pairs",
          "required": true,
          "items": {
            "type": "object",
            "properties": {
              "range": {
                "type": "string",
                "description": "A1 notation range"
              },
              "values": {
                "type": "array",
                "description": "2D array of values",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "major_dimension": {
                "type": "string",
                "description": "ROWS or COLUMNS",
                "enum": [
                  "ROWS",
                  "COLUMNS"
                ],
                "default": "ROWS"
              }
            }
          }
        },
        "value_input_option": {
          "type": "string",
          "description": "How to interpret input values",
          "required": false,
          "default": "USER_ENTERED",
          "enum": [
            "USER_ENTERED",
            "RAW"
          ]
        },
        "include_values_in_response": {
          "type": "boolean",
          "description": "Whether to return updated values",
          "required": false
        }
      }
    },
    "append_values": {
      "description": "Append rows after the last row of existing data.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range (data will be appended after the last row in this range)",
          "required": true
        },
        "values": {
          "type": "array",
          "description": "2D array of values to append",
          "required": true,
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "value_input_option": {
          "type": "string",
          "description": "How to interpret input values",
          "required": false,
          "default": "USER_ENTERED",
          "enum": [
            "USER_ENTERED",
            "RAW"
          ]
        },
        "major_dimension": {
          "type": "string",
          "description": "Whether to interpret arrays as rows or columns",
          "required": false,
          "default": "ROWS",
          "enum": [
            "ROWS",
            "COLUMNS"
          ]
        },
        "include_values_in_response": {
          "type": "boolean",
          "description": "Whether to return updated values",
          "required": false
        }
      }
    },
    "clear_values": {
      "description": "Clear values from a range (preserves formatting).",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range to clear",
          "required": true
        }
      }
    },
    "batch_clear_values": {
      "description": "Clear values from multiple ranges at once.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "ranges": {
          "type": "array",
          "description": "Array of A1 notation ranges to clear",
          "required": true,
          "items": {
            "type": "string"
          }
        }
      }
    },
    "format_cells": {
      "description": "Apply text and cell formatting to a range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range (can include sheet name like 'Sheet1!A1:B2')",
          "required": true
        },
        "cell_format": {
          "type": "object",
          "description": "Cell formatting options. Color fields require RGB dicts with 0-1 float values.",
          "required": true,
          "properties": {
            "bold": {
              "type": "boolean",
              "description": "Bold text",
              "required": false
            },
            "italic": {
              "type": "boolean",
              "description": "Italic text",
              "required": false
            },
            "strikethrough": {
              "type": "boolean",
              "description": "Strikethrough text",
              "required": false
            },
            "underline": {
              "type": "boolean",
              "description": "Underline text",
              "required": false
            },
            "font_size": {
              "type": "integer",
              "description": "Font size in points",
              "required": false,
              "minimum": 1
            },
            "font_family": {
              "type": "string",
              "description": "Font family name",
              "required": false
            },
            "text_color": {
              "type": "object",
              "description": "Text color (RGB 0-1)",
              "required": false,
              "properties": {
                "red": {
                  "type": "number",
                  "description": "Red (0-1)",
                  "required": false,
                  "minimum": 0,
                  "maximum": 1
                },
                "green": {
                  "type": "number",
                  "description": "Green (0-1)",
                  "required": false,
                  "minimum": 0,
                  "maximum": 1
                },
                "blue": {
                  "type": "number",
                  "description": "Blue (0-1)",
                  "required": false,
                  "minimum": 0,
                  "maximum": 1
                }
              }
            },
            "background_color": {
              "type": "object",
              "description": "Background color (RGB 0-1)",
              "required": false,
              "properties": {
                "red": {
                  "type": "number",
                  "description": "Red (0-1)",
                  "required": false,
                  "minimum": 0,
                  "maximum": 1
                },
                "green": {
                  "type": "number",
                  "description": "Green (0-1)",
                  "required": false,
                  "minimum": 0,
                  "maximum": 1
                },
                "blue": {
                  "type": "number",
                  "description": "Blue (0-1)",
                  "required": false,
                  "minimum": 0,
                  "maximum": 1
                }
              }
            },
            "horizontal_alignment": {
              "type": "string",
              "description": "Horizontal alignment",
              "required": false,
              "enum": [
                "LEFT",
                "CENTER",
                "RIGHT"
              ]
            },
            "vertical_alignment": {
              "type": "string",
              "description": "Vertical alignment",
              "required": false,
              "enum": [
                "TOP",
                "MIDDLE",
                "BOTTOM"
              ]
            },
            "wrap_strategy": {
              "type": "string",
              "description": "Text wrapping strategy",
              "required": false,
              "enum": [
                "OVERFLOW_CELL",
                "CLIP",
                "WRAP"
              ]
            }
          }
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name (can also be embedded in range)",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "set_number_format": {
      "description": "Apply number formatting to a range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range",
          "required": true
        },
        "number_format": {
          "type": "object",
          "description": "Number format specification",
          "required": true,
          "properties": {
            "format_type": {
              "type": "string",
              "description": "Number format type",
              "required": false,
              "enum": [
                "TEXT",
                "NUMBER",
                "PERCENT",
                "CURRENCY",
                "DATE",
                "TIME",
                "DATE_TIME",
                "SCIENTIFIC"
              ]
            },
            "pattern": {
              "type": "string",
              "description": "Custom number format pattern (e.g., '$#,##0.00')",
              "required": false
            }
          }
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "merge_cells": {
      "description": "Merge cells in a range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range to merge",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name (can also be embedded in range)",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        },
        "merge_type": {
          "type": "string",
          "description": "How to merge cells",
          "required": false,
          "default": "MERGE_ALL",
          "enum": [
            "MERGE_ALL",
            "MERGE_ROWS",
            "MERGE_COLUMNS"
          ]
        }
      }
    },
    "unmerge_cells": {
      "description": "Unmerge previously merged cells.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range to unmerge",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name (can also be embedded in range)",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "set_borders": {
      "description": "Set borders on cells in a range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "insert_rows": {
      "description": "Insert rows at a specified position.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "start_index": {
          "type": "integer",
          "description": "0-based row index where insertion starts",
          "required": true,
          "minimum": 0
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        },
        "num_rows": {
          "type": "integer",
          "description": "Number of rows to insert (default 1)",
          "required": false,
          "minimum": 1
        },
        "inherit_from_before": {
          "type": "boolean",
          "description": "Whether new rows should inherit formatting from the row before",
          "required": false
        }
      }
    },
    "insert_columns": {
      "description": "Insert columns at a specified position.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "start_index": {
          "type": "integer",
          "description": "0-based column index where insertion starts",
          "required": true,
          "minimum": 0
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        },
        "num_columns": {
          "type": "integer",
          "description": "Number of columns to insert (default 1)",
          "required": false,
          "minimum": 1
        },
        "inherit_from_before": {
          "type": "boolean",
          "description": "Whether new columns should inherit formatting from the column before",
          "required": false
        }
      }
    },
    "delete_rows": {
      "description": "Delete rows by index range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "start_index": {
          "type": "integer",
          "description": "0-based starting row index",
          "required": true,
          "minimum": 0
        },
        "end_index": {
          "type": "integer",
          "description": "0-based ending row index (exclusive)",
          "required": true,
          "minimum": 0
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "delete_columns": {
      "description": "Delete columns by index range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "start_index": {
          "type": "integer",
          "description": "0-based starting column index",
          "required": true,
          "minimum": 0
        },
        "end_index": {
          "type": "integer",
          "description": "0-based ending column index (exclusive)",
          "required": true,
          "minimum": 0
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "resize_dimensions": {
      "description": "Set row height or column width in pixels.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "dimension": {
          "type": "string",
          "description": "Dimension to resize",
          "required": true,
          "enum": [
            "ROWS",
            "COLUMNS"
          ]
        },
        "start_index": {
          "type": "integer",
          "description": "0-based starting index",
          "required": true,
          "minimum": 0
        },
        "end_index": {
          "type": "integer",
          "description": "0-based ending index (exclusive)",
          "required": true,
          "minimum": 0
        },
        "pixel_size": {
          "type": "integer",
          "description": "Height (for rows) or width (for columns) in pixels",
          "required": true,
          "minimum": 1
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "auto_resize_dimensions": {
      "description": "Auto-fit row height or column width to content.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "dimension": {
          "type": "string",
          "description": "Dimension to auto-resize",
          "required": true,
          "enum": [
            "ROWS",
            "COLUMNS"
          ]
        },
        "start_index": {
          "type": "integer",
          "description": "0-based starting index",
          "required": true,
          "minimum": 0
        },
        "end_index": {
          "type": "integer",
          "description": "0-based ending index (exclusive)",
          "required": true,
          "minimum": 0
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "sort_range": {
      "description": "Sort data in a range by one or more columns.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range to sort",
          "required": true
        },
        "sort_specs": {
          "type": "array",
          "description": "Sorting specifications",
          "required": true,
          "items": {
            "type": "object",
            "properties": {
              "dimensionIndex": {
                "type": "integer",
                "description": "0-based column index to sort by"
              },
              "sortOrder": {
                "type": "string",
                "description": "Sort direction",
                "enum": [
                  "ASCENDING",
                  "DESCENDING"
                ]
              }
            }
          }
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name (can also be embedded in range)",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "find_replace": {
      "description": "Find and replace text across the spreadsheet or a specific sheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "find": {
          "type": "string",
          "description": "Text to search for",
          "required": true
        },
        "replacement": {
          "type": "string",
          "description": "Text to replace with",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name (limit to one sheet)",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID (limit to one sheet)",
          "required": false
        },
        "match_case": {
          "type": "boolean",
          "description": "Whether search is case-sensitive",
          "required": false
        },
        "match_entire_cell": {
          "type": "boolean",
          "description": "Whether to match entire cell contents only",
          "required": false
        },
        "search_by_regex": {
          "type": "boolean",
          "description": "Whether to use regex for search",
          "required": false
        },
        "include_formulas": {
          "type": "boolean",
          "description": "Whether to search in formulas",
          "required": false
        }
      }
    },
    "copy_paste": {
      "description": "Copy and paste a range to another location.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "Source A1 notation range",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "cut_paste": {
      "description": "Cut and paste a range to another location.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "Source A1 notation range",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "set_basic_filter": {
      "description": "Apply a basic filter to a data range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range for the filter",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name (can also be embedded in range)",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        },
        "filter_criteria": {
          "type": "object",
          "description": "Filter criteria specification",
          "required": false
        }
      }
    },
    "clear_filter": {
      "description": "Remove the basic filter from a sheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "protect_range": {
      "description": "Protect a range from editing.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range to protect",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        },
        "description": {
          "type": "string",
          "description": "Description for the protected range",
          "required": false
        },
        "warning_only": {
          "type": "boolean",
          "description": "Whether protection should be warning-only (users can still edit)",
          "required": false
        }
      }
    },
    "unprotect_range": {
      "description": "Remove protection from a range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range to unprotect",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "add_named_range": {
      "description": "Create a named range in the spreadsheet.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "name": {
          "type": "string",
          "description": "Name for the named range",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "delete_named_range": {
      "description": "Delete a named range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "named_range_id": {
          "type": "string",
          "description": "ID of the named range to delete",
          "required": true
        }
      }
    },
    "set_data_validation": {
      "description": "Set data validation rules on a range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range",
          "required": true
        },
        "validation_rule": {
          "type": "object",
          "description": "Data validation rule specification",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "add_conditional_formatting": {
      "description": "Add conditional formatting rules to a range.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "range": {
          "type": "string",
          "description": "A1 notation range",
          "required": true
        },
        "rule": {
          "type": "object",
          "description": "Conditional formatting rule specification",
          "required": true
        },
        "sheet_name": {
          "type": "string",
          "description": "Sheet name",
          "required": false
        },
        "sheet_id": {
          "type": "integer",
          "description": "Numeric sheet ID",
          "required": false
        }
      }
    },
    "batch_update": {
      "description": "Execute multiple raw Google Sheets API requests in a single call for advanced operations.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "requests": {
          "type": "array",
          "description": "Array of raw Sheets API batch update request objects",
          "required": true,
          "items": {
            "type": "object"
          }
        }
      }
    },
    "share_spreadsheet": {
      "description": "Share a spreadsheet with a user, group, domain, or anyone.",
      "properties": {
        "spreadsheet_id": {
          "type": "string",
          "description": "Google Sheets ID or full spreadsheet URL",
          "required": true
        },
        "email": {
          "type": "string",
          "description": "Email address for sharing",
          "required": true,
          "format": "email"
        },
        "role": {
          "type": "string",
          "description": "Sharing role",
          "required": true,
          "enum": [
            "owner",
            "organizer",
            "fileOrganizer",
            "writer",
            "commenter",
            "reader"
          ]
        },
        "sharing_type": {
          "type": "string",
          "description": "Sharing type",
          "required": false,
          "default": "user",
          "enum": [
            "user",
            "group",
            "domain",
            "anyone"
          ]
        }
      }
    }
  }
}
```

### Usage Instructions

# Google Sheets

Comprehensive spreadsheet operations: create, read, write, format, and manage Google Sheets.

## Spreadsheet Identification

All actions (except `create_spreadsheet` and `search_spreadsheets`) require a spreadsheet. Provide either:
- **spreadsheet_id** - The spreadsheet ID (e.g., `1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms`)
- **spreadsheet_url** - Full URL (e.g., `https://docs.google.com/spreadsheets/d/1BxiMVs0XRA.../edit`)

## Range Notation

Ranges use A1 notation: `A1:C10`, `Sheet1!A1:C10`, `A:C` (entire columns), `1:5` (entire rows).

## Value Format

Values are 2D arrays: outer array = rows, inner arrays = columns.
```json
[["Name", "Age"], ["Alice", 30], ["Bob", 25]]
```

---

## Actions

### Spreadsheet Management

#### create_spreadsheet
Create a new spreadsheet.

- **Required:** `title`
- **Optional:** `initial_data` (object with `sheet_name` and `values` 2D array)

```json
{"action": "create_spreadsheet", "title": "Q1 Budget"}
```

```json
{"action": "create_spreadsheet", "title": "Team Roster", "initial_data": {"sheet_name": "Players", "values": [["Name", "Position"], ["Alice", "Forward"]]}}
```

#### get_spreadsheet
Get spreadsheet metadata (title, sheets, locale, timezone).

- **Required:** `spreadsheet_id`

```json
{"action": "get_spreadsheet", "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"}
```

#### update_spreadsheet_properties
Update spreadsheet-level properties such as the title.

- **Required:** `spreadsheet_id`
- **Optional:** `title`

```json
{"action": "update_spreadsheet_properties", "spreadsheet_id": "SPREADSHEET_ID", "title": "Renamed Budget"}
```

#### search_spreadsheets
Search for spreadsheets by name. Returns results sorted by most recently modified.

- **Optional:** `query` (name contains match; omit to list recent spreadsheets), `max_results` (1-100, default 20)

```json
{"action": "search_spreadsheets", "query": "budget", "max_results": 5}
```

#### share_spreadsheet
Share a spreadsheet with a user.

- **Required:** `spreadsheet_id`, `email`, `role`
- **Optional:** `type` (default: `user`; options: `user`, `group`, `domain`, `anyone`)

Role options: `owner`, `organizer`, `fileOrganizer`, `writer`, `commenter`, `reader`

```json
{"action": "share_spreadsheet", "spreadsheet_id": "SPREADSHEET_ID", "email": "bob@example.com", "role": "writer"}
```

---

### Sheet (Tab) Operations

#### list_sheets
List all sheets/tabs in a spreadsheet.

- **Required:** `spreadsheet_id`

```json
{"action": "list_sheets", "spreadsheet_id": "SPREADSHEET_ID"}
```

#### add_sheet
Add a new sheet/tab.

- **Required:** `spreadsheet_id`, `new_sheet_name`
- **Optional:** `tab_color` (RGB object with 0-1 floats), `hidden`, `num_rows`, `num_columns`

```json
{"action": "add_sheet", "spreadsheet_id": "SPREADSHEET_ID", "new_sheet_name": "Q2 Data", "tab_color": {"red": 0.2, "green": 0.6, "blue": 1.0}}
```

#### delete_sheet
Delete a sheet/tab.

- **Required:** `spreadsheet_id`, and one of: `sheet_name`, `sheet_id`, or `sheet_index`

```json
{"action": "delete_sheet", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Old Data"}
```

#### duplicate_sheet
Duplicate an existing sheet within the same spreadsheet.

- **Required:** `spreadsheet_id`, and one of: `sheet_name`, `sheet_id`, or `sheet_index`
- **Optional:** `new_sheet_name`

```json
{"action": "duplicate_sheet", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Template", "new_sheet_name": "March Copy"}
```

#### rename_sheet
Rename a sheet/tab.

- **Required:** `spreadsheet_id`, `new_sheet_name`, and one of: `sheet_name`, `sheet_id`, or `sheet_index`

```json
{"action": "rename_sheet", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1", "new_sheet_name": "Revenue"}
```

#### update_sheet_properties
Update sheet-level properties (title, tab color, visibility).

- **Required:** `spreadsheet_id`, and one of: `sheet_name` or `sheet_id`
- **Optional:** `new_sheet_name`, `tab_color`, `hidden`

```json
{"action": "update_sheet_properties", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Data", "tab_color": {"red": 1.0, "green": 0, "blue": 0}, "hidden": false}
```

---

### Reading Data

#### get_values
Read values from a single range.

- **Required:** `spreadsheet_id`, `range`
- **Optional:** `value_render_option` (`FORMATTED_VALUE` default, `UNFORMATTED_VALUE`, `FORMULA`), `major_dimension` (`ROWS` default, `COLUMNS`)

```json
{"action": "get_values", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A1:D10"}
```

#### batch_get_values
Read values from multiple ranges at once.

- **Required:** `spreadsheet_id`, `ranges` (array of A1 ranges)
- **Optional:** `value_render_option`, `major_dimension`

```json
{"action": "batch_get_values", "spreadsheet_id": "SPREADSHEET_ID", "ranges": ["Sheet1!A1:B5", "Sheet2!A1:C3"]}
```

#### get_sheet_data
Get all data from a specific sheet.

- **Required:** `spreadsheet_id`
- **Optional:** `sheet_name` (defaults to `Sheet1`)

```json
{"action": "get_sheet_data", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Inventory"}
```

#### search_values
Search for text within a spreadsheet.

- **Required:** `spreadsheet_id`, `find` (or `search_query`)
- **Optional:** `range` (limit search to range), `match_case`, `match_entire_cell`

```json
{"action": "search_values", "spreadsheet_id": "SPREADSHEET_ID", "find": "overdue", "range": "Sheet1!A1:Z100"}
```

---

### Writing Data

#### update_values
Write values to a single range (overwrites existing data).

- **Required:** `spreadsheet_id`, `range`, `values`
- **Optional:** `value_input_option` (`USER_ENTERED` default, `RAW`), `major_dimension`, `include_values_in_response`

```json
{"action": "update_values", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A1:C2", "values": [["Name", "Score", "Grade"], ["Alice", 95, "A"]]}
```

#### append_values
Append rows after the last row of existing data.

- **Required:** `spreadsheet_id`, `range`, `values`
- **Optional:** `value_input_option`, `major_dimension`, `include_values_in_response`

```json
{"action": "append_values", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A:C", "values": [["Bob", 88, "B+"], ["Carol", 92, "A-"]]}
```

#### batch_update_values
Write values to multiple ranges at once.

- **Required:** `spreadsheet_id`, `data` (array of objects with `range` and `values`)
- **Optional:** `value_input_option`, `include_values_in_response`

```json
{"action": "batch_update_values", "spreadsheet_id": "SPREADSHEET_ID", "data": [{"range": "Sheet1!A1:B2", "values": [["X", "Y"], [1, 2]]}, {"range": "Sheet2!A1", "values": [["Done"]]}]}
```

#### clear_values
Clear values from a range (preserves formatting).

- **Required:** `spreadsheet_id`, `range`

```json
{"action": "clear_values", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A1:C10"}
```

#### batch_clear_values
Clear multiple ranges at once.

- **Required:** `spreadsheet_id`, `ranges`

```json
{"action": "batch_clear_values", "spreadsheet_id": "SPREADSHEET_ID", "ranges": ["Sheet1!A1:B5", "Sheet1!D1:D5"]}
```

---

### Formatting

#### format_cells
Apply text and cell formatting.

- **Required:** `spreadsheet_id`, `range`, `cell_format`, and one of: `sheet_name`, `sheet_id`, or sheet name embedded in range (e.g., `Sheet1!A1:B2`)
- **cell_format options:** `bold`, `italic`, `underline`, `strikethrough`, `font_size`, `font_family`, `text_color` (RGB 0-1), `background_color` (RGB 0-1), `horizontal_alignment` (`LEFT`/`CENTER`/`RIGHT`), `vertical_alignment` (`TOP`/`MIDDLE`/`BOTTOM`), `wrap_strategy` (`OVERFLOW_CELL`/`CLIP`/`WRAP`)

```json
{"action": "format_cells", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A1:D1", "cell_format": {"bold": true, "background_color": {"red": 0.9, "green": 0.9, "blue": 0.9}, "horizontal_alignment": "CENTER"}}
```

#### set_number_format
Apply number formatting to a range.

- **Required:** `spreadsheet_id`, `range`, `number_format`, and one of: `sheet_name`, `sheet_id`, or sheet name in range
- **number_format:** object with `type` (`TEXT`, `NUMBER`, `PERCENT`, `CURRENCY`, `DATE`, `TIME`, `DATE_TIME`, `SCIENTIFIC`) and optional `pattern`

```json
{"action": "set_number_format", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!B2:B100", "sheet_name": "Sheet1", "number_format": {"type": "CURRENCY", "pattern": "$#,##0.00"}}
```

#### merge_cells
Merge cells in a range.

- **Required:** `spreadsheet_id`, `range`, and one of: `sheet_name`, `sheet_id`, or sheet name in range
- **Optional:** `merge_type` (`MERGE_ALL` default, `MERGE_ROWS`, `MERGE_COLUMNS`)

```json
{"action": "merge_cells", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A1:D1", "merge_type": "MERGE_ALL"}
```

#### unmerge_cells
Unmerge previously merged cells.

- **Required:** `spreadsheet_id`, `range`, and one of: `sheet_name`, `sheet_id`, or sheet name in range

```json
{"action": "unmerge_cells", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A1:D1"}
```

---

### Row and Column Operations

All row/column operations use 0-based indexing.

#### insert_rows
Insert rows at a position.

- **Required:** `spreadsheet_id`, `start_index` (0-based), and one of: `sheet_name` or `sheet_id`
- **Optional:** `num_rows` (default 1), `inherit_from_before`

```json
{"action": "insert_rows", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1", "start_index": 2, "num_rows": 3}
```

#### insert_columns
Insert columns at a position.

- **Required:** `spreadsheet_id`, `start_index` (0-based), and one of: `sheet_name` or `sheet_id`
- **Optional:** `num_columns` (default 1), `inherit_from_before`

```json
{"action": "insert_columns", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1", "start_index": 1, "num_columns": 2}
```

#### delete_rows
Delete rows by index range.

- **Required:** `spreadsheet_id`, `start_index`, `end_index` (exclusive, 0-based), and one of: `sheet_name` or `sheet_id`

```json
{"action": "delete_rows", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1", "start_index": 5, "end_index": 8}
```

#### delete_columns
Delete columns by index range.

- **Required:** `spreadsheet_id`, `start_index`, `end_index` (exclusive, 0-based), and one of: `sheet_name` or `sheet_id`

```json
{"action": "delete_columns", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1", "start_index": 2, "end_index": 4}
```

#### resize_dimensions
Set row height or column width in pixels.

- **Required:** `spreadsheet_id`, `dimension` (`ROWS` or `COLUMNS`), `start_index`, `end_index`, `pixel_size`, and one of: `sheet_name` or `sheet_id`

```json
{"action": "resize_dimensions", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1", "dimension": "COLUMNS", "start_index": 0, "end_index": 3, "pixel_size": 200}
```

#### auto_resize_dimensions
Auto-fit row height or column width to content.

- **Required:** `spreadsheet_id`, `dimension` (`ROWS` or `COLUMNS`), `start_index`, `end_index`, and one of: `sheet_name` or `sheet_id`

```json
{"action": "auto_resize_dimensions", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1", "dimension": "COLUMNS", "start_index": 0, "end_index": 5}
```

---

### Data Manipulation

#### sort_range
Sort data in a range by one or more columns.

- **Required:** `spreadsheet_id`, `range`, `sort_specs`, and one of: `sheet_name`, `sheet_id`, or sheet name in range
- **sort_specs:** array of objects with `dimensionIndex` (0-based column) and `sortOrder` (`ASCENDING` or `DESCENDING`)

```json
{"action": "sort_range", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A2:D100", "sort_specs": [{"dimensionIndex": 1, "sortOrder": "DESCENDING"}]}
```

#### find_replace
Find and replace text across the spreadsheet or a specific sheet.

- **Required:** `spreadsheet_id`, `find`, `replacement`
- **Optional:** `sheet_name` or `sheet_id` (limit to one sheet), `match_case`, `match_entire_cell`, `search_by_regex`, `include_formulas`

```json
{"action": "find_replace", "spreadsheet_id": "SPREADSHEET_ID", "find": "TBD", "replacement": "Confirmed", "sheet_name": "Sheet1"}
```

---

### Filtering

#### set_basic_filter
Apply a basic filter to a data range.

- **Required:** `spreadsheet_id`, `range`, and one of: `sheet_name`, `sheet_id`, or sheet name in range
- **Optional:** `filter_criteria`

```json
{"action": "set_basic_filter", "spreadsheet_id": "SPREADSHEET_ID", "range": "Sheet1!A1:D100"}
```

#### clear_filter
Remove the basic filter from a sheet.

- **Required:** `spreadsheet_id`, and one of: `sheet_name` or `sheet_id`

```json
{"action": "clear_filter", "spreadsheet_id": "SPREADSHEET_ID", "sheet_name": "Sheet1"}
```

---

### Advanced

#### batch_update
Execute multiple raw Google Sheets API requests in a single call. Use this for operations not covered by other actions.

- **Required:** `spreadsheet_id`, `requests` (array of Sheets API batch update request objects)

```json
{"action": "batch_update", "spreadsheet_id": "SPREADSHEET_ID", "requests": [{"updateSheetProperties": {"properties": {"sheetId": 0, "title": "New Name"}, "fields": "title"}}]}
```

---

## Common Workflows

### Build a report from scratch
1. `create_spreadsheet` with title and initial headers
2. `append_values` to add data rows
3. `format_cells` to style the header row (bold, background color)
4. `set_number_format` for currency/percentage columns
5. `auto_resize_dimensions` to fit column widths
6. `share_spreadsheet` with stakeholders

### Update existing data
1. `search_spreadsheets` to find the spreadsheet by name
2. `get_values` to read current data
3. `update_values` or `append_values` to write changes
4. `sort_range` to re-sort if needed

### Manage multiple sheets
1. `list_sheets` to see all tabs
2. `add_sheet` or `duplicate_sheet` to create new tabs
3. `rename_sheet` or `update_sheet_properties` to organize
4. `delete_sheet` to remove unused tabs

---

## Important Notes

- **Value input:** `USER_ENTERED` (default) parses values as if typed by a user (formulas, dates, numbers are interpreted). `RAW` stores values exactly as provided.
- **Colors:** All color fields (text_color, background_color, tab_color) require RGB objects with float values from 0 to 1. Hex strings are not supported. Example: `{"red": 0.2, "green": 0.6, "blue": 1.0}`
- **Indexing:** Row/column operations (insert, delete, resize) use 0-based indexing. `end_index` is exclusive.
- **Sheet identification:** Most sheet operations accept `sheet_name`, `sheet_id`, or `sheet_index`. You can also embed the sheet name in the range (e.g., `Sheet1!A1:C10`).
- **Formulas:** Write formulas by including them in values with a leading `=` and using `USER_ENTERED` input option. Example: `[["=SUM(B2:B10)"]]`

### Frequently Asked Questions

#### How do I connect this tool to an external agent?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

#### How does an external agent use this tool?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

After the external agent is connected to an Agent Group that can use this tool, paste this prompt into the agent:

> Call the AgentPMT-Tool-Search-and-Execution tool with action 'get\_schema' and tool\_id 696302894cf4309309cac7b2 ("Google Sheets"). Then call the same tool with action 'call\_tool', tool\_id 696302894cf4309309cac7b2, and the parameters needed for my request.

The agent should fetch the tool schema first, collect the required parameters for your request, and then call the tool through AgentPMT.

### Dependencies

This product has no public dependency products.