Skip to content

Add offset/limit parameters to google_docs_read_document for bounded reads #149

Description

@peteski22

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgoogleProvider: googleproviderIssue or PR scoped to a specific provider

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions