chunk_text
Chunk markdown documents into retrieval-ready pieces with doc-type-aware splitting, auto-detecting structure or forcing a specific type, and control over target, min, and max token sizes.
Instructions
Chunk a markdown document into retrieval-ready pieces.
Picks a doc-type-aware chunker (paper / book / manual / qa / resume
/ table / default) based on document structure. Set doc_type to
force a specific chunker; default "auto" runs structural detection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | the markdown content to chunk. (To chunk a FILE, first run `parse(source)` then pass `result["markdown"]` here.) | |
| doc_type | No | "auto" | "paper" | "book" | "manual" | "qa" | "resume" | "table" | "default". Default "auto". | auto |
| max_tokens | No | hard cap before force-split (default 800). | |
| min_tokens | No | undersize threshold for trailing-chunk merge (default 50). | |
| target_tokens | No | target chunk size in whitespace-tokens (default 400). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||