> For the complete documentation index, see [llms.txt](https://docs.allmcp.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allmcp.co/documentation/providers/google-sheets.md).

# Google Sheets

AllMCP gives your agent a full set of Google Sheets and Google Drive tools: read and write cells, manage tabs, format ranges, add charts, share files, export, and more.

<a href="/pages/QJVxDLqxIz5KMCH5afbE" class="button secondary" data-icon="table-cells">All providers</a> <a href="/pages/LCxjCVwlclt0MOQcPwvP" class="button secondary" data-icon="gear">How connecting works</a>

***

## Point your client at AllMCP

Connect your MCP client to the AllMCP endpoint and authenticate with your API key.

```
https://go.allmcp.co/mcp/
```

Send your key on every request using either header:

```
X-API-Key: allmcp_xxx
```

```
Authorization: Bearer allmcp_xxx
```

If you run agents for more than one of your own customers, add `?user_id=...` (and optionally `?org_id=...`) to the endpoint URL so each customer's Google connection stays separate.

***

## Connect

Google Sheets uses **OAuth2**, so there are no tokens to copy by hand.

{% stepper %}
{% step %}

#### Ask your agent to connect Google Sheets

Tell your agent to connect the `google_sheets` provider. It returns a secure Google sign-in link.
{% endstep %}

{% step %}

#### Grant access in your browser

Open the link, sign in to Google, and approve the requested access. That is the only manual step.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**AllMCP handles consent and token refresh for you.** Once you have approved access in Google, your agent stays connected. You only need to sign in again if you revoke access from your Google account.
{% endhint %}

***

## Tools by category

Once you are connected, your agent can use the Google Sheets tools below. The categories show what it can do for you.

### Files

Drive-side file operations (the Sheets API has no list endpoint of its own).

| Tool                                | Description                                                                              |
| ----------------------------------- | ---------------------------------------------------------------------------------------- |
| `google_sheets_list_spreadsheets`   | Lists the spreadsheets you have access to in Google Drive.                               |
| `google_sheets_get_file_metadata`   | Returns file-level details for one spreadsheet, such as its name, owner, and timestamps. |
| `google_sheets_create_spreadsheet`  | Creates a brand-new, empty spreadsheet.                                                  |
| `google_sheets_copy_spreadsheet`    | Makes a duplicate copy of an existing spreadsheet.                                       |
| `google_sheets_rename_spreadsheet`  | Changes the title of an existing spreadsheet.                                            |
| `google_sheets_trash_spreadsheet`   | Moves a spreadsheet to the Drive trash, where it can still be recovered.                 |
| `google_sheets_untrash_spreadsheet` | Restores a spreadsheet that was previously moved to the trash.                           |
| `google_sheets_delete_spreadsheet`  | Permanently deletes a spreadsheet, bypassing the trash — this cannot be undone.          |

### Values

Read and write cell data.

| Tool                                               | Description                                                                     |
| -------------------------------------------------- | ------------------------------------------------------------------------------- |
| `google_sheets_values_get`                         | Reads the values from a single range of cells.                                  |
| `google_sheets_values_update`                      | Writes values into a single range of cells.                                     |
| `google_sheets_values_append`                      | Adds new rows of data to the end of a sheet.                                    |
| `google_sheets_values_clear`                       | Clears the values from a range of cells.                                        |
| `google_sheets_values_batch_get`                   | Reads several ranges of cells in a single request.                              |
| `google_sheets_values_batch_update`                | Writes to several ranges of cells in a single request.                          |
| `google_sheets_values_batch_clear`                 | Clears several ranges of cells in a single request.                             |
| `google_sheets_values_batch_get_by_data_filter`    | Reads ranges selected by a data filter rather than by fixed cell addresses.     |
| `google_sheets_values_batch_update_by_data_filter` | Writes to ranges selected by a data filter rather than by fixed cell addresses. |
| `google_sheets_values_batch_clear_by_data_filter`  | Clears ranges selected by a data filter rather than by fixed cell addresses.    |

### Metadata

Read spreadsheet structure (sheet names, IDs, dimensions).

| Tool                               | Description                                                                          |
| ---------------------------------- | ------------------------------------------------------------------------------------ |
| `google_sheets_get_spreadsheet`    | Returns the full structure of a spreadsheet, including every tab and its dimensions. |
| `google_sheets_get_by_data_filter` | Returns spreadsheet structure for only the parts that match a data filter.           |

### Sheets (tab management)

Add, delete, duplicate, rename, and reorder the tabs within a spreadsheet.

### Dimensions

Insert, delete, and resize rows and columns.

### Formatting

Format ranges, merge and unmerge cells, and set data validation rules.

### Conditional

Create, update, and delete conditional formatting rules.

### Filters & Sort

Apply basic filters, save filter views, and sort ranges.

### Charts

Create, update, and delete charts.

### Sharing

Manage who a spreadsheet is shared with and at what access level.

### Export

Export a spreadsheet to CSV, XLSX, or PDF.

### Tables

Create, update, and delete structured tables (a 2024+ Google Sheets feature).

### Find & Replace

Find and replace text, trim whitespace, and remove duplicate rows.

### Named Ranges

Create, update, and delete named ranges.

### Protection

Create, update, and delete protected ranges that restrict who can edit them.

### Developer Metadata

Attach and manage custom key-value annotations on a spreadsheet, sheet, or range.

***

## Common workflows

Just describe what you want in plain language — your agent picks the right tools.

{% tabs %}
{% tab title="Read a spreadsheet" %}

```
Read cells A1:D10 from the sheet "Sales Q1" in spreadsheet ID 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms
```

{% endtab %}

{% tab title="Write data" %}

```
Update cells B2:B6 in sheet "Forecast" to the values [100, 200, 150, 300, 250]
```

{% endtab %}

{% tab title="Create a report" %}

```
Create a new spreadsheet called "Weekly Report", add a sheet named "Deals", and write the headers: Date, Name, Amount, Stage
```

{% endtab %}

{% tab title="Export" %}

```
Export spreadsheet ID abc123 to CSV
```

{% endtab %}
{% endtabs %}

***

## Notes

{% hint style="info" icon="link" %}
**Finding the spreadsheet ID.** Spreadsheet IDs appear in the Google Sheets URL: `https://docs.google.com/spreadsheets/d/{ID}/edit`
{% endhint %}

{% hint style="warning" %}
**Large reads.** For very large reads (more than 10,000 cells), ask your agent to fetch multiple ranges in one batch — it is faster and more reliable.
{% endhint %}

***

## See also

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-table-cells" style="color:$primary;">:table-cells:</i></h4></td><td><strong>All providers</strong></td><td>Browse every connected provider.</td><td><a href="/pages/QJVxDLqxIz5KMCH5afbE">/pages/QJVxDLqxIz5KMCH5afbE</a></td></tr><tr><td><h4><i class="fa-bolt" style="color:$primary;">:bolt:</i></h4></td><td><strong>System tools</strong></td><td>The always-on tools every connection ships with.</td><td><a href="https://docs.allmcp.co/documentation/api-reference/system-tools">https://docs.allmcp.co/documentation/api-reference/system-tools</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.allmcp.co/documentation/providers/google-sheets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
