expand
Walk a note's table of contents level by level (progressive disclosure). Canonical call: expand(path=<result.note_path>, toc_path=[...]) — copy path verbatim from a search result's note_path field. Returns the direct children of a TOC node: omit toc_path (or pass []) for the top-level sections, or pass a toc_path to list that section's subsections. Each child has title, level, path, and has_children. A section with subsections lists them; a section without subsections is returned in full (what note_html gives for that toc_path, plus section_html in the payload), so no second call is needed to read a leaf. This cannot be turned off, and a client that wants only structure never triggers it: has_children on each listed child says where descending would turn into reading.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | Non-negative integer (uint64) note id, copied verbatim from a search result's note_id field. Not a path, slug, or match_id. Prefer path | |
| href | No | String note href, copied verbatim from a search result's href field | |
| last | No | List only this many of the newest subsections instead of all of them. A note that gains a dated section a day has hundreds of them after a year, and reading the whole listing to reach the latest few is the cost this avoids. The summary, total_children and omitted say what was left out, so a bounded listing never reads as a complete one. Bounds that meet or overlap return everything rather than repeating a run. | |
| path | No | String note path, e.g. "concepts/maska-i-glubina.md" — copy verbatim from a search result's note_path field. The default, preferred way to reference a note | |
| first | No | List only this many of the oldest subsections. Pair it with last to get how a subject started and where it stands now, leaving out the middle; the summary marks the gap where it falls. | |
| note_id | No | Same as pid: non-negative integer (uint64) note id, copied verbatim from a search result's note_id field. Not a path, slug, or match_id. Prefer path | |
| toc_path | No | Breadcrumb path to the node to expand, e.g. ["Chapter 1"]. Omit or [] for the top level. |