@cyanheads/hn-mcp-server 0.5.18 → 0.5.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -3
- package/CLAUDE.md +5 -3
- package/README.md +13 -7
- package/changelog/0.5.x/0.5.19.md +19 -0
- package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts +2 -1
- package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-stories.tool.js +33 -11
- package/dist/mcp-server/tools/definitions/get-stories.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts +30 -2
- package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-thread.tool.js +510 -173
- package/dist/mcp-server/tools/definitions/get-thread.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-user.tool.d.ts +4 -1
- package/dist/mcp-server/tools/definitions/get-user.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-user.tool.js +54 -21
- package/dist/mcp-server/tools/definitions/get-user.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-content.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/search-content.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-content.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/search-content.tool.js.map +1 -1
- package/dist/services/hn/hn-service.d.ts +60 -12
- package/dist/services/hn/hn-service.d.ts.map +1 -1
- package/dist/services/hn/hn-service.js +87 -25
- package/dist/services/hn/hn-service.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** hn-mcp-server
|
|
4
|
-
**Version:** 0.5.
|
|
4
|
+
**Version:** 0.5.19
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` 2.0.0
|
|
@@ -48,7 +48,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
48
48
|
|
|
49
49
|
```ts
|
|
50
50
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
51
|
-
import { getHnService,
|
|
51
|
+
import { getHnService, settlePage, normalizeUrl, stripHtml } from '@/services/hn/hn-service.js';
|
|
52
52
|
|
|
53
53
|
export const getStories = tool('hn_get_stories', {
|
|
54
54
|
description: 'Fetch stories from an HN feed (top, new, best, ask, show, jobs).',
|
|
@@ -72,7 +72,9 @@ export const getStories = tool('hn_get_stories', {
|
|
|
72
72
|
const hn = getHnService();
|
|
73
73
|
const feedIds = await hn.fetchFeed(input.feed, ctx);
|
|
74
74
|
const sliced = feedIds.slice(input.offset, input.offset + input.count);
|
|
75
|
-
|
|
75
|
+
// Live items plus the IDs whose fetch failed; throws when every item failed.
|
|
76
|
+
const { items, failedIds } = settlePage(await hn.fetchItems(sliced, ctx));
|
|
77
|
+
if (failedIds.length > 0) ctx.enrich({ failedIds });
|
|
76
78
|
ctx.log.info('Fetched stories', { feed: input.feed, count: items.length });
|
|
77
79
|
return { stories: items.map(/* ... */), feed: input.feed, total: feedIds.length };
|
|
78
80
|
},
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** hn-mcp-server
|
|
4
|
-
**Version:** 0.5.
|
|
4
|
+
**Version:** 0.5.19
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` 2.0.0
|
|
@@ -48,7 +48,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
48
48
|
|
|
49
49
|
```ts
|
|
50
50
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
51
|
-
import { getHnService,
|
|
51
|
+
import { getHnService, settlePage, normalizeUrl, stripHtml } from '@/services/hn/hn-service.js';
|
|
52
52
|
|
|
53
53
|
export const getStories = tool('hn_get_stories', {
|
|
54
54
|
description: 'Fetch stories from an HN feed (top, new, best, ask, show, jobs).',
|
|
@@ -72,7 +72,9 @@ export const getStories = tool('hn_get_stories', {
|
|
|
72
72
|
const hn = getHnService();
|
|
73
73
|
const feedIds = await hn.fetchFeed(input.feed, ctx);
|
|
74
74
|
const sliced = feedIds.slice(input.offset, input.offset + input.count);
|
|
75
|
-
|
|
75
|
+
// Live items plus the IDs whose fetch failed; throws when every item failed.
|
|
76
|
+
const { items, failedIds } = settlePage(await hn.fetchItems(sliced, ctx));
|
|
77
|
+
if (failedIds.length > 0) ctx.enrich({ failedIds });
|
|
76
78
|
ctx.log.info('Fetched stories', { feed: input.feed, count: items.length });
|
|
77
79
|
return { stories: items.map(/* ... */), feed: input.feed, total: feedIds.length };
|
|
78
80
|
},
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/hn-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/hn-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -36,7 +36,7 @@ Feeds, threads, and profiles from the Hacker News Firebase API and Algolia Searc
|
|
|
36
36
|
| Tool | Description |
|
|
37
37
|
|:---|:---|
|
|
38
38
|
| `hn_get_stories` | Fetch stories from an HN feed (top, new, best, ask, show, jobs), with title, URL, score, author, and comment count |
|
|
39
|
-
| `hn_get_thread` | Get an item and its comment tree as a threaded discussion, with depth and comment-count controls |
|
|
39
|
+
| `hn_get_thread` | Get an item and its comment tree as a threaded discussion, with depth and comment-count controls and a cursor to page through long threads |
|
|
40
40
|
| `hn_get_user` | Fetch a user profile with karma, about, and optionally a page of resolved submissions |
|
|
41
41
|
| `hn_search_content` | Search stories, comments, polls, and jobs via Algolia by keyword, by filters alone, or both — type, author, parent story, date range, and minimum points |
|
|
42
42
|
|
|
@@ -47,15 +47,19 @@ Feeds, threads, and profiles from the Hacker News Firebase API and Algolia Searc
|
|
|
47
47
|
- Six feed types: `top`, `new`, `best`, `ask`, `show`, `jobs`; `count` (1–100, default 30) and `offset` for pagination
|
|
48
48
|
- Returns id, type, title, url, domain, score, author, timestamp, comment count, and body text — each field omitted (not null) when HN doesn't provide it
|
|
49
49
|
- Enrichment reports `total`, `offset`, and `hasMore`; while more stories remain, `truncated` is set and `notice` names the next `offset`, and a `notice` explains empty pages (empty feed, offset past end, or every item on the page deleted/flagged). The last page carries no truncation
|
|
50
|
+
- Items whose fetch failed after retries are listed in `failedIds` with a `notice` naming the retry; a page where every item failed returns the classified upstream error instead of an empty list
|
|
50
51
|
|
|
51
52
|
---
|
|
52
53
|
|
|
53
54
|
### `hn_get_thread` <sub>tool</sub>
|
|
54
55
|
|
|
55
|
-
- `itemId` plus `depth` (0–10, default 3; 0 returns the item with no comments) and `maxComments` (1–200, default 50) capping
|
|
56
|
+
- `itemId` plus `depth` (0–10, default 3; 0 returns the item with no comments) and `maxComments` (1–200, default 50) capping one response across all levels, alongside a fixed 64,000-byte text budget that cuts only between comments
|
|
56
57
|
- Breadth-first traversal ranked like HN — top-ranked top-level comments resolve first, replies fill in only after the level above is exhausted
|
|
58
|
+
- Resumable: a response stopped by `maxComments`, the byte budget, or an upstream rate limit returns `nextCursor`; passing it back as `cursor` with the same `itemId` continues at the next unseen comment. The cursor carries the unvisited comments themselves, so re-ranked replies cannot shift it, and the server keeps no session state. A cursor passed with a different `itemId` fails with `invalid_cursor`
|
|
59
|
+
- The root carries its relationships and state: `parent` for a comment, `poll` for a poll option, `parts` and resolved `options` (text and votes, at every depth) for a poll, and `deleted`/`dead` markers. The `content[]` heading names the type — a title, `Comment by <author>`, `Poll option by <author> on poll <id>` — and marks a deleted or dead root
|
|
57
60
|
- Flat comment list carries `depth`/`parentId` for tree reconstruction, plus `childCount` and an `isOp` flag when the comment author matches the root item's author
|
|
58
|
-
- `
|
|
61
|
+
- `truncated` and `truncationReason` (`count`, `size`, `rate_limited`, or `depth` when replies lie below the depth limit) are set only while comments remain unread — never on a terminal page, including a thread that loads in full at exactly the cap. `notice` reports deleted/dead comments omitted during traversal and the next step: the cursor, or a larger `depth` or a comment id as `itemId`
|
|
62
|
+
- Comments and poll options whose fetch failed after retries are listed in `failedIds`, and `notice` names them with the retry; failed comments ride in `nextCursor`, so paging on retries them rather than skipping them. The root item is still returned, and a failure is never passed off as a `maxComments`/`depth` limit
|
|
59
63
|
|
|
60
64
|
---
|
|
61
65
|
|
|
@@ -63,7 +67,9 @@ Feeds, threads, and profiles from the Hacker News Firebase API and Algolia Searc
|
|
|
63
67
|
|
|
64
68
|
- `username` is case-sensitive and trimmed; `includeSubmissions` (default false) resolves recent submissions, with `submissionCount` (1–50, default 10) and `submissionOffset` paging through a long history
|
|
65
69
|
- Profile includes karma, creation date, and about text (HTML stripped); submissions filter out dead/deleted items
|
|
70
|
+
- A comment submission carries its `parent` and a poll-option submission its `poll`, so either links back to what it answered
|
|
66
71
|
- Enrichment echoes `submissionOffset` and the offset to send next, or a notice when the requested offset is past the end of the history
|
|
72
|
+
- Submissions whose fetch failed after retries are listed in `failedIds` with a `notice` naming the retry; a window where every submission failed returns the classified upstream error
|
|
67
73
|
|
|
68
74
|
---
|
|
69
75
|
|
|
@@ -91,9 +97,9 @@ HN-specific:
|
|
|
91
97
|
|
|
92
98
|
Agent-friendly output:
|
|
93
99
|
|
|
94
|
-
- Graceful partial failure —
|
|
95
|
-
- Discriminated output contracts — typed error reasons (`item_not_found`, `upstream_rate_limited`, `upstream_html`, …) with per-reason recovery text, and a `depth`/`parentId` pair on every comment so callers reconstruct the tree without guessing nesting
|
|
96
|
-
- Pagination provenance — every paged
|
|
100
|
+
- Graceful partial failure — an item whose fetch fails after retries is reported by ID in `failedIds`, apart from deleted, dead, or nonexistent items, rather than silently shrinking the result; `hn_get_thread` also counts the deleted and dead comments it drops, and a rate-limited item stops the batch instead of sending every remaining item through its own retry ladder
|
|
101
|
+
- Discriminated output contracts — typed error reasons (`item_not_found`, `upstream_rate_limited`, `upstream_html`, …) with per-reason recovery text (a rate limit passes on the upstream's `Retry-After` as `retryAfter`), and a `depth`/`parentId` pair on every comment so callers reconstruct the tree without guessing nesting
|
|
102
|
+
- Pagination provenance — every paged listing echoes the offset it used (`offset`, `submissionOffset`, `page`) plus the exact next-offset value in `notice`, and `hn_get_thread` returns a self-contained `nextCursor`, so an agent can resume without recomputing state
|
|
97
103
|
- Response shaping — HTML stripping, URL normalization, and domain extraction remove upstream markup noise; `hn_search_content`'s `view: "compact"` drops the two body-text fields that otherwise duplicate a hit's full text
|
|
98
104
|
|
|
99
105
|
## Getting started
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "hn_get_thread gains a resumable cursor, root relationships, and poll options; hn_get_stories/hn_get_thread/hn_get_user report failed item fetches instead of dropping them, and a 429's Retry-After now reaches the recovery hint."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.5.19 — 2026-09-23
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`hn_get_thread.cursor` / `nextCursor`** resume a traversal cut by `maxComments`, a new 64,000-byte response budget, a 1,000-item ceiling on what one call examines, or a rate limit, without skipping or repeating comments. `truncationReason` (`count`, `size`, `rate_limited`, `depth`) replaces the old raise-`maxComments`-or-`depth` guidance, and an `invalid_cursor` reason fires when a cursor is passed with a different `itemId`. ([#20](https://github.com/cyanheads/hn-mcp-server/issues/20))
|
|
12
|
+
- **`hn_get_thread`'s root** carries `parent` (comment roots), `poll` (poll-option roots), `parts` and resolved `options` (poll roots, resolved at every `depth` including `0`), and `deleted`/`dead` markers; the `content[]` heading is type-aware. `hn_get_user` submissions carry the same `parent`/`poll` links. ([#19](https://github.com/cyanheads/hn-mcp-server/issues/19))
|
|
13
|
+
- **`failedIds`** on `hn_get_stories`, `hn_get_thread`, and `hn_get_user` names items whose fetch failed after retries, apart from deleted, dead, or missing ones, with a retry notice. An `hn_get_stories` or `hn_get_user` page where every item failed now throws the classified upstream error instead of returning empty; `hn_get_thread` still returns its root. A rate-limited item stops the batch rather than sending every remaining item through its own retry ladder. ([#18](https://github.com/cyanheads/hn-mcp-server/issues/18))
|
|
14
|
+
- **A 429's `Retry-After` header** passes through unchanged as `data.retryAfter` and the recovery hint, naming the exact wait instead of a generic "several seconds". ([#26](https://github.com/cyanheads/hn-mcp-server/issues/26))
|
|
15
|
+
|
|
16
|
+
## Fixed
|
|
17
|
+
|
|
18
|
+
- **`hn_search_content.dateRange.end`** rounds a fractional second up instead of down, so an item created in that same whole second is no longer excluded.
|
|
19
|
+
- **`hn_search_content`'s `invalid_date_range` check** compares `start` and `end` as exact instants instead of truncated seconds, so two bounds within the same second are no longer rejected as out of order.
|
|
@@ -39,7 +39,7 @@ export declare const getStories: import("@cyanheads/mcp-ts-core").ToolDefinition
|
|
|
39
39
|
readonly reason: "upstream_rate_limited";
|
|
40
40
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
41
41
|
readonly when: "The HN API answered with HTTP 429.";
|
|
42
|
-
readonly recovery: "Wait several seconds
|
|
42
|
+
readonly recovery: "Wait the interval in retryAfter when the error carries one, otherwise several seconds, then retry and call this tool less often.";
|
|
43
43
|
readonly retryable: true;
|
|
44
44
|
readonly thrownBy: "service";
|
|
45
45
|
}, {
|
|
@@ -70,6 +70,7 @@ export declare const getStories: import("@cyanheads/mcp-ts-core").ToolDefinition
|
|
|
70
70
|
readonly truncated: z.ZodOptional<z.ZodBoolean>;
|
|
71
71
|
readonly shown: z.ZodOptional<z.ZodNumber>;
|
|
72
72
|
readonly cap: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
readonly failedIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
73
74
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
74
75
|
}>;
|
|
75
76
|
//# sourceMappingURL=get-stories.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stories.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAYjE,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"get-stories.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAYjE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8PrB,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
import { extractDomain,
|
|
7
|
+
import { extractDomain, getHnService, normalizeUrl, settlePage, stripHtml, } from '../../../services/hn/hn-service.js';
|
|
8
8
|
/** Largest page `count` accepts, mirrored in the input schema. */
|
|
9
9
|
const MAX_COUNT = 100;
|
|
10
10
|
export const getStories = tool('hn_get_stories', {
|
|
@@ -22,7 +22,7 @@ export const getStories = tool('hn_get_stories', {
|
|
|
22
22
|
reason: 'upstream_rate_limited',
|
|
23
23
|
code: JsonRpcErrorCode.RateLimited,
|
|
24
24
|
when: 'The HN API answered with HTTP 429.',
|
|
25
|
-
recovery: 'Wait several seconds
|
|
25
|
+
recovery: 'Wait the interval in retryAfter when the error carries one, otherwise several seconds, then retry and call this tool less often.',
|
|
26
26
|
retryable: true,
|
|
27
27
|
thrownBy: 'service',
|
|
28
28
|
},
|
|
@@ -121,17 +121,23 @@ export const getStories = tool('hn_get_stories', {
|
|
|
121
121
|
.describe('True when more stories remain beyond this page (hasMore). Absent on the last page of the feed.'),
|
|
122
122
|
shown: z.number().optional().describe('Number of stories returned on this page.'),
|
|
123
123
|
cap: z.number().optional().describe('The count cap that was applied.'),
|
|
124
|
+
failedIds: z
|
|
125
|
+
.array(z.number())
|
|
126
|
+
.optional()
|
|
127
|
+
.describe('IDs on this page whose fetch failed after retries. They are not deleted or missing and may load on a later call: retry the page with the same offset, or pass an ID to hn_get_thread to fetch that story alone. Absent when every item on the page loaded.'),
|
|
124
128
|
notice: z
|
|
125
129
|
.string()
|
|
126
130
|
.optional()
|
|
127
|
-
.describe('Agent guidance: the offset to pass for the next page while more stories remain, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged. Absent on the last page of a non-empty result.'),
|
|
131
|
+
.describe('Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged. Absent on the last page of a non-empty result with no failed IDs.'),
|
|
132
|
+
},
|
|
133
|
+
enrichmentTrailer: {
|
|
134
|
+
failedIds: { render: (ids) => `**Failed to load:** ${(ids ?? []).join(', ')}` },
|
|
128
135
|
},
|
|
129
136
|
async handler(input, ctx) {
|
|
130
137
|
const hn = getHnService();
|
|
131
138
|
const feedIds = await hn.fetchFeed(input.feed, ctx);
|
|
132
139
|
const sliced = feedIds.slice(input.offset, input.offset + input.count);
|
|
133
|
-
const
|
|
134
|
-
const items = filterLiveItems(rawItems);
|
|
140
|
+
const { items, failedIds } = settlePage(await hn.fetchItems(sliced, ctx));
|
|
135
141
|
const stories = items.map((item) => {
|
|
136
142
|
const url = normalizeUrl(item.url);
|
|
137
143
|
const domain = extractDomain(url);
|
|
@@ -148,21 +154,34 @@ export const getStories = tool('hn_get_stories', {
|
|
|
148
154
|
...(item.text && { text: stripHtml(item.text) }),
|
|
149
155
|
};
|
|
150
156
|
});
|
|
151
|
-
ctx.log.info('Fetched stories', {
|
|
157
|
+
ctx.log.info('Fetched stories', {
|
|
158
|
+
feed: input.feed,
|
|
159
|
+
count: stories.length,
|
|
160
|
+
failed: failedIds.length,
|
|
161
|
+
});
|
|
152
162
|
const total = feedIds.length;
|
|
153
163
|
const nextOffset = input.offset + input.count;
|
|
154
164
|
const hasMore = nextOffset < total;
|
|
155
|
-
ctx.enrich({
|
|
165
|
+
ctx.enrich({
|
|
166
|
+
total,
|
|
167
|
+
offset: input.offset,
|
|
168
|
+
hasMore,
|
|
169
|
+
...(failedIds.length > 0 && { failedIds }),
|
|
170
|
+
});
|
|
156
171
|
const deadPageMessage = `No live stories on this page of the ${input.feed} feed (offset:${input.offset}, total:${total}). Items may have been deleted or flagged.`;
|
|
172
|
+
const failureMessage = failedIds.length > 0
|
|
173
|
+
? `Could not fetch ${failedIds.length} of ${sliced.length} items on this page (id${failedIds.length === 1 ? '' : 's'} ${failedIds.join(', ')}). Retry with offset: ${input.offset}, or pass an id as itemId to hn_get_thread to fetch that story alone.`
|
|
174
|
+
: undefined;
|
|
157
175
|
if (hasMore) {
|
|
158
176
|
const raiseCount = input.count < MAX_COUNT ? `, or raise count (max ${MAX_COUNT})` : '';
|
|
159
177
|
const nextPage = `Pass offset: ${nextOffset} for the next page${raiseCount}.`;
|
|
178
|
+
const pageStatus = stories.length === 0 && !failureMessage
|
|
179
|
+
? deadPageMessage
|
|
180
|
+
: `Showing items ${input.offset + 1}–${nextOffset} of ${total} in the ${input.feed} feed.`;
|
|
160
181
|
ctx.enrich.truncated({
|
|
161
182
|
shown: stories.length,
|
|
162
183
|
cap: input.count,
|
|
163
|
-
guidance:
|
|
164
|
-
? `${deadPageMessage} ${nextPage}`
|
|
165
|
-
: `Showing items ${input.offset + 1}–${nextOffset} of ${total} in the ${input.feed} feed. ${nextPage}`,
|
|
184
|
+
guidance: [pageStatus, failureMessage, nextPage].filter(Boolean).join(' '),
|
|
166
185
|
});
|
|
167
186
|
}
|
|
168
187
|
else if (stories.length === 0) {
|
|
@@ -173,9 +192,12 @@ export const getStories = tool('hn_get_stories', {
|
|
|
173
192
|
ctx.enrich.notice(`Offset ${input.offset} is past the end of the ${input.feed} feed (${total} item${total === 1 ? '' : 's'}). Reset offset below ${total}.`);
|
|
174
193
|
}
|
|
175
194
|
else {
|
|
176
|
-
ctx.enrich.notice(deadPageMessage);
|
|
195
|
+
ctx.enrich.notice(failureMessage ?? deadPageMessage);
|
|
177
196
|
}
|
|
178
197
|
}
|
|
198
|
+
else if (failureMessage) {
|
|
199
|
+
ctx.enrich.notice(failureMessage);
|
|
200
|
+
}
|
|
179
201
|
return {
|
|
180
202
|
stories,
|
|
181
203
|
feed: input.feed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stories.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"get-stories.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE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overview Fetch an HN item and its comment tree via ranked BFS traversal,
|
|
3
|
+
* resumable through a cursor that carries the unvisited frontier.
|
|
3
4
|
* @module mcp-server/tools/definitions/get-thread.tool
|
|
4
5
|
*/
|
|
5
6
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -8,6 +9,7 @@ export declare const getThread: import("@cyanheads/mcp-ts-core").ToolDefinition<
|
|
|
8
9
|
itemId: z.ZodNumber;
|
|
9
10
|
depth: z.ZodDefault<z.ZodNumber>;
|
|
10
11
|
maxComments: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
11
13
|
}, z.core.$strip>, z.ZodObject<{
|
|
12
14
|
item: z.ZodObject<{
|
|
13
15
|
id: z.ZodNumber;
|
|
@@ -19,6 +21,18 @@ export declare const getThread: import("@cyanheads/mcp-ts-core").ToolDefinition<
|
|
|
19
21
|
text: z.ZodOptional<z.ZodString>;
|
|
20
22
|
score: z.ZodOptional<z.ZodNumber>;
|
|
21
23
|
descendants: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
parent: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
poll: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
parts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
27
|
+
deleted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
28
|
+
dead: z.ZodOptional<z.ZodLiteral<true>>;
|
|
29
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodNumber;
|
|
31
|
+
text: z.ZodOptional<z.ZodString>;
|
|
32
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
deleted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
34
|
+
dead: z.ZodOptional<z.ZodLiteral<true>>;
|
|
35
|
+
}, z.core.$strip>>>;
|
|
22
36
|
}, z.core.$strip>;
|
|
23
37
|
comments: z.ZodArray<z.ZodObject<{
|
|
24
38
|
id: z.ZodNumber;
|
|
@@ -36,6 +50,12 @@ export declare const getThread: import("@cyanheads/mcp-ts-core").ToolDefinition<
|
|
|
36
50
|
readonly when: "HN reports no item exists for the given itemId.";
|
|
37
51
|
readonly recovery: "Verify the itemId via hn_search_content or a feed listing from hn_get_stories.";
|
|
38
52
|
readonly severity: "notice";
|
|
53
|
+
}, {
|
|
54
|
+
readonly reason: "invalid_cursor";
|
|
55
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
56
|
+
readonly when: "The cursor was issued for a different itemId than the one passed with it.";
|
|
57
|
+
readonly recovery: "Pass the cursor with the same itemId it was returned for, or omit cursor to start this item from the top.";
|
|
58
|
+
readonly severity: "notice";
|
|
39
59
|
}, {
|
|
40
60
|
readonly reason: "upstream_rejected";
|
|
41
61
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
@@ -46,7 +66,7 @@ export declare const getThread: import("@cyanheads/mcp-ts-core").ToolDefinition<
|
|
|
46
66
|
readonly reason: "upstream_rate_limited";
|
|
47
67
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
48
68
|
readonly when: "The HN API answered with HTTP 429.";
|
|
49
|
-
readonly recovery: "Wait several seconds
|
|
69
|
+
readonly recovery: "Wait the interval in retryAfter when the error carries one, otherwise several seconds, then retry and call this tool less often.";
|
|
50
70
|
readonly retryable: true;
|
|
51
71
|
readonly thrownBy: "service";
|
|
52
72
|
}, {
|
|
@@ -74,8 +94,16 @@ export declare const getThread: import("@cyanheads/mcp-ts-core").ToolDefinition<
|
|
|
74
94
|
readonly totalLoaded: z.ZodNumber;
|
|
75
95
|
readonly totalAvailable: z.ZodOptional<z.ZodNumber>;
|
|
76
96
|
readonly truncated: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
readonly truncationReason: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
count: "count";
|
|
99
|
+
depth: "depth";
|
|
100
|
+
rate_limited: "rate_limited";
|
|
101
|
+
size: "size";
|
|
102
|
+
}>>;
|
|
103
|
+
readonly nextCursor: z.ZodOptional<z.ZodString>;
|
|
77
104
|
readonly shown: z.ZodOptional<z.ZodNumber>;
|
|
78
105
|
readonly cap: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
readonly failedIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
79
107
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
80
108
|
}>;
|
|
81
109
|
//# sourceMappingURL=get-thread.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-thread.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"get-thread.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAiB,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AAkc/F,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqUpB,CAAC"}
|