sort_range
Sorts a specified Google Sheets range by one or more columns in ascending or descending order, organizing spreadsheet rows by selected column keys.
Instructions
Sort a range by one or more columns.
Args: spreadsheet_id: The ID of the spreadsheet sheet: The name of the sheet range: A1 notation range to sort (e.g. "A1:D100") sort_order: List of sort specs, each with: - "column_index": 0-based column index within the range - "order": "ASCENDING" (default) or "DESCENDING" If omitted, sorts by the first column ascending.
Returns: Result of the batchUpdate operation
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": "<sheet>",
"range": "<range>"
},
"name": "sort_range"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | ||
| sheet | Yes | ||
| sort_order | No | ||
| spreadsheet_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||