doc_toc
doc_toc returns the heading structure of an indexed document without loading any content. Use it after doc_index to understand a document’s layout before fetching specific sections.
doc_toc(doc_id="docs_ARCHITECTURE_md")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
doc_id | string | required | Document ID as shown in doc_list() |
Output
Section titled “Output”docs/ARCHITECTURE.md — 24 sections
1. Overview 2. System Components 2.1 API Gateway 2.2 Auth Service 2.3 Database Layer 3. Authentication 3.1 JWT Strategy 3.2 Token Refresh 4. Deployment 5. ADRs 5.1 ADR-001: PostgreSQL 5.2 ADR-012: Idempotency KeysWhen to use
Section titled “When to use”- Before
doc_get— see which section heading to fetch - Understand a long document’s structure without loading any content
- Navigate large specs, architecture docs, or CSV files efficiently
Token cost
Section titled “Token cost”doc_toc returns only headings — typically 50–200 tokens regardless of document length. Compare to reading the full file which can cost tens of thousands of tokens.