Summary
google_docs_read_document returns the entire document in one response. For large documents this produces an unbounded payload, which is awkward for callers that need to work through a document in chunks or that have response-size limits. Adding offset/limit parameters lets callers read a bounded slice.
Current behavior
ReadDocumentParams exposes only document_id and include_metadata; the tool fetches the document and returns its full content with no way to bound the size.
Proposed change
Add optional parameters to ReadDocumentParams:
offset: int = 0 — index into the document's text content to start from.
limit: int | None = None — maximum amount of content to return from offset.
The Docs API returns the full document tree in a single GET (there is no server-side pagination), so this is a tool-level slice of the extracted content. Return enough signal for the caller to page (e.g. total length / a "has more" indicator) so they can advance offset.
Deliberately not in scope: a built-in size threshold that auto-paginates. Where a caller chooses to chunk is caller-specific; the tool just exposes the parameters.
Test coverage
offset/limit slice a known document and return the expected window.
offset past the end returns an empty slice, not an error.
- Omitting both preserves today's full-document behavior (backwards compatible).
Summary
google_docs_read_documentreturns the entire document in one response. For large documents this produces an unbounded payload, which is awkward for callers that need to work through a document in chunks or that have response-size limits. Addingoffset/limitparameters lets callers read a bounded slice.Current behavior
ReadDocumentParamsexposes onlydocument_idandinclude_metadata; the tool fetches the document and returns its full content with no way to bound the size.Proposed change
Add optional parameters to
ReadDocumentParams:offset: int = 0— index into the document's text content to start from.limit: int | None = None— maximum amount of content to return fromoffset.The Docs API returns the full document tree in a single GET (there is no server-side pagination), so this is a tool-level slice of the extracted content. Return enough signal for the caller to page (e.g. total length / a "has more" indicator) so they can advance
offset.Deliberately not in scope: a built-in size threshold that auto-paginates. Where a caller chooses to chunk is caller-specific; the tool just exposes the parameters.
Test coverage
offset/limitslice a known document and return the expected window.offsetpast the end returns an empty slice, not an error.