drive_docs_read
Read a document's paragraphs, tables, and headers with [start,end) index ranges for precise edits, not just prose export.
Instructions
Read a document's structural elements — paragraphs, tables, section breaks and more — each with its [start,end) index range in UTF-16 code units, plus headers/footers/footnotes and the document's revision_id. This is the model channel (indices for a later edit); drive_file_read's markdown export is the prose channel and has no way back to an index. tab restricts to one tab id (from drive_docs_info); omit to read every tab. suggestions_view controls which view the indices are reported against — indices from one view only apply to an edit made under that same view. When output_file is set, writes the YAML result to that path and returns a short summary instead — recommended for a large document. Read-only — no write gate, lease or dry-run applies (unlike docs replace/append, exposed by separate gated write tools). Mirrors omni-dev drive docs read. Output is YAML.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Restrict output to one tab id (see `drive_docs_info`'s `tabs[].tab_id`). Omit to read every tab. | |
| account | No | Selects a named Drive account instead of the ambient `--account`/`OMNI_DEV_DRIVE_ACCOUNT` resolution — e.g. `work`. Omit to use the resolved default account (or the legacy single-account credentials, if no named accounts are configured). Call `drive_account_list` to discover configured names. | |
| document_id | Yes | Document id (the `/d/<ID>/` segment of a Docs URL, e.g. `1a2B3c4D5e6F7g8H9iJ0kLmNoPqRsTuVwXyZ`). Required. | |
| output_file | No | When set, writes the result (YAML) to this path and returns a short summary instead of the inline body — recommended for a large document that would exceed the response size limit. | |
| suggestions_view | No | Which suggestion view the text and `[start,end)` indices are reported against: `default` (whatever the caller's access implies — inline for an editor, accepted for a reader; the default when omitted), `inline` (suggestions shown as tracked changes), `accepted` (as if every suggestion were accepted), or `without` (as if every suggestion were rejected). Indices from one view are only meaningful for a later edit made under that same view — a different view can shift every index. |