read_chunk_neighbors
Retrieve chunks immediately before and after a specified chunk index to provide surrounding context from the same document.
Instructions
Read the chunks immediately before and after a query_documents result, in the same document, for more surrounding context. Pass chunkIndex from the result plus exactly one of filePath (ingest_file) or source (ingest_data). Returns the target chunk (isTarget: true) and its neighbors, ascending by chunkIndex; an out-of-range chunkIndex returns []. Defaults: before=2, after=2 (max 50 each).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | No | Absolute path to the file (for ingest_file documents). Provide exactly one of filePath or source. Example: "/Users/user/documents/manual.pdf". | |
| source | No | Source identifier (for ingest_data documents). Provide exactly one of filePath or source. Examples: "https://example.com/page", "clipboard://2024-12-30". | |
| chunkIndex | Yes | Zero-based target chunk index (non-negative integer). | |
| before | No | Number of chunks to retrieve before the target (0–50, default 2). | |
| after | No | Number of chunks to retrieve after the target (0–50, default 2). |