sort_range
Sort a range of cells in a Google Sheet by a specified column, choosing ascending or descending order.
Instructions
Sort data in a range by a column.
Args: spreadsheet_id: The ID of the spreadsheet. sheet_id: The numeric ID of the sheet. start_row: Starting row index (0-based). end_row: Ending row index (exclusive). start_col: Starting column index (0-based). end_col: Ending column index (exclusive). sort_column: Column index to sort by (0-based, relative to range). ascending: True for A-Z/0-9, False for Z-A/9-0.
Returns: Success message.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"spreadsheet_id": "<spreadsheet_id>",
"sheet_id": "<sheet_id>",
"start_row": "<start_row>",
"end_row": "<end_row>",
"start_col": "<start_col>",
"end_col": "<end_col>",
"sort_column": "<sort_column>"
},
"name": "sort_range"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_col | Yes | ||
| end_row | Yes | ||
| sheet_id | Yes | ||
| ascending | No | ||
| start_col | Yes | ||
| start_row | Yes | ||
| sort_column | Yes | ||
| spreadsheet_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |