redditapis-mcp 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+ - `reddit_search` and `reddit_search_comments` now describe the `t` time window
5
+ accurately. Unlike a subreddit listing, search applies `t` to the `relevance`
6
+ and `top` sorts as well, and when it is omitted Reddit defaults to `all` — so a
7
+ broad relevance query surfaces old high-upvote posts that only loosely match.
8
+ The tool description now says so, which materially changes the queries an agent
9
+ writes. No API surface change.
10
+
11
+ ## 0.1.1
12
+ - Corrected package metadata.
13
+
14
+
3
15
  ## 0.1.0
4
16
  - Initial release: 11 read tools over the redditapis.com API (subreddit listings,
5
17
  post/comment/community/user/media search, comment tree, subreddit top posts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redditapis-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Official MCP server for redditapis.com, the Reddit API (subreddit listings, post + comment + community + user + media search, comment trees, top posts, user profiles) as native tools for Claude, Cursor, and any MCP client.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,8 @@
24
24
  "scripts": {
25
25
  "start": "node src/index.js",
26
26
  "check": "node --check src/index.js && node --check src/tools.js",
27
- "test": "node test/tools.test.mjs"
27
+ "test": "node test/tools.test.mjs",
28
+ "prepublishOnly": "python3 $HOME/.claude/scripts/tenant-isolation-scan.py --tenant redditapis --npm-publish-surface ."
28
29
  },
29
30
  "dependencies": {
30
31
  "@modelcontextprotocol/sdk": "^1.0.0",
package/src/tools.js CHANGED
@@ -43,6 +43,15 @@ const TIME = {
43
43
  "Time window, only applied when sort is 'top' or 'controversial'. E.g. 'week' = top of the past week. Ignored for other sorts.",
44
44
  ),
45
45
  };
46
+ // Search honours `t` differently from a subreddit listing: it bounds the whole
47
+ // result set (including the 'relevance' and 'top' sorts), not just top/controversial.
48
+ // Omitting it makes Reddit default to 'all', which lets old high-upvote posts win a
49
+ // broad 'relevance' query, so search gets a separate, search-accurate description.
50
+ const TIME_SEARCH = {
51
+ t: z.enum(["hour", "day", "week", "month", "year", "all"]).optional().describe(
52
+ "Time window that bounds which posts the search returns, e.g. 'week' = only posts from the past week. Unlike a subreddit listing, search applies this to the 'relevance' and 'top' sorts too. When omitted, Reddit defaults to 'all', so a broad 'relevance' query surfaces old high-upvote posts that only loosely match. Pass 'week' or 'month' to keep results recent and on-topic.",
53
+ ),
54
+ };
46
55
  const NSFW = {
47
56
  nsfw: z.enum(["true", "false"]).optional().describe(
48
57
  "Set 'true' to include over-18 / NSFW results. Omit or 'false' to exclude them (default).",
@@ -82,7 +91,7 @@ export const TOOLS = [
82
91
  "Optional subreddit name (without r/) to restrict the search to one community. Omit to search all of Reddit.",
83
92
  ),
84
93
  ...SORT_SEARCH,
85
- ...TIME,
94
+ ...TIME_SEARCH,
86
95
  ...AFTER,
87
96
  ...NSFW,
88
97
  ...LIMIT,
@@ -111,7 +120,7 @@ export const TOOLS = [
111
120
  path: "/api/reddit/search/comments",
112
121
  description:
113
122
  "Search Reddit COMMENTS (not posts) by keyword across Reddit. Returns matching comments with author, body, score, subreddit, and the parent post link. Use to find first-hand opinions/answers buried in threads. Example: q='best mechanical keyboard' sort='top'.",
114
- shape: { ...QUERY, ...SORT_SEARCH, ...TIME, ...AFTER, ...NSFW, ...LIMIT },
123
+ shape: { ...QUERY, ...SORT_SEARCH, ...TIME_SEARCH, ...AFTER, ...NSFW, ...LIMIT },
115
124
  },
116
125
  {
117
126
  name: "reddit_search_media",
@@ -124,7 +133,7 @@ export const TOOLS = [
124
133
  "Media type filter. 'image', 'video', 'gif', or 'all' (default). Filters the raw Reddit results to that media kind.",
125
134
  ),
126
135
  ...SORT_SEARCH,
127
- ...TIME,
136
+ ...TIME_SEARCH,
128
137
  ...AFTER,
129
138
  ...NSFW,
130
139
  ...LIMIT,