chunk_document
Split long PDF or text documents into ordered, overlapping chunks with page hints, so each segment fits within a context window for further processing.
Instructions
Split a document's text into ordered, overlapping chunks.
Useful for long documents that do not fit one context read. For PDFs the text keeps its '--- page N ---' markers and each chunk carries a 'page_hint' (the page active at the start of the chunk); for other types 'page_hint' is null.
Args: path: File path inside the allowed root. max_chars: Maximum characters per chunk (default 4000). overlap: Characters repeated between consecutive chunks (default 200, must be smaller than max_chars).
Returns a list of {index, start_char, page_hint, text} in document order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| overlap | No | ||
| max_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |