Read document as text
read_document_textExtracts a Google Doc's paragraphs, headings, bullets, tables, and image placeholders with the exact UTF-16 indexes needed for range edits. Use it before inserting or deleting text so your indexes stay valid.
Instructions
Returns the document as compact readable blocks, per tab: each paragraph with its text, start/end indexes (UTF-16 code units — the coordinates insert_text/replace_range/delete_range/style tools take), named style (headings) and bullet flag; tables come as cells[row][column] plain text with the table's range. Inline images appear as [image:] placeholders (the id feeds replace_image). tab_id limits the output to one tab. Call this before any range edit — every insert/delete shifts later indexes, so indexes from before a mutation are stale.
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": {
"document_id": "<document_id>"
},
"name": "read_document_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab_id | No | Tab to target (from list_tabs). Omit for the first/only tab. | |
| document_id | Yes | The document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output. |