Skip to content

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")
ParameterTypeDefaultDescription
doc_idstringrequiredDocument ID as shown in doc_list()
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 Keys
  • 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

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.