deleteRange
Deletes content from a Google Docs document within a specified character range using start and end indices, enabling precise removal of targeted text or elements.
Instructions
Deletes content within a character range [startIndex, endIndex) from a document. Use readDocument with format='index' to determine index positions — it returns a compact structural map with the exact start/end of every element. If the document changed after you read it, this call is refused unless the change landed strictly after the end of the range: explicit indices carry no anchor to re-resolve, so an edit before them silently moves the content they addressed. The refusal names what changed and where.
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": {
"documentId": "<documentId>",
"startIndex": "<startIndex>",
"endIndex": "<endIndex>"
},
"name": "deleteRange"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | No | The ID of the specific tab to delete from. If not specified, deletes from the first tab (or legacy document.body for documents without tabs). | |
| endIndex | Yes | 1-based character index within the document body. The end of the range to delete (exclusive). | |
| documentId | Yes | The document ID — the long string between /d/ and /edit in a Google Docs URL. | |
| readHandle | No | Capability returned by a previous readDocument call for this document (and tab). Required over HTTP on the 2026-07-28 runtime: it authorizes the write and pins it to the revision that read saw. Omit it on stdio to use that connection's most recent read. | |
| startIndex | Yes | 1-based character index within the document body. The start of the range to delete (inclusive). |