# SheetsGetSpreadsheetInfoTool

> **Class** in `langchain_google_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-community/sheets/get_spreadsheet_info/SheetsGetSpreadsheetInfoTool)

Tool for retrieving Google Sheets metadata and structure information.

Inherits from
[`SheetsBaseTool`][langchain_google_community.sheets.base.SheetsBaseTool].

Retrieves spreadsheet properties, sheet details, named ranges, and organizational
structure. Essential for understanding spreadsheet contents before reading data.

## Signature

```python
SheetsGetSpreadsheetInfoTool()
```

## Description

**Tool Output:**

success (bool): Whether operation succeeded.
spreadsheet_id (str): The spreadsheet ID.
title (str): Spreadsheet title.
locale (str): Spreadsheet locale (e.g., 'en_US').
time_zone (str): Spreadsheet timezone (e.g., 'America/New_York').
auto_recalc (str): Auto-recalculation setting.
default_format (dict): Default cell format.
sheets (list): List of sheet information with properties.
named_ranges (list): List of named ranges with locations.
developer_metadata (list): Developer metadata entries.
grid_data (list): Detailed cell data (when `include_grid_data=True`).

??? example "Basic Usage"

    Get basic spreadsheet information:

    ```python
    from langchain_google_community.sheets import SheetsGetSpreadsheetInfoTool

    tool = SheetsGetSpreadsheetInfoTool(api_key="your_api_key")
    result = tool.run(
        {"spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"}
    )
    print(f"Title: {result['title']}")
    print(f"Sheets: {[s['title'] for s in result['sheets']]}")
    ```

??? example "With Specific Fields"

    Get only specific fields to reduce response size:

    ```python
    result = tool.run(
        {
            "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
            "fields": "properties.title,sheets.properties",
        }
    )
    ```

??? example "Include Grid Data"

    Get detailed cell data and formatting:

    ```python
    result = tool.run(
        {
            "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
            "include_grid_data": True,
            "include_formatting": True,
            "ranges": ["Sheet1!A1:D10"],
        }
    )
    ```

## Extends

- `SheetsBaseTool`

## Properties

- `name`
- `description`
- `args_schema`

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/community/langchain_google_community/sheets/get_spreadsheet_info.py#L55)