Skip to content

Add chunking/offset support for get_pdf_outline when response is too large #3

Description

@vlad-ds

Problem

The get_pdf_outline tool can return responses that are too large for the MCP context, especially for PDFs with extensive table of contents or deeply nested bookmark structures. This causes failures when the response exceeds context limits.

Proposed Solution

Add chunking/offset parameters to get_pdf_outline similar to how other tools handle large responses:

  • offset: Starting index for outline entries (default: 0)
  • limit: Maximum number of outline entries to return (default: all)
  • Include metadata about total entries and whether more are available

Example Usage

// Get first 50 outline entries
get_pdf_outline({ path: "document.pdf", offset: 0, limit: 50 })

// Get next 50 outline entries  
get_pdf_outline({ path: "document.pdf", offset: 50, limit: 50 })

Implementation Notes

  • Should maintain hierarchical structure even when chunking
  • Consider depth-based chunking as an alternative (e.g., only return top N levels)
  • Add response metadata indicating if more entries are available
  • Preserve parent-child relationships in chunked responses

Priority

Medium - affects usability with large PDFs that have extensive outlines

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions