Read a linux.do topic
get_topicReads a forum topic and its posts as text, paging through long threads by post number and returning headers, post windows, images, and truncation flags for discussion review.
Instructions
Read one topic with its posts as text.
Returns the header plus one window of posts. To read the rest of a long topic, pass next_post_number back as post_number; it is null once the window reaches the last post. Windows overlap rather than skip, so a caller may see a few posts twice.
post_ids and post_number are two ways to name the same window: ids are exact, a post number gets whichever window contains it. For a single known post, prefer get_post: it makes one request instead of a header plus a window.
Each post carries images in document order, and truncated when its body
hit max_post_chars.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"topic_id": "<topic_id>"
},
"name": "get_topic"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_ids | No | Specific post ids to read instead of the default first window. Take them from a previous get_topic stream or a post URL. | |
| topic_id | Yes | Topic id from browse_topics. | |
| include_raw | No | Return Discourse's own Markdown instead of cooked HTML reduced to text. About half the characters and keeps tables and link targets; turn it off only if you want the simplified text. | |
| post_number | No | Read the window containing this post number (楼号). Pass the previous read's next_post_number to walk a long topic forward. | |
| max_post_chars | No | Cut each body at this many characters and set that post's truncated when it was cut. The cap is per post, not per window. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Topic id. | |
| slug | Yes | URL slug. Forum titles are almost always Chinese, so Discourse falls back to the literal 'topic'; build links from id instead of slug. | |
| tags | No | Tag names, in upstream order; pass one to browse_topics(tag=...) or sort=filter. Empty means the topic carries no tags. | |
| posts | Yes | Embedded posts, in topic order. | |
| title | Yes | Topic title. | |
| chunk_size | Yes | How many posts this response embedded. | |
| created_at | Yes | ISO 8601 creation timestamp. | |
| category_id | No | Discourse category id. | |
| posts_count | Yes | Total posts in the topic. | |
| stream_length | Yes | Post ids in the topic's full stream, including slots for deleted posts; it can differ from posts_count by a few. Compare with highest_post_number, not this, to tell whether more calls remain. | |
| next_post_number | No | Pass back as `post_number` to read the window after these posts; null when this window reaches the last post. For a `post_ids` read it is derived from the highest requested post number, so it continues by position, not by id. | |
| highest_post_number | No | Highest post number (楼号) in the topic. Deleted posts leave holes, so this exceeds the visible post count; it is the real end of the walk, while next_post_number is the cursor short of it. |