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)Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | — | Filter to a specific directory or path pattern |
offset | number | 0 | Skip first N entries (pagination) |
limit | number | 30 | Max entries to return |
compact | boolean | true | Show only file names with counts (set false for all symbols) |
Output
Section titled “Output”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 :67When to use
Section titled “When to use”- 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