get_table_data_tool
Retrieve table data from Google Sheets with optional column and row filtering. Specify spreadsheet, sheet, and table name to get targeted data.
Instructions
Get table data with optional column filtering using Google Sheets API.
This unified tool can retrieve all table data or specific columns based on user input.
If column_names is provided, it uses spreadsheets.values.get for efficiency.
If column_names is not provided, it uses spreadsheets.tables.get for full data.
Args:
spreadsheet_name: Name of the spreadsheet
sheet_name: Name of the sheet containing the table
table_name: Name of the table to read data from
column_names: List of column names to retrieve (optional - if not provided, gets all columns)
start_row: Starting row index (0-based, optional)
end_row: Ending row index (0-based, optional)
include_headers: Whether to include header row in results
max_rows: Maximum number of rows to return (optional)
Returns:
JSON string with table data and metadataInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spreadsheet_name | Yes | The name of the Google Spreadsheet | |
| sheet_name | Yes | The name of the sheet containing the table | |
| table_name | Yes | Name of the table to read data from | |
| column_names | No | List of column names to retrieve (optional - if not provided, gets all columns) | |
| start_row | No | Starting row index (0-based, optional, use -1 for all rows) | |
| end_row | No | Ending row index (0-based, optional, use -1 for all rows) | |
| include_headers | No | Whether to include header row in results | |
| max_rows | No | Maximum number of rows to return (optional, use -1 for no limit) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |