get_discussion
Reads a Hacker News comment thread in one call, returning the story and comments breadth-first with truncation details so you can survey opinions or follow arguments in depth.
Instructions
Read a Hacker News comment thread in one call.
Returns the story plus a flat list of comments ordered breadth-first:
all top-level replies, then all of their replies, and so on. HN ranks
kids by its own ordering, so breadth-first spends the comment budget
on the highest-ranked comments across the whole thread rather than
exhausting it inside one argument.
Nesting is carried by each comment's depth rather than by nested
objects, so the list can be cut at any point and stay valid.
Popular threads are wide - often over a hundred top-level comments - so max_top_level bounds how many of them are opened. That is what leaves budget for replies: without it the comment cap is spent entirely on opening statements and no reply is ever reached. Lower it to read an argument in depth, raise it to survey opinions broadly.
Big threads will not fit. When anything is omitted, truncated is true
and truncation_hint names which argument to raise and why.
comments_with_hidden_replies counts how many returned comments have
replies that were left out, and top_level_shown against
top_level_total shows how much of the first level you are seeing.
Deleted and dead comments are skipped entirely.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| story_id | Yes | ||
| max_depth | No | How deep to descend. 0 is top-level replies only, 2 is a good default for getting the sense of a thread. | |
| max_comments | No | Hard cap on total comments returned. | |
| comment_chars | No | Per-comment character cap. | |
| max_top_level | No | How many top-level comments to open. Low values leave budget for replies and give conversation; high values give a survey of opinions with few replies. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| story | Yes | ||
| comments | Yes | Flat list ordered breadth-first. Use each comment's `depth` to reconstruct nesting. | |
| returned | Yes | Comments in this response. | |
| truncated | Yes | True when comments were omitted by a depth or count cap. | |
| top_level_shown | Yes | Top-level comments included, bounded by max_top_level. | |
| top_level_total | Yes | Top-level comments the story actually has. | |
| total_in_thread | No | Comments in the whole thread, including omitted. | |
| truncation_hint | No | When truncated, names the argument to raise to see more. | |
| comments_with_hidden_replies | Yes | Returned comments that have replies not included here. |