Read Google Doc
get_documentRead a Google Doc to retrieve its title, URL, text content, and structure outline with exact indexes. Use before index-based edits to avoid errors.
Instructions
Read a Google Doc: returns its title, URL, plain-text content and (by default) a structure outline listing every top-level paragraph and table with exact startIndex/endIndex, heading style and alignment. Also returns bodyEndIndex (valid insertion indexes are 1..bodyEndIndex-1). Use this before index-based edits such as insert_text, delete_text or format_text. Long documents are truncated to maxTextLength characters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | The Google Docs document ID (the part between /d/ and /edit in the document URL). A full Google Docs URL is also accepted. | |
| maxTextLength | No | Maximum number of characters of document text to return. | |
| includeStructure | No | Include the paragraph/table outline with indexes (needed for index-based edits). |