Skip to content

code_toc

code_toc returns a structured table of contents for the project: files alongside the symbols they contain, with line numbers. Think of it as the index at the back of a book.

code_toc()
code_toc(path="src/services")
code_toc(path="src", offset=30, limit=30)
ParameterTypeDefaultDescription
pathstringFilter to a specific directory or path pattern
offsetnumber0Skip first N entries (pagination)
limitnumber30Max entries to return
compactbooleantrueShow only file names with counts (set false for all symbols)
src/services/order.ts (4 functions)
OrderService.checkout :42
OrderService.cancel :88
OrderService.findById :114
OrderService.list :139
src/services/payment.ts (2 functions)
PaymentService.charge :18
PaymentService.refund :67
  • Navigate an unfamiliar codebase to find where logic lives
  • Find the exact line number of a function before calling code_get
  • Get a compact overview of a directory’s symbols