R
Tool calling
Let the LLM call a deterministic TOC tool instead of guessing structure.
LLM tool layer
Before sending documents to a large model, normalize TOC structure, verify hierarchy, and fix rule-level issues so downstream reasoning receives clean structure.
TOC structure follows explicit human language rules: continuous numbering, consistent hierarchy, matching indentation, and no invented headings. SUPTOC separates those rules into a verifiable tool layer.
{
"tool": "SUPTOC.validate_and_correct",
"elapsed_ms": 11,
"input_bound": true,
"style": "numeric numbered TOC",
"issues": ["missing chapter 2"],
"corrected": "Chapter 2 API Access"
}Let the LLM call a deterministic TOC tool instead of guessing structure.
Validate hierarchy before long documents enter RAG.
Fix numbering and hierarchy issues in model-generated TOCs.
Provide reliable heading paths for chunks, summaries, and retrieval.
Millisecond processing suits synchronous tool calls.
Return rules, issue types, and correction reasons.