redditapis-mcp 0.20.5 → 0.21.0
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 +9 -0
- package/README.md +9 -1
- package/package.json +4 -4
- package/src/annotations.js +11 -0
- package/src/input-aliases.js +66 -0
- package/src/server.js +10 -2
- package/src/tools.js +93 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.21.0 (2026-11-19)
|
|
4
|
+
|
|
5
|
+
Eight new tools for the documented REST routes (feedback a62b44d6). The live session check waits for its API route.
|
|
6
|
+
|
|
7
|
+
- `reddit_dm_threads` and `reddit_dm_messages` read the connected account's chat: conversations (paged with `limit` and `after`, with `total_threads`) and one conversation's messages (paged with `before`).
|
|
8
|
+
- `reddit_login` logs in with a username and password and returns the cookies `reddit_connect` stores. It takes credentials, so a host built with `inlineCredentials: false` does not list it.
|
|
9
|
+
- `reddit_comment_by_id`, `reddit_post_comments_expanded` (collapsed replies read in), `reddit_subreddit_can_post`, `reddit_subreddits_batch` and `reddit_users_batch` cover the remaining read routes.
|
|
10
|
+
- Input aliases (feedback 85f3f21b): the user tools accept `username` for `name`, every tool with a `q` input accepts `query`, and the post tools accept `post_id` for `id`. The alias is moved onto the canonical field before the call and never sent to the API; passing both with different values is an error.
|
|
11
|
+
|
|
3
12
|
## 0.20.5 (2026-11-19)
|
|
4
13
|
|
|
5
14
|
No new tools; description updates.
|
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ Authentication is a Bearer token: the server sends `Authorization: Bearer <REDDI
|
|
|
104
104
|
|
|
105
105
|
## Tools
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
69 tools and 3 playbook resources: 38 Reddit reads, 13 Reddit account tools (log in, connect, status, disconnect, comment, submit, vote, DM, read DM threads and messages, and schedule, list or cancel a post or comment for later), 11 monitor/webhook management tools, `reddit_set_watch` (one call that stands up a whole watch), `reddit_explain` (where the rows you are holding came from), 3 feedback tools, and 2 account tools (`reddit_account_me`, which is also where the credit balance lives, and `reddit_account_payments`, the top-up history). Reddit writes (commenting, posting, voting, DMs) act as YOUR Reddit account and only after you connect it with `reddit_connect`; each is marked as a write so your client asks before it runs. Monitor/webhook tools configure your OWN redditapis.com account (an alerting subscription), never Reddit itself, and the feedback tools send a report to the redditapis.com team, never to Reddit. Every read works with just your API key; the 6 monitor/webhook writes additionally need an active monitoring plan (see Monitoring below). The feedback tools are free and need only your key.
|
|
108
108
|
|
|
109
109
|
A few conventions across the catalog:
|
|
110
110
|
|
|
@@ -136,6 +136,8 @@ A few conventions across the catalog:
|
|
|
136
136
|
| `reddit_subreddit_top` | `GET /api/reddit/sub/{name}/top` | Top posts of a subreddit for a time window (`t`). |
|
|
137
137
|
| `reddit_subreddit_comments` | `GET /api/reddit/sub/{name}/comments` | Stream the newest comments across an entire subreddit (not one post's thread). |
|
|
138
138
|
| `reddit_subreddit_about` | `GET /api/reddit/sub/{name}/about` | A subreddit's public metadata: title, description, subscriber and active-user counts, type, NSFW flag. |
|
|
139
|
+
| `reddit_subreddit_can_post` | `GET /api/reddit/sub/{name}/can-post` | Before posting: whether a post here can go through (`allowed` true, false or unknown), with a reason code per block, the posting requirements and the post rules. |
|
|
140
|
+
| `reddit_subreddits_batch` | `GET /api/reddit/subreddits/batch` | Up to 100 subreddits in one call by name, with the names Reddit did not return in `missing`. |
|
|
139
141
|
| `reddit_subreddit_rules` | `GET /api/reddit/sub/{name}/rules` | A subreddit's posting rules plus Reddit's site-wide rules. |
|
|
140
142
|
| `reddit_subreddit_moderators` | `GET /api/reddit/sub/{name}/moderators` | A subreddit's moderator team, each with permissions, flair, and when they joined. |
|
|
141
143
|
| `reddit_subreddit_flairs` | `GET /api/reddit/sub/{name}/flairs` | A subreddit's post flair templates (`id`, `text`, `editable`, colours, `mod_only`), so a post can carry the `flair_id` the community requires. Reddit lists flairs only to signed-in accounts, so it reads as your connected Reddit session; with none connected it answers 503 `SESSION_REQUIRED` and is not charged. |
|
|
@@ -148,6 +150,8 @@ A few conventions across the catalog:
|
|
|
148
150
|
| `reddit_post_visibility` | `GET /api/reddit/post/{id}/visibility` | Is a post still publicly visible, or did it quietly stop being so? Fetches the post and one page of its author's listing and compares. Returns `live`, `not_visible` or `undecidable` with a reason, plus `removed` (boolean) and `removal_marker` (string or null). Alert on `removed`: it is true only when Reddit itself marks the post as taken down. `not_visible` from listing absence alone is `confident: false`, `removed: false`, not a removal. Beyond Reddit's marker it never claims to know WHY. Two upstream calls, $0.004. |
|
|
149
151
|
| `reddit_post` | `GET /api/reddit/post/{id}` | A single post by its base-36 `id` (no `t3_` prefix): title, author, score, text, permalink, subreddit, url. |
|
|
150
152
|
| `reddit_post_comments` | `GET /api/reddit/comments` | A post plus its full threaded comment tree, fetched by `permalink`. `format: "normalized"` returns flat comments instead of Reddit's raw tree. |
|
|
153
|
+
| `reddit_post_comments_expanded` | `GET /api/reddit/post/{id}/comments/expanded` | The comment tree with Reddit's collapsed replies ("load more comments", "continue this thread") read in and put back in place. A flat $0.02 per call. |
|
|
154
|
+
| `reddit_comment_by_id` | `GET /api/reddit/comment/{id}` | One comment by its id. |
|
|
151
155
|
| `reddit_post_duplicates` | `GET /api/reddit/post/{id}/duplicates` | Every other post that shares this post's link, across subreddits (Reddit's "other discussions"). |
|
|
152
156
|
| `reddit_by_id` | `GET /api/reddit/by_id/{fullnames}` | Bulk-hydrate up to 100 posts in one call from a comma-separated list of `t3_` fullnames. |
|
|
153
157
|
|
|
@@ -156,6 +160,7 @@ A few conventions across the catalog:
|
|
|
156
160
|
| Tool | Endpoint | What it does |
|
|
157
161
|
|---|---|---|
|
|
158
162
|
| `reddit_user_profile` | `GET /api/reddit/user/{name}` | A user's public profile: karma, account age, verified/employee flags, avatar. |
|
|
163
|
+
| `reddit_users_batch` | `GET /api/reddit/users/batch` | Up to 100 accounts in one call by `t2_` fullname, with the ids Reddit did not return in `missing`. |
|
|
159
164
|
| `reddit_user_comments` | `GET /api/reddit/user/{name}/comments` | A user's recent comments (body, score, subreddit, parent link, timestamp). |
|
|
160
165
|
| `reddit_user_submitted` | `GET /api/reddit/user/{name}/submitted` | A user's submitted posts (the sibling of `reddit_user_comments`). |
|
|
161
166
|
| `reddit_user_achievements` | `GET /api/reddit/user/{name}/achievements` | A user's public achievements (the trophies on their profile): name, description, granted timestamp, icons. An account with none returns an empty list. |
|
|
@@ -230,10 +235,13 @@ The bodies are documentation and name the calls they are recipes for, which is t
|
|
|
230
235
|
| `reddit_connect` | `POST /api/reddit/session` | Store your Reddit session once (reddit_session and loid cookies; add csrf_token for votes and DMs). A logged-out session is refused. Free. |
|
|
231
236
|
| `reddit_session_status` | `GET /api/reddit/session` | Whether a session is connected, its username, and when it was last used. Never returns the cookies. Free. |
|
|
232
237
|
| `reddit_disconnect` | `POST /api/reddit/session/delete` | Delete the stored session. Free. |
|
|
238
|
+
| `reddit_login` | `POST /api/reddit/login` | Log in with a username and password (and TOTP secret for 2FA) to get the cookies `reddit_connect` takes. The cookies come back in the result. Not listed by a host that never takes Reddit credentials. |
|
|
233
239
|
| `reddit_comment` | `POST /api/reddit/comment` | Comment on a post as you. |
|
|
234
240
|
| `reddit_submit` | `POST /api/reddit/submit` | Submit a text or link post to a subreddit as you. |
|
|
235
241
|
| `reddit_vote` | `POST /api/reddit/vote` | Upvote, downvote or clear a vote on a post or comment as you. |
|
|
236
242
|
| `reddit_dm` | `POST /api/reddit/dm` | Send a private chat message as you. |
|
|
243
|
+
| `reddit_dm_threads` | `POST /api/reddit/dm/threads` | Your chat conversations, newest activity first, paged with `limit` and `after`. |
|
|
244
|
+
| `reddit_dm_messages` | `POST /api/reddit/dm/messages` | The messages of one conversation, paged with `before`. |
|
|
237
245
|
| `reddit_scheduled_create` | `POST /api/reddit/schedule` | Schedule a post or a comment for later (`run_at` 60 seconds to 30 days ahead). It runs as your connected session at that time. Free to schedule; billed at the write rate only when the run succeeds. |
|
|
238
246
|
| `reddit_scheduled_list` | `GET /api/reddit/schedule` | Your scheduled posts and comments, newest first, with each one's `status`, `result` or `error`, and whether it was `billed`. Free. |
|
|
239
247
|
| `reddit_scheduled_cancel` | `POST /api/reddit/schedule/cancel` | Cancel a scheduled post or comment that has not run yet. A cancelled action never runs and is not charged. Free. |
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redditapis-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"mcpName": "io.github.redditapis/redditapis-mcp",
|
|
5
|
-
"description": "Reddit API as
|
|
5
|
+
"description": "Reddit API as 69 MCP tools for Claude, Cursor and any MCP client: search, subreddits, posts, comments, users, media, monitors with webhooks, account writes (post, comment, vote, DM) and feedback. Hosted server at api.redditapis.com/mcp.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/redditapis/redditapis-mcp.git"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"start": "node src/index.js",
|
|
33
|
-
"check": "node --check src/index.js && node --check src/tools.js && node --check src/feedback.js && node --check src/server.js && node --check src/watch.js && node --check src/watch-text.js && node --check src/provenance.js && node --check src/playbooks.js && node --check src/annotations.js",
|
|
34
|
-
"test": "node test/tools.test.mjs && node test/watch.test.mjs && node test/watch-invariants.test.mjs && node test/provenance.test.mjs && node test/playbooks.test.mjs && node test/description-compliance.test.mjs && node test/inline-credentials.test.mjs && node test/feedback.test.mjs && node test/index-lasterror.test.mjs && node test/scannable-without-key.test.mjs && node test/per-caller-state.test.mjs && node test/paywall.test.mjs && node test/remote-host.test.mjs && node test/hub-parity.test.mjs && node test/version-parity.test.mjs && node test/readme-opening.test.mjs && node test/annotations.test.mjs && node test/read-price.test.mjs && node test/flairs-schedule.test.mjs && node test/ads-search.test.mjs && node test/format-details.test.mjs && node test/server-json-limits.test.mjs",
|
|
33
|
+
"check": "node --check src/index.js && node --check src/tools.js && node --check src/feedback.js && node --check src/server.js && node --check src/watch.js && node --check src/watch-text.js && node --check src/provenance.js && node --check src/playbooks.js && node --check src/annotations.js && node --check src/input-aliases.js",
|
|
34
|
+
"test": "node test/tools.test.mjs && node test/watch.test.mjs && node test/watch-invariants.test.mjs && node test/provenance.test.mjs && node test/playbooks.test.mjs && node test/description-compliance.test.mjs && node test/inline-credentials.test.mjs && node test/feedback.test.mjs && node test/index-lasterror.test.mjs && node test/scannable-without-key.test.mjs && node test/per-caller-state.test.mjs && node test/paywall.test.mjs && node test/remote-host.test.mjs && node test/hub-parity.test.mjs && node test/version-parity.test.mjs && node test/readme-opening.test.mjs && node test/annotations.test.mjs && node test/read-price.test.mjs && node test/flairs-schedule.test.mjs && node test/ads-search.test.mjs && node test/format-details.test.mjs && node test/server-json-limits.test.mjs && node test/rest-coverage.test.mjs && node test/input-aliases.test.mjs",
|
|
35
35
|
"prepublishOnly": "node scripts/prepublish-tenant-check.mjs",
|
|
36
36
|
"postpublish": "node scripts/postpublish.mjs",
|
|
37
37
|
"check:registry-drift": "node scripts/registry-drift.mjs",
|
package/src/annotations.js
CHANGED
|
@@ -60,6 +60,14 @@ export const TOOL_ANNOTATIONS = {
|
|
|
60
60
|
reddit_subreddit_flairs: { title: "List Subreddit Post Flairs", ...READ_REDDIT },
|
|
61
61
|
reddit_subreddit_wiki: { title: "Subreddit Wiki Page", ...READ_REDDIT },
|
|
62
62
|
reddit_by_id: { title: "Get Posts by ID", ...READ_REDDIT },
|
|
63
|
+
reddit_comment_by_id: { title: "Get Comment by ID", ...READ_REDDIT },
|
|
64
|
+
reddit_post_comments_expanded: { title: "Get Expanded Comment Tree", ...READ_REDDIT },
|
|
65
|
+
reddit_subreddit_can_post: { title: "Subreddit Posting Eligibility", ...READ_REDDIT },
|
|
66
|
+
reddit_subreddits_batch: { title: "Get Subreddits by Name", ...READ_REDDIT },
|
|
67
|
+
reddit_users_batch: { title: "Get Users by ID", ...READ_REDDIT },
|
|
68
|
+
// The connected account's own chat, read from Reddit as that account.
|
|
69
|
+
reddit_dm_threads: { title: "List DM Threads", ...READ_REDDIT },
|
|
70
|
+
reddit_dm_messages: { title: "DM Thread Messages", ...READ_REDDIT },
|
|
63
71
|
reddit_subreddits_popular: { title: "List Popular Subreddits", ...READ_REDDIT },
|
|
64
72
|
reddit_subreddits_new: { title: "List New Subreddits", ...READ_REDDIT },
|
|
65
73
|
reddit_subreddits_default: { title: "List Default Subreddits", ...READ_REDDIT },
|
|
@@ -92,6 +100,9 @@ export const TOOL_ANNOTATIONS = {
|
|
|
92
100
|
// credential, so both are destructive.
|
|
93
101
|
reddit_connect: { title: "Connect Reddit Account", readOnly: false, destructive: true, idempotent: true, openWorld: true },
|
|
94
102
|
reddit_session_status: { title: "Reddit Connection Status", ...READ_OWN },
|
|
103
|
+
// Asks Reddit (openWorld) and changes nothing it was not already true of: a logged-out row is marked dead.
|
|
104
|
+
// A real login at Reddit: not idempotent (each call is a new login), not destructive.
|
|
105
|
+
reddit_login: { title: "Reddit Account Login", readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
95
106
|
reddit_disconnect: { title: "Disconnect Reddit Account", readOnly: false, destructive: true, idempotent: true, openWorld: false },
|
|
96
107
|
reddit_comment: { title: "Post Comment", readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
97
108
|
reddit_submit: { title: "Submit Post", readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Input-name aliases (feedback 85f3f21b, 2026-11-19).
|
|
2
|
+
//
|
|
3
|
+
// The tools take one canonical name per input: `name` for a user (and a
|
|
4
|
+
// subreddit), `q` for a search query, `id` for a post. Callers reasonably send
|
|
5
|
+
// `username`, `query` or `post_id` instead, and a strict schema refused those
|
|
6
|
+
// calls with a validation error naming a field the caller never used. Each
|
|
7
|
+
// alias below is accepted on exactly the tools where it means the canonical
|
|
8
|
+
// input, is moved onto the canonical name before the request is built, and is
|
|
9
|
+
// never sent to the API. The canonical name stays the documented one.
|
|
10
|
+
//
|
|
11
|
+
// Sending both with different values is refused (it is ambiguous); sending
|
|
12
|
+
// neither for a required input is refused with both names in the message,
|
|
13
|
+
// because the canonical input becomes optional in the published schema so the
|
|
14
|
+
// alias alone can satisfy it.
|
|
15
|
+
|
|
16
|
+
// alias -> canonical, and where the alias applies.
|
|
17
|
+
export const INPUT_ALIASES = [
|
|
18
|
+
{ alias: "username", canonical: "name", applies: (tool) => typeof tool.path === "string" && tool.path.includes("/user/{name}") },
|
|
19
|
+
{ alias: "query", canonical: "q", applies: (tool) => Boolean(tool.shape && tool.shape.q) },
|
|
20
|
+
{ alias: "post_id", canonical: "id", applies: (tool) => typeof tool.path === "string" && tool.path.includes("/post/{id}") },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
/** The aliases one tool accepts: [{ alias, canonical, required }]. */
|
|
24
|
+
export function aliasesFor(tool) {
|
|
25
|
+
const shape = (tool && tool.shape) || {};
|
|
26
|
+
return INPUT_ALIASES.filter((a) => shape[a.canonical] && !shape[a.alias] && a.applies(tool)).map((a) => ({
|
|
27
|
+
alias: a.alias,
|
|
28
|
+
canonical: a.canonical,
|
|
29
|
+
required: !shape[a.canonical].isOptional(),
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The schema to publish: the tool's own, plus each alias (same type), with an aliased canonical input made optional. */
|
|
34
|
+
export function aliasedShape(tool) {
|
|
35
|
+
const list = aliasesFor(tool);
|
|
36
|
+
if (!list.length) return tool.shape;
|
|
37
|
+
const shape = { ...tool.shape };
|
|
38
|
+
for (const { alias, canonical, required } of list) {
|
|
39
|
+
const base = tool.shape[canonical];
|
|
40
|
+
if (required) shape[canonical] = base.optional().describe(`${base.description || ""} Required: send \`${canonical}\` or its alias \`${alias}\`.`.trim());
|
|
41
|
+
shape[alias] = base.optional().describe(`Alias of \`${canonical}\`; send one of them. \`${canonical}\` is the canonical name.`);
|
|
42
|
+
}
|
|
43
|
+
return shape;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Move each alias onto its canonical name. Returns { args } or { error } (a message for the caller).
|
|
48
|
+
* A tool with no aliases gets its args back untouched.
|
|
49
|
+
*/
|
|
50
|
+
export function normalizeArgs(tool, args) {
|
|
51
|
+
const list = aliasesFor(tool);
|
|
52
|
+
if (!list.length || !args || typeof args !== "object") return { args };
|
|
53
|
+
const out = { ...args };
|
|
54
|
+
for (const { alias, canonical, required } of list) {
|
|
55
|
+
const has = (k) => out[k] !== undefined && out[k] !== null && out[k] !== "";
|
|
56
|
+
if (has(alias)) {
|
|
57
|
+
if (has(canonical) && out[canonical] !== out[alias]) {
|
|
58
|
+
return { error: `${tool.name}: \`${canonical}\` and its alias \`${alias}\` were both sent with different values; send only \`${canonical}\`.` };
|
|
59
|
+
}
|
|
60
|
+
out[canonical] = out[alias];
|
|
61
|
+
}
|
|
62
|
+
delete out[alias];
|
|
63
|
+
if (required && !has(canonical)) return { error: `${tool.name}: \`${canonical}\` is required (or its alias \`${alias}\`).` };
|
|
64
|
+
}
|
|
65
|
+
return { args: out };
|
|
66
|
+
}
|
package/src/server.js
CHANGED
|
@@ -18,6 +18,7 @@ import { createSetWatchHandler } from "./watch.js";
|
|
|
18
18
|
import { createReadLedger, createExplainHandler } from "./provenance.js";
|
|
19
19
|
import { registerPlaybooks } from "./playbooks.js";
|
|
20
20
|
import { toolAnnotations } from "./annotations.js";
|
|
21
|
+
import { aliasedShape, normalizeArgs } from "./input-aliases.js";
|
|
21
22
|
|
|
22
23
|
// Read from package.json rather than a hand-maintained literal -- this drifted
|
|
23
24
|
// silently to "0.1.0" while the published package reached 0.1.12, so every
|
|
@@ -505,10 +506,17 @@ export function createServer({
|
|
|
505
506
|
return result;
|
|
506
507
|
};
|
|
507
508
|
}
|
|
509
|
+
// username/query/post_id are accepted as aliases of name/q/id (85f3f21b, src/input-aliases.js): moved onto the
|
|
510
|
+
// canonical name before the handler runs, never sent to the API.
|
|
511
|
+
const inner = handler;
|
|
508
512
|
server.registerTool(
|
|
509
513
|
tool.name,
|
|
510
|
-
{ title, description: tool.description, inputSchema: tool
|
|
511
|
-
|
|
514
|
+
{ title, description: tool.description, inputSchema: aliasedShape(tool), annotations },
|
|
515
|
+
async (args, extra) => {
|
|
516
|
+
const n = normalizeArgs(tool, args);
|
|
517
|
+
if (n.error) return { isError: true, content: [{ type: "text", text: n.error }] };
|
|
518
|
+
return inner(n.args, extra);
|
|
519
|
+
},
|
|
512
520
|
);
|
|
513
521
|
}
|
|
514
522
|
|
package/src/tools.js
CHANGED
|
@@ -665,6 +665,59 @@ export const TOOLS = [
|
|
|
665
665
|
),
|
|
666
666
|
},
|
|
667
667
|
},
|
|
668
|
+
{
|
|
669
|
+
name: "reddit_comment_by_id",
|
|
670
|
+
path: "/api/reddit/comment/{id}",
|
|
671
|
+
description:
|
|
672
|
+
"Fetches one comment by its id: Reddit's native t1 comment node (body, author, score, parent, permalink). A comment that does not exist is a 404. Standard read price. Example: id='abc123'.",
|
|
673
|
+
shape: {
|
|
674
|
+
id: z.string().min(1).describe("The comment id, the part after t1_ (e.g. 'abc123'). Required (path parameter)."),
|
|
675
|
+
},
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: "reddit_post_comments_expanded",
|
|
679
|
+
path: "/api/reddit/post/{id}/comments/expanded",
|
|
680
|
+
description:
|
|
681
|
+
"A post and its comment tree with Reddit's collapsed replies read in. On a big thread Reddit hides part of the tree behind 'load more comments' and 'continue this thread' stubs; this reads those stubs (up to 100 hidden comments per expansion read) and puts the comments back where the stubs were, in the same tree shape as the permalink comment read. `expansion` reports what was read and what is still collapsed (`complete`, `remaining_more_comments`, `stopped_reason`); the returned `after` cursor reads the rest. A flat $0.02 per call; when an expansion read fails, the partial tree comes back and the call is not billed.",
|
|
682
|
+
shape: {
|
|
683
|
+
id: z.string().min(1).describe("Reddit post id, e.g. '1sgjld3'. A t3_ prefix is optional. Required (path parameter)."),
|
|
684
|
+
limit: z.number().int().min(1).max(500).optional().describe("Maximum top-level comments, 1-500 (default 100)."),
|
|
685
|
+
sort: z.enum(["confidence", "top", "new", "controversial", "old", "qa"]).optional().describe(
|
|
686
|
+
"Comment ordering: confidence (Reddit's best), top, new, controversial, old or qa. Absent, Reddit's default for the thread.",
|
|
687
|
+
),
|
|
688
|
+
max_expansions: z.number().int().min(1).max(9).optional().describe("Most expansion reads this call may make, 1-9 (default 9)."),
|
|
689
|
+
after: z.string().optional().describe(
|
|
690
|
+
"The `after` cursor from a previous answer for the same post, exactly as returned: reads only the comments still collapsed. Absent, the whole thread is read.",
|
|
691
|
+
),
|
|
692
|
+
},
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
name: "reddit_subreddit_can_post",
|
|
696
|
+
path: "/api/reddit/sub/{name}/can-post",
|
|
697
|
+
description:
|
|
698
|
+
"Checks before posting whether a post in this subreddit can go through. Returns `allowed` (true, false or 'unknown'), `reasons` (each with a `code` such as banned, private, restricted_approved_only, archived, flair_required, title_rule, domain_blocked, low_karma_hint, new_account_hint, and a readable `detail`), the subreddit's posting `requirements` and post `rules`. A read that failed answers 'unknown', not true; karma and account age only produce hints, because subreddits keep their AutoModerator thresholds private. Standard read price. Example: name='SaaS'.",
|
|
699
|
+
shape: {
|
|
700
|
+
name: z.string().min(1).describe("Subreddit name, without r/ (1 to 21 letters, digits or underscores). Required (path parameter)."),
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
name: "reddit_subreddits_batch",
|
|
705
|
+
path: "/api/reddit/subreddits/batch",
|
|
706
|
+
description:
|
|
707
|
+
"Up to 100 subreddits in one call, by name: a `subreddits` list (the same per-item shape as the single-subreddit about read), `requested`, `returned`, and `missing` (names Reddit did not return because the subreddit does not exist, is banned or is private). One read at the standard read price. Example: names='SaaS,startups,webdev'.",
|
|
708
|
+
shape: {
|
|
709
|
+
names: z.string().min(1).describe("Comma-separated subreddit names without r/, up to 100. Duplicates are ignored. Required."),
|
|
710
|
+
},
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
name: "reddit_users_batch",
|
|
714
|
+
path: "/api/reddit/users/batch",
|
|
715
|
+
description:
|
|
716
|
+
"Up to 100 Reddit accounts in one call, by t2_ fullname (the `author_info.fullname` every post and comment result carries): a `users` list (name, created, link, comment and total karma, profile image, NSFW profile flag), `requested`, `returned`, and `missing` (deleted, suspended or nonexistent accounts). Reddit has no batch read by username, so this takes ids only. One read at the standard read price. Example: ids='t2_16b0vi,t2_abc12'.",
|
|
717
|
+
shape: {
|
|
718
|
+
ids: z.string().min(1).describe("Comma-separated t2_ account fullnames, up to 100. The t2_ prefix is required."),
|
|
719
|
+
},
|
|
720
|
+
},
|
|
668
721
|
{
|
|
669
722
|
name: "reddit_subreddits_popular",
|
|
670
723
|
path: "/api/reddit/subreddits/popular",
|
|
@@ -939,6 +992,23 @@ export const TOOLS = [
|
|
|
939
992
|
"Whether a Reddit session is connected for this account: `connected`, the Reddit username, `status` (active, or dead after Reddit rejected it), and when it was first stored, last updated and last used. The cookies are not returned. Free.",
|
|
940
993
|
shape: {},
|
|
941
994
|
},
|
|
995
|
+
{
|
|
996
|
+
name: "reddit_login",
|
|
997
|
+
path: "/api/reddit/login",
|
|
998
|
+
method: "POST",
|
|
999
|
+
write: true,
|
|
1000
|
+
description:
|
|
1001
|
+
"Logs in to a Reddit account with its username and password (plus the TOTP secret when the account has two-factor auth) and returns that account's session cookies (the session cookie, loid, the CSRF cookie and others), the input the connect tool stores server-side. The cookies come back in this tool's result, so they sit in the conversation until they are connected. Reddit sees a real login, which can send the account a login alert. Billed at the login rate. A host built without inline credentials does not list this tool.",
|
|
1002
|
+
shape: {
|
|
1003
|
+
username: z.string().min(1).describe("Reddit username or email."),
|
|
1004
|
+
password: z.string().min(1).describe("The account password."),
|
|
1005
|
+
totp_secret: z.string().optional().describe("Base32 TOTP secret, for an account with two-factor auth. Absent when it is off."),
|
|
1006
|
+
method: z.enum(["http", "browser"]).optional().describe("http (default) or browser. browser gives the most compatible write-session cookies."),
|
|
1007
|
+
proxy: z.string().optional().describe(
|
|
1008
|
+
"Sticky IP for this account, http://user:pass@host:port or host:port. The same one belongs on every later call as this account.",
|
|
1009
|
+
),
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
942
1012
|
{
|
|
943
1013
|
name: "reddit_disconnect",
|
|
944
1014
|
path: "/api/reddit/session/delete",
|
|
@@ -1005,6 +1075,29 @@ export const TOOLS = [
|
|
|
1005
1075
|
message: z.string().min(1).describe("Plain-text message body."),
|
|
1006
1076
|
},
|
|
1007
1077
|
},
|
|
1078
|
+
{
|
|
1079
|
+
name: "reddit_dm_threads",
|
|
1080
|
+
path: "/api/reddit/dm/threads",
|
|
1081
|
+
method: "POST",
|
|
1082
|
+
description:
|
|
1083
|
+
"Lists the connected account's private chat conversations, newest activity first: one entry per thread with `room_id`, the other party (`with_user_t2`, `with_username`, `with_membership`), the latest message preview and `unread_count`. Paged: up to `limit` threads per call and an `after` cursor (null on the last page); `total_threads` counts every conversation. `listing_status` is complete, or unknown when Reddit would not list them all. Reads as the connected (stored) session. Billed at the DM read rate per page.",
|
|
1084
|
+
shape: {
|
|
1085
|
+
limit: z.number().int().min(1).max(100).optional().describe("Threads per page, 1 to 100 (default 50)."),
|
|
1086
|
+
after: z.string().optional().describe("The previous response's `after` cursor, exactly as returned. Absent on the first page."),
|
|
1087
|
+
},
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
name: "reddit_dm_messages",
|
|
1091
|
+
path: "/api/reddit/dm/messages",
|
|
1092
|
+
method: "POST",
|
|
1093
|
+
description:
|
|
1094
|
+
"Reads the messages of one private chat thread, newest first, as the connected (stored) session. Takes a thread's `room_id` from the thread list. Paged: the previous response's `next_cursor`, sent as `before`, reads older messages. Billed at the DM read rate per page.",
|
|
1095
|
+
shape: {
|
|
1096
|
+
room_id: z.string().min(1).describe("The thread's room_id from the DM thread list (e.g. '!abc...:reddit.com'). Required."),
|
|
1097
|
+
limit: z.number().int().min(1).max(100).optional().describe("Messages per page, 1 to 100 (default 50)."),
|
|
1098
|
+
before: z.string().optional().describe("The previous response's `next_cursor`, for the next older page. Absent for the latest page."),
|
|
1099
|
+
},
|
|
1100
|
+
},
|
|
1008
1101
|
|
|
1009
1102
|
// ── SCHEDULED POSTS AND COMMENTS (POST/GET /api/reddit/schedule, POST /api/reddit/schedule/cancel) ──
|
|
1010
1103
|
// An action is the body the live submit or comment route takes, stored and replayed through
|