Clear a range in a Google Sheet
clear_sheet_rangeEmpties cells in a Google Sheet range while keeping rows in place. A two-step confirm first echoes the filled-cell count, preventing wrong-range clearing.
Instructions
Empty a range of cells in a Google Sheet, leaving the rows themselves in place. DESTRUCTIVE: call it WITHOUT confirm first and nothing is cleared — you get back the real number of filled cells in that exact range. Show the user that number, get an unambiguous yes, then call again with confirm:true AND confirmCells set to it. The echo is not ceremony: it is what catches naming A1:Z1000 when you meant A1:Z10, which is the mistake that actually happens. There is deliberately NO default range. The clear is read back and reported as confirmed only if the range really is empty afterwards. To remove a whole tab instead, use manage_sheet_tabs.
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": {
"range": "<range>"
},
"name": "clear_sheet_range"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | the range to clear, e.g. "A2:D50" or "Sheet1!A2:D50" | |
| confirm | No | true clears the range; call without it first to get the filled-cell count | |
| sheetUrl | No | Google Sheets link, instead of spreadsheetId | |
| confirmCells | No | echo back the filled-cell count the unconfirmed call reported | |
| spreadsheetId | No | Google spreadsheet id; use this or sheetUrl |