get_table_data_tool
Retrieve table data from Google Sheets with optional column filtering, row ranges, and header inclusion. Efficiently fetches specific or complete datasets using Google Sheets API for structured data extraction.
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 metadata
Input Schema
Name | Required | Description | Default |
---|---|---|---|
column_names | No | List of column names to retrieve (optional - if not provided, gets all columns) | |
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) | |
sheet_name | Yes | The name of the sheet containing the table | |
spreadsheet_name | Yes | The name of the Google Spreadsheet | |
start_row | No | Starting row index (0-based, optional, use -1 for all rows) | |
table_name | Yes | Name of the table to read data from |
Input Schema (JSON Schema)
{
"properties": {
"column_names": {
"default": [],
"description": "List of column names to retrieve (optional - if not provided, gets all columns)",
"items": {
"type": "string"
},
"title": "Column Names",
"type": "array"
},
"end_row": {
"default": -1,
"description": "Ending row index (0-based, optional, use -1 for all rows)",
"title": "End Row",
"type": "integer"
},
"include_headers": {
"default": true,
"description": "Whether to include header row in results",
"title": "Include Headers",
"type": "boolean"
},
"max_rows": {
"default": -1,
"description": "Maximum number of rows to return (optional, use -1 for no limit)",
"title": "Max Rows",
"type": "integer"
},
"sheet_name": {
"description": "The name of the sheet containing the table",
"title": "Sheet Name",
"type": "string"
},
"spreadsheet_name": {
"description": "The name of the Google Spreadsheet",
"title": "Spreadsheet Name",
"type": "string"
},
"start_row": {
"default": -1,
"description": "Starting row index (0-based, optional, use -1 for all rows)",
"title": "Start Row",
"type": "integer"
},
"table_name": {
"description": "Name of the table to read data from",
"title": "Table Name",
"type": "string"
}
},
"required": [
"spreadsheet_name",
"sheet_name",
"table_name"
],
"title": "get_table_data_toolArguments",
"type": "object"
}