> ## Documentation Index
> Fetch the complete documentation index at: https://docs.civic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Sheets

> Create and manage Google Sheets spreadsheets

## Overview

The Google Sheets server enables AI assistants to interact with [Google Sheets](https://sheets.google.com), providing comprehensive spreadsheet management including data reading and writing, range operations, spreadsheet creation, and collaboration features through the Google Sheets API.

## How to Add Google Sheets

<Steps>
  <Step title="Add Server">
    Add the Google Sheets server to your Civic environment through the server directory.
  </Step>

  <Step title="Authorize">
    Simply log in with your Google account and approve the OAuth consent request. No admin approval needed.
  </Step>

  <Step title="Test Connection">
    Try "List my Google Sheets" to verify the connection works.
  </Step>
</Steps>

<Note>
  **Simple OAuth Consent:** Google Sheets uses standard Google OAuth consent. Works with personal Google accounts and Google Workspace without special admin approval.
</Note>

## What You Can Do

<CardGroup cols={2}>
  <Card title="Spreadsheet Discovery" icon="table">
    List accessible spreadsheets and get spreadsheet information
  </Card>

  <Card title="Data Operations" icon="database">
    Read and modify cell values with range-based operations
  </Card>

  <Card title="Spreadsheet Creation" icon="file-spreadsheet">
    Create new spreadsheets and add sheets within existing ones
  </Card>

  <Card title="Collaboration" icon="comments">
    Read, create, reply to, and resolve spreadsheet comments
  </Card>
</CardGroup>

## Available Tools (10)

### Spreadsheet Operations

<AccordionGroup>
  <Accordion title="list_spreadsheets">
    List spreadsheets from Google Drive that the user has access to. Returns spreadsheet names, IDs, modified times, and Drive web links. Defaults to 25 spreadsheets maximum.
  </Accordion>

  <Accordion title="get_spreadsheet_info">
    Get detailed information about a specific spreadsheet including its title and list of sheets with their IDs and dimensions.
  </Accordion>

  <Accordion title="create_spreadsheet">
    Create a new Google Spreadsheet with a title and optional list of sheet names. Returns spreadsheet ID and URL.
  </Accordion>

  <Accordion title="create_sheet">
    Create a new sheet (tab) within an existing spreadsheet by specifying the sheet name.
  </Accordion>
</AccordionGroup>

<Warning>
  **High-risk tool:** `modify_sheet_values` with `clear_values: true` permanently erases data from the specified range. For automated agents, consider adding a guardrail to block or require confirmation for clear operations. See [Guardrails](/civic/concepts/guardrails).
</Warning>

### Data Operations

<AccordionGroup>
  <Accordion title="read_sheet_values">
    Read values from a specific range in a Google Sheet using A1 notation (e.g., "Sheet1!A1:D10"). Defaults to "A1:Z1000" if range not specified.
  </Accordion>

  <Accordion title="modify_sheet_values">
    Modify values in a specific range - can write, update, or clear values. Supports value input options: "RAW" (no parsing) or "USER\_ENTERED" (formulas evaluated). Can clear ranges by setting clear\_values parameter.
  </Accordion>
</AccordionGroup>

### Comment Operations

<AccordionGroup>
  <Accordion title="read_spreadsheet_comments">
    Read all comments from a Google Spreadsheet including author, creation time, and content.
  </Accordion>

  <Accordion title="create_spreadsheet_comment">
    Create a new comment on a Google Spreadsheet with specified content.
  </Accordion>

  <Accordion title="reply_to_spreadsheet_comment">
    Reply to a specific comment in a Google Spreadsheet by comment ID.
  </Accordion>

  <Accordion title="resolve_spreadsheet_comment">
    Resolve a comment in a Google Spreadsheet to mark it as complete.
  </Accordion>
</AccordionGroup>

## Use Cases

### Spreadsheet Discovery

"Show me all my Google Sheets" - List accessible spreadsheets with metadata and links.

### Spreadsheet Details

"Get information about the Budget 2024 spreadsheet" - View sheet names and structure.

### Reading Data

"Read values from cells A1 to D10 in the Sales sheet" - Extract data from specific ranges.

### Reading Large Ranges

"Read all data from the Data sheet" - Uses default range A1:Z1000 for comprehensive data retrieval.

### Writing Data

"Write 'Q1 Sales' to cell A1 and '50000' to cell B1" - Update cell values in specified ranges.

### Formula Entry

"Add formula '=SUM(A1:A10)' to cell A11 with USER\_ENTERED mode" - Insert formulas that evaluate automatically.

### Clearing Data

"Clear values in range A1:D10" - Remove data from specified cells using clear\_values parameter.

### Spreadsheet Creation

"Create a new spreadsheet called 'Monthly Budget' with sheets for each month" - Generate new spreadsheets with multiple sheets.

### Adding Sheets

"Add a new sheet called 'Q4 Data' to the existing spreadsheet" - Expand spreadsheets with additional tabs.

### Reading Comments

"Show me all comments in the Project Tracker spreadsheet" - View collaboration feedback.

### Adding Comments

"Add a comment saying 'Please verify these numbers'" - Provide feedback on spreadsheet data.

### Comment Threads

"Reply to comment ABC123 with 'Verified and approved'" - Participate in spreadsheet discussions.

### Resolving Comments

"Mark comment XYZ789 as resolved" - Complete feedback loops.

<Note>
  **Range Notation:** Uses A1 notation for specifying cell ranges. Format: "Sheet1!A1:D10" (with sheet name) or "A1:D10" (default sheet). Default range is "A1:Z1000" if not specified.

  **Value Input Options:**

  * "RAW": Values stored as-is without parsing
  * "USER\_ENTERED": Formulas and formatted values are parsed as if entered by user (default)

  **List Limits:** list\_spreadsheets returns up to 25 spreadsheets by default, configurable via max\_results parameter.

  **Multi-Sheet Creation:** create\_spreadsheet can initialize multiple sheets at once by providing a list of sheet names.
</Note>

***

## Guardrails

In addition to the [14 universal guardrails](/civic/concepts/guardrails), this server has **42 server-specific guardrails** across 7 operations.

| Guardrail                                      | Operation                      | Timing   | Description                                                             |
| ---------------------------------------------- | ------------------------------ | -------- | ----------------------------------------------------------------------- |
| Block Sheet Creation in Protected Spreadsheets | `create_sheet`                 | Request  | Prevents adding new sheets to specific protected spreadsheets           |
| Limit Sheet Creation Count                     | `create_spreadsheet`           | Request  | Caps the number of sheets that can be created in a new spreadsheet      |
| Block Comments on Protected Spreadsheets       | `create_spreadsheet_comment`   | Request  | Prevents creating comments on specific protected spreadsheets           |
| Block Comments with URLs                       | `create_spreadsheet_comment`   | Request  | Prevents creating comments containing URLs or external links            |
| Limit Comment Length                           | `create_spreadsheet_comment`   | Request  | Caps the maximum length of comment content                              |
| Block Specific Spreadsheet IDs                 | `get_spreadsheet_info`         | Request  | Denies access to blocklisted spreadsheets by their IDs                  |
| Hide Sensitive Sheet Names                     | `get_spreadsheet_info`         | Response | Redacts sheet names containing sensitive keywords                       |
| Filter Sensitive Spreadsheet Names             | `list_spreadsheets`            | Response | Hides spreadsheets containing sensitive keywords in their names         |
| Hide Old Spreadsheets                          | `list_spreadsheets`            | Response | Filters out spreadsheets older than a specified date                    |
| Limit Spreadsheet Results                      | `list_spreadsheets`            | Request  | Caps the maximum number of spreadsheets returned                        |
| Restrict to Allowed Spreadsheets               | `list_spreadsheets`            | Request  | Only allows listing/accessing spreadsheets in a whitelist               |
| Block Formula Injection                        | `modify_sheet_values`          | Request  | Prevents writing formulas or scripts that could be malicious            |
| Block Modification of Protected Spreadsheets   | `modify_sheet_values`          | Request  | Prevents any modification to specific critical spreadsheets             |
| Block Protected Range Modification             | `modify_sheet_values`          | Request  | Prevents editing specific protected ranges                              |
| Limit Write Data Size                          | `modify_sheet_values`          | Request  | Caps the amount of data that can be written in a single request         |
| Prevent Data Overwrite                         | `modify_sheet_values`          | Request  | Only allows writing to empty cells, prevents overwriting existing data  |
| Prevent Large Range Clear                      | `modify_sheet_values`          | Request  | Blocks clearing ranges exceeding a maximum cell count                   |
| Restrict Input Option to RAW                   | `modify_sheet_values`          | Request  | Forces value\_input\_option to RAW to prevent formula evaluation        |
| Block Content Access for Dangerous Formats     | `read_sheet_values`            | Response | Blocks accessing content of files with dangerous formats                |
| Block Full Spreadsheet Read                    | `read_sheet_values`            | Request  | Prevents reading entire spreadsheet with unbounded ranges               |
| Block Reading Specific Sheet Names             | `read_sheet_values`            | Request  | Prevents reading from sheets with certain names                         |
| Filter Formula Values                          | `read_sheet_values`            | Response | Hides formulas to prevent revealing business logic                      |
| Hide Cells Matching Patterns                   | `read_sheet_values`            | Response | Redacts cells containing values matching specified regex patterns       |
| Redact PII in Cells                            | `read_sheet_values`            | Response | Masks PII like SSNs, emails, and phone numbers in cells                 |
| Restrict Range Size                            | `read_sheet_values`            | Request  | Limits the maximum number of cells that can be read in a single request |
| Block Comments from Protected Spreadsheets     | `read_spreadsheet_comments`    | Request  | Prevents reading comments from specific sensitive spreadsheets          |
| Filter Comments by Allowed Authors             | `read_spreadsheet_comments`    | Response | Redacts comments from authors not in allowed list                       |
| Filter Sensitive Comments                      | `read_spreadsheet_comments`    | Response | Redacts comments containing sensitive keywords                          |
| Hide Commenter Identity                        | `read_spreadsheet_comments`    | Response | Removes email addresses and names from comment data                     |
| Limit to Recent Comments                       | `read_spreadsheet_comments`    | Response | Only shows comments from within a specified time period                 |
| Block Replies to Old Comments                  | `reply_to_spreadsheet_comment` | Request  | Prevents replying to comments older than a specified time period        |
| Limit Reply Length                             | `reply_to_spreadsheet_comment` | Request  | Caps the maximum length of reply content                                |
| Author Only Comment Resolution                 | `resolve_spreadsheet_comment`  | Request  | Only allows the original comment author to resolve their comments       |

<Tip>
  Configure guardrails via the Civic UI or ask the Configurator Agent: "Add guardrails to my Google Sheets server."
</Tip>
