redditapis-mcp 0.14.0 → 0.15.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 +17 -0
- package/README.md +6 -2
- package/package.json +2 -2
- package/src/annotations.js +9 -0
- package/src/server.js +6 -0
- package/src/tools.js +80 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.0 (2026-10-25)
|
|
4
|
+
|
|
5
|
+
### Post flairs, and posts and comments scheduled for later
|
|
6
|
+
|
|
7
|
+
Four new tools.
|
|
8
|
+
|
|
9
|
+
- `reddit_subreddit_flairs` (`GET /api/reddit/sub/{name}/flairs`): a subreddit's post flair templates, each with the `id` a post takes as `flair_id`, its `text`, whether it is `editable`, its colours and whether it is `mod_only`. Reddit lists flairs only to signed-in accounts, so it reads as the connected Reddit session; with none it answers 503 `SESSION_REQUIRED` and is not charged. Billed at the read rate otherwise.
|
|
10
|
+
- `reddit_scheduled_create` (`POST /api/reddit/schedule`): schedule a post or a comment, 60 seconds to 30 days ahead. It runs as the connected session at `run_at`. Free to schedule; billed at the write rate only when the run succeeds.
|
|
11
|
+
- `reddit_scheduled_list` (`GET /api/reddit/schedule`): the account's scheduled actions with status, result or error, and whether each was billed. Free.
|
|
12
|
+
- `reddit_scheduled_cancel` (`POST /api/reddit/schedule/cancel`): cancel an action that has not run. Free. Marked destructive.
|
|
13
|
+
|
|
14
|
+
None of the four takes a cookie or a proxy, so a host built with `inlineCredentials: false` lists all of them. A 503 `session_required` now reads as "no Reddit session is connected, not charged" instead of an upstream error, and a 404 from the schedule routes names the scheduled action instead of a subreddit or post.
|
|
15
|
+
|
|
16
|
+
## 0.14.1 (2026-10-25)
|
|
17
|
+
|
|
18
|
+
- `reddit_monitor_health`: the description now explains the per-feed health fields: `consecutive_errors`, `last_poll_error.detail` (why a feed's checks are failing: `HTTP_403`, `HTTP_429` or `network_error`), and `retry_within_s` (the longest a failing feed waits for its next check). No code change.
|
|
19
|
+
|
|
3
20
|
## 0.14.0 (2026-10-20)
|
|
4
21
|
|
|
5
22
|
- New read tool `reddit_post_duplicates`: every other post that shares a post's link, across subreddits (`GET /api/reddit/post/{id}/duplicates`), up to 100 in one read.
|
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
|
+
59 tools and 3 playbook resources: 32 Reddit reads, 10 Reddit account tools (connect, status, disconnect, comment, submit, vote, DM, and schedule, list or cancel a post or comment for later), 10 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
|
|
|
@@ -137,6 +137,7 @@ A few conventions across the catalog:
|
|
|
137
137
|
| `reddit_subreddit_about` | `GET /api/reddit/sub/{name}/about` | A subreddit's public metadata: title, description, subscriber and active-user counts, type, NSFW flag. |
|
|
138
138
|
| `reddit_subreddit_rules` | `GET /api/reddit/sub/{name}/rules` | A subreddit's posting rules plus Reddit's site-wide rules. |
|
|
139
139
|
| `reddit_subreddit_moderators` | `GET /api/reddit/sub/{name}/moderators` | A subreddit's moderator team, each with permissions, flair, and when they joined. |
|
|
140
|
+
| `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. |
|
|
140
141
|
| `reddit_subreddit_wiki` | `GET /api/reddit/sub/{name}/wiki/{page}` | A subreddit's wiki page by name and `page` (markdown + HTML, revision metadata). |
|
|
141
142
|
|
|
142
143
|
### Posts and comments
|
|
@@ -218,7 +219,7 @@ The bodies are documentation and name the calls they are recipes for, which is t
|
|
|
218
219
|
{ "method": "resources/read", "params": { "uri": "playbook://subreddit-audit" } }
|
|
219
220
|
```
|
|
220
221
|
|
|
221
|
-
### Your Reddit account: connect once, then comment, post, vote and
|
|
222
|
+
### Your Reddit account: connect once, then comment, post, vote, DM and schedule
|
|
222
223
|
|
|
223
224
|
`reddit_connect` stores your Reddit session on our side, encrypted (AES-256-GCM, the key held only by the API), against this API key's account, after checking it with Reddit. Every write after that sends no cookies, so they never sit in your agent's tool calls or transcript. Each write acts publicly as you, so it is marked as a write and your client asks before it runs. Connecting, status and disconnecting are free.
|
|
224
225
|
|
|
@@ -231,6 +232,9 @@ The bodies are documentation and name the calls they are recipes for, which is t
|
|
|
231
232
|
| `reddit_submit` | `POST /api/reddit/submit` | Submit a text or link post to a subreddit as you. |
|
|
232
233
|
| `reddit_vote` | `POST /api/reddit/vote` | Upvote, downvote or clear a vote on a post or comment as you. |
|
|
233
234
|
| `reddit_dm` | `POST /api/reddit/dm` | Send a private chat message as you. |
|
|
235
|
+
| `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. |
|
|
236
|
+
| `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. |
|
|
237
|
+
| `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. |
|
|
234
238
|
|
|
235
239
|
### Feedback: tell the team what broke, after you review the draft
|
|
236
240
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redditapis-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"mcpName": "io.github.redditapis/redditapis-mcp",
|
|
5
5
|
"description": "Official MCP server for redditapis.com. Search Reddit posts, comments, communities, users and media; read subreddits, comment trees, top posts and profiles; create and manage monitors and webhooks. Native tools for Claude, Cursor and any MCP client.",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"start": "node src/index.js",
|
|
33
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",
|
|
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",
|
|
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
|
@@ -56,6 +56,7 @@ export const TOOL_ANNOTATIONS = {
|
|
|
56
56
|
reddit_subreddit_about: { title: "Get Subreddit Info", ...READ_REDDIT },
|
|
57
57
|
reddit_subreddit_rules: { title: "Get Subreddit Rules", ...READ_REDDIT },
|
|
58
58
|
reddit_subreddit_moderators: { title: "List Subreddit Moderators", ...READ_REDDIT },
|
|
59
|
+
reddit_subreddit_flairs: { title: "List Subreddit Post Flairs", ...READ_REDDIT },
|
|
59
60
|
reddit_subreddit_wiki: { title: "Subreddit Wiki Page", ...READ_REDDIT },
|
|
60
61
|
reddit_by_id: { title: "Get Posts by ID", ...READ_REDDIT },
|
|
61
62
|
reddit_subreddits_popular: { title: "List Popular Subreddits", ...READ_REDDIT },
|
|
@@ -94,6 +95,14 @@ export const TOOL_ANNOTATIONS = {
|
|
|
94
95
|
reddit_submit: { title: "Submit Post", readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
95
96
|
reddit_vote: { title: "Vote", readOnly: false, destructive: false, idempotent: true, openWorld: true },
|
|
96
97
|
reddit_dm: { title: "Send Direct Message", readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
98
|
+
|
|
99
|
+
// Scheduled posts and comments. create is openWorld: the call itself only stores the action,
|
|
100
|
+
// but its effect is a post or comment on Reddit at run_at, so a client weighs it like submit.
|
|
101
|
+
// cancel discards a pending action (destructive), repeating it changes nothing (idempotent),
|
|
102
|
+
// and it reaches only this service. list reads this account's own state.
|
|
103
|
+
reddit_scheduled_create: { title: "Schedule Reddit Action", readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
104
|
+
reddit_scheduled_list: { title: "List Scheduled Actions", ...READ_OWN },
|
|
105
|
+
reddit_scheduled_cancel: { title: "Cancel Scheduled Action", readOnly: false, destructive: true, idempotent: true, openWorld: false },
|
|
97
106
|
};
|
|
98
107
|
|
|
99
108
|
/**
|
package/src/server.js
CHANGED
|
@@ -43,6 +43,7 @@ export const DEFAULT_TIMEOUT_MS = 30000;
|
|
|
43
43
|
const NOT_FOUND_HINTS = [
|
|
44
44
|
[/^\/feedback/, " (not found. No feedback report with that id on this account, and an id from another account will not resolve here. Use the id returned by reddit_feedback_send action=send.)"],
|
|
45
45
|
[/^\/account/, " (not found. That account resource does not exist for this key.)"],
|
|
46
|
+
[/^\/api\/reddit\/schedule/, " (not found. No scheduled action with that id on this account; reddit_scheduled_list shows the ids this account has.)"],
|
|
46
47
|
];
|
|
47
48
|
const DEFAULT_NOT_FOUND_HINT =
|
|
48
49
|
" (not found. The subreddit, post id, user, or permalink may be wrong or deleted)";
|
|
@@ -140,6 +141,11 @@ export function hintFor(status, path, error) {
|
|
|
140
141
|
// (0.11.0). Both get the "did not complete in time" hint, keyed on the error.
|
|
141
142
|
if (status === 408 || (status === 503 && error === "upstream_timeout")) return " (the read did not complete in time; retry after the retry_after seconds)";
|
|
142
143
|
if (status === 429) return " (slow down: wait the retry_after seconds, keep this key's reads in flight under the limit the message names, then retry)";
|
|
144
|
+
// A read Reddit serves only to a signed-in account (post flairs, moderators), asked with no
|
|
145
|
+
// Reddit session connected: the API answers 503 session_required before Reddit is asked, and
|
|
146
|
+
// does not charge it. Retrying cannot help, so it is named rather than called an upstream error.
|
|
147
|
+
// No tool is named: a host built without inline credentials does not list the connect tool.
|
|
148
|
+
if (status === 503 && error === "session_required") return " (Reddit serves this only to a signed-in account and no Reddit session is connected for this API key, so Reddit was not asked. Not charged. Connecting the Reddit account (POST /api/reddit/session) and retrying answers it.)";
|
|
143
149
|
if (status >= 500) return " (upstream API error. Retry in a moment; if persistent, contact https://www.redditapis.com)";
|
|
144
150
|
return "";
|
|
145
151
|
}
|
package/src/tools.js
CHANGED
|
@@ -580,6 +580,24 @@ export const TOOLS = [
|
|
|
580
580
|
),
|
|
581
581
|
},
|
|
582
582
|
},
|
|
583
|
+
{
|
|
584
|
+
// POST FLAIR TEMPLATES (GET /api/reddit/sub/:name/flairs). Reddit lists these
|
|
585
|
+
// only to a signed-in account, so the API reads them as the session stored for
|
|
586
|
+
// this key (or as session headers, which this tool deliberately does not take:
|
|
587
|
+
// a cookie argument would hide the tool on a host built without inline
|
|
588
|
+
// credentials). With no session the API answers an unbilled 503
|
|
589
|
+
// SESSION_REQUIRED before Reddit is asked; hintFor in src/server.js turns that
|
|
590
|
+
// into a sentence the caller can act on.
|
|
591
|
+
name: "reddit_subreddit_flairs",
|
|
592
|
+
path: "/api/reddit/sub/{name}/flairs",
|
|
593
|
+
description:
|
|
594
|
+
"Lists a subreddit's post (link) flair templates by name: the flairs a new post in that community can carry. Returns `subreddit`, `count` and `flairs`, each with `id` (the value a post submission takes as flair_id), `text`, `editable` (true when a custom flair_text is accepted with that id), `type` (text or richtext), `background_color`, `text_color`, `css_class`, `mod_only`, `max_emojis`, `allowable_content` and `richtext`. Many subreddits remove a post that has no flair. Reddit lists flairs only to signed-in accounts, so the read runs as the Reddit session connected for this API key; with none connected it answers 503 SESSION_REQUIRED before Reddit is asked, and that answer is not charged. A moderator's session sees every template, mod-only ones included; any other account sees the templates it can post with, listed with mod_only false. A subreddit with no post flairs returns an empty list. Billed at the read rate, including a 403 or 404 from Reddit. Example: name='SaaS'.",
|
|
595
|
+
shape: {
|
|
596
|
+
name: z.string().min(1).max(21).describe(
|
|
597
|
+
"Subreddit name WITHOUT the r/ prefix (e.g. 'SaaS'), 1 to 21 letters, digits or underscores. Required (path parameter).",
|
|
598
|
+
),
|
|
599
|
+
},
|
|
600
|
+
},
|
|
583
601
|
{
|
|
584
602
|
name: "reddit_subreddit_wiki",
|
|
585
603
|
path: "/api/reddit/sub/{name}/wiki/{page}",
|
|
@@ -691,7 +709,7 @@ export const TOOLS = [
|
|
|
691
709
|
name: "reddit_monitor_health",
|
|
692
710
|
path: "/api/reddit/monitor/health",
|
|
693
711
|
description:
|
|
694
|
-
"Per-monitor health: active state, poll cadence, when it last matched something, and delivery counts for the last 24h (`delivered_24h`, `failed_24h`, `suppressed_24h`), plus whether its delivery ceiling has been hit (`ceiling_reached`) and what that ceiling is (`daily_delivery_ceiling`). `suppressed_24h` COUNTS TWO DIFFERENT THINGS AND `suppressed_breakdown` SPLITS THEM: `ceiling` (the monitor's daily cap was reached) and `stale` (the item was already older than the freshness window when first seen, so it was withheld rather than delivered as if it were new). A stale withhold is the usual reason a monitor's delivered count sits far below its matched count with no error anywhere; it is the freshness gate working as intended, not a failure or a plan limit, and retrying cannot recover the items. `ceiling_reached` is the field that indicates the daily cap was hit, and a stale withhold does not set it. When `suppressed_breakdown.resolved` is false the split does not add up to the total and `unresolved_reason` says why; `ceiling_reached` stays conservative in that case rather than being cleared. THOSE COUNTS COVER ONLY POSTS THAT WERE FETCHED. A post that was not fetched was not matched and leaves no row behind, so it is absent from all three counters; zeros there mean no matches were recorded, not that nothing was missed. `coverage_24h` is the separate field that speaks to fetching. Its `status` is `complete` (every poll reached the point where the previous poll finished), `degraded` (at least one poll was truncated and posts were lost unrecoverably; detail in `gaps[]`, `posts_in_window_at_least` and the estimated `posts_missed_estimate`), `partial` (nothing found, but not every kind of loss was checked; detail in `unobserved_events`), or `unknown` (the check could not be run at all; detail in `reason`). `unknown`, `partial` and a null count each mean the question went unanswered. `coverage_24h` is fed by the poll log and covers BOTH ways a poll loses posts unrecoverably (`listing_exhausted`, where Reddit stopped serving older posts, and `poll_overflow`, where the feed outran one poll's page budget); `observed_events` names what was actually checked, and a status of `complete` is awarded only when both were. WHAT `complete` ESTABLISHES: every poll that RAN got back to where the previous poll finished, AND every feed was actually polled. The second half comes from `stream_liveness`. A feed that is not polled writes nothing to the poll log, so on the poll log alone it looks identical to a healthy monitor; `stream_liveness` reads a different source (the polling registry plus the per-feed last-successful-poll stamp), neither of which a poll that did not run can produce. Its `status` is `live` (every feed checked within three times its own interval), `degraded` (at least one is not: `streams[]` marks each feed `never_polled`, `stalled` or `unregistered`), or `unknown` (could not be established, including `streams_awaiting_first_poll` on a monitor created moments ago, which clears itself). `coverage_24h` reads `complete` only while `stream_liveness` is `live`. A zero delivery count on a `never_polled` feed means nothing was checked, not a quiet subreddit. `gaps[]` IS A SAMPLE, NOT THE WHOLE LIST: it carries the most recent gaps only, `gaps_returned` says how many are in it, `gaps_truncated` says whether more exist, and `gap_events_24h` is the true total. `cadence` reports whether the monitor is served the interval its plan sells, which none of the fields above can. `promised_cadence_s` is the floor the account's CURRENT plan includes and `requested_cadence_s` is what this monitor is actually set to; `meets_entitlement` false means the monitor is set slower than the plan allows, which happens because a plan upgrade does not re-cadence monitors that already exist (setting `cadence_s` on the monitor changes it, and a deliberately slower cadence is also a legitimate choice). `last_checked_s_ago`, `freshness_ratio` and `within_margin` describe the slowest feed feeding this monitor, named in `slowest_stream`; `freshness_reading` marks them as ONE INSTANTANEOUS SAMPLE, not an average and not a sustained verdict, so a single reading past the margin is not by itself proof of under-service. These fields are TRI-STATE: a null `within_margin` or `meets_entitlement` means the question could not be answered, and `unknown_reason` says why.",
|
|
712
|
+
"Per-monitor health: active state, poll cadence, when it last matched something, and delivery counts for the last 24h (`delivered_24h`, `failed_24h`, `suppressed_24h`), plus whether its delivery ceiling has been hit (`ceiling_reached`) and what that ceiling is (`daily_delivery_ceiling`). `suppressed_24h` COUNTS TWO DIFFERENT THINGS AND `suppressed_breakdown` SPLITS THEM: `ceiling` (the monitor's daily cap was reached) and `stale` (the item was already older than the freshness window when first seen, so it was withheld rather than delivered as if it were new). A stale withhold is the usual reason a monitor's delivered count sits far below its matched count with no error anywhere; it is the freshness gate working as intended, not a failure or a plan limit, and retrying cannot recover the items. `ceiling_reached` is the field that indicates the daily cap was hit, and a stale withhold does not set it. When `suppressed_breakdown.resolved` is false the split does not add up to the total and `unresolved_reason` says why; `ceiling_reached` stays conservative in that case rather than being cleared. THOSE COUNTS COVER ONLY POSTS THAT WERE FETCHED. A post that was not fetched was not matched and leaves no row behind, so it is absent from all three counters; zeros there mean no matches were recorded, not that nothing was missed. `coverage_24h` is the separate field that speaks to fetching. Its `status` is `complete` (every poll reached the point where the previous poll finished), `degraded` (at least one poll was truncated and posts were lost unrecoverably; detail in `gaps[]`, `posts_in_window_at_least` and the estimated `posts_missed_estimate`), `partial` (nothing found, but not every kind of loss was checked; detail in `unobserved_events`), or `unknown` (the check could not be run at all; detail in `reason`). `unknown`, `partial` and a null count each mean the question went unanswered. `coverage_24h` is fed by the poll log and covers BOTH ways a poll loses posts unrecoverably (`listing_exhausted`, where Reddit stopped serving older posts, and `poll_overflow`, where the feed outran one poll's page budget); `observed_events` names what was actually checked, and a status of `complete` is awarded only when both were. WHAT `complete` ESTABLISHES: every poll that RAN got back to where the previous poll finished, AND every feed was actually polled. The second half comes from `stream_liveness`. A feed that is not polled writes nothing to the poll log, so on the poll log alone it looks identical to a healthy monitor; `stream_liveness` reads a different source (the polling registry plus the per-feed last-successful-poll stamp), neither of which a poll that did not run can produce. Its `status` is `live` (every feed checked within three times its own interval), `degraded` (at least one is not: `streams[]` marks each feed `never_polled`, `stalled` or `unregistered`), or `unknown` (could not be established, including `streams_awaiting_first_poll` on a monitor created moments ago, which clears itself). `coverage_24h` reads `complete` only while `stream_liveness` is `live`. Per feed in `streams[]`, `consecutive_errors` counts failed checks in a row. While a feed's checks are failing, `last_poll_error.detail` says why as a code such as `HTTP_403` (often a private or quarantined subreddit), `HTTP_429` (Reddit rate-limited the check) or `network_error` (`reason` is `fetch_failed`, or `poll_failed` with a null detail for an internal fault), and `retry_within_s` is the longest the feed waits for its next check while the poller backs off. `last_poll_error` is null while checks succeed, and can also be null during a failure when no stored failure for that feed could be read; a null there is unanswered, not healthy. A zero delivery count on a `never_polled` feed means nothing was checked, not a quiet subreddit. `gaps[]` IS A SAMPLE, NOT THE WHOLE LIST: it carries the most recent gaps only, `gaps_returned` says how many are in it, `gaps_truncated` says whether more exist, and `gap_events_24h` is the true total. `cadence` reports whether the monitor is served the interval its plan sells, which none of the fields above can. `promised_cadence_s` is the floor the account's CURRENT plan includes and `requested_cadence_s` is what this monitor is actually set to; `meets_entitlement` false means the monitor is set slower than the plan allows, which happens because a plan upgrade does not re-cadence monitors that already exist (setting `cadence_s` on the monitor changes it, and a deliberately slower cadence is also a legitimate choice). `last_checked_s_ago`, `freshness_ratio` and `within_margin` describe the slowest feed feeding this monitor, named in `slowest_stream`; `freshness_reading` marks them as ONE INSTANTANEOUS SAMPLE, not an average and not a sustained verdict, so a single reading past the margin is not by itself proof of under-service. These fields are TRI-STATE: a null `within_margin` or `meets_entitlement` means the question could not be answered, and `unknown_reason` says why.",
|
|
695
713
|
shape: { ...MONITOR_ID },
|
|
696
714
|
},
|
|
697
715
|
{
|
|
@@ -931,6 +949,67 @@ export const TOOLS = [
|
|
|
931
949
|
message: z.string().min(1).describe("Plain-text message body."),
|
|
932
950
|
},
|
|
933
951
|
},
|
|
952
|
+
|
|
953
|
+
// ── SCHEDULED POSTS AND COMMENTS (POST/GET /api/reddit/schedule, POST /api/reddit/schedule/cancel) ──
|
|
954
|
+
// An action is the body the live submit or comment route takes, stored and replayed through
|
|
955
|
+
// that same route at run_at as the account's STORED session (the one reddit_connect saves).
|
|
956
|
+
// Scheduling, listing and cancelling are free; a run that succeeds is billed at the write rate,
|
|
957
|
+
// a failed or cancelled one is not. The request carries no cookies and no proxy: the API refuses
|
|
958
|
+
// both with SESSION_FIELDS_NOT_STORED, so none appear in this schema either, and the tools stay
|
|
959
|
+
// listed on a host built without inline credentials.
|
|
960
|
+
{
|
|
961
|
+
name: "reddit_scheduled_create",
|
|
962
|
+
path: "/api/reddit/schedule",
|
|
963
|
+
method: "POST",
|
|
964
|
+
write: true,
|
|
965
|
+
description:
|
|
966
|
+
"Schedules a Reddit post or comment to be made later as the connected account, at `run_at` (60 seconds to 30 days ahead). At that time the stored request runs through the same path a live post submission or comment takes, as the Reddit session connected when it runs, so a session logged out in between makes the run fail without a charge. A public action on Reddit under the customer's name, marked as a write so a client can ask before it runs; a subreddit's rules decide whether a post stays up. Due actions are picked up every 30 seconds and run one at a time, normally within about a minute of `run_at`. A failed run is not retried: it is recorded as failed with Reddit's reason. Up to 100 actions can wait per account (409 SCHEDULE_LIMIT_REACHED past that). Scheduling is free; a run that succeeds is billed at the write rate to this API key, and a failed or cancelled one is not charged. With no connected session it answers 400 SESSION_NOT_CONNECTED. Returns 201 with `action`: `id`, `type`, `status` (scheduled), `run_at`, the stored `request`, `created_at`, `finished_at`, `result`, `error` and `billed`.",
|
|
967
|
+
shape: {
|
|
968
|
+
type: z.enum(["post", "comment"]).describe("post = a new post in a subreddit, comment = a comment on a post."),
|
|
969
|
+
run_at: z.union([z.string().min(1), z.number().int().positive()]).describe(
|
|
970
|
+
"When it runs: an ISO 8601 timestamp with a time zone (e.g. '2026-10-21T15:00:00Z' or '2026-10-21T17:00:00+02:00') or Unix seconds. 60 seconds to 30 days ahead. A timestamp without a zone is refused.",
|
|
971
|
+
),
|
|
972
|
+
request: z.object({
|
|
973
|
+
subreddit: z.string().min(1).optional().describe("Post: subreddit name, without r/. Required for a post."),
|
|
974
|
+
kind: z.enum(["self", "link"]).optional().describe("Post: self = text post, link = URL post. Required for a post."),
|
|
975
|
+
title: z.string().min(1).max(300).optional().describe("Post: title, up to 300 characters. Required for a post."),
|
|
976
|
+
url: z.string().optional().describe("Post: target URL, for kind link."),
|
|
977
|
+
flair_id: z.string().optional().describe("Post: post flair template id, for subreddits that require flair."),
|
|
978
|
+
flair_text: z.string().optional().describe("Post: post flair text, when the flair template allows editing it."),
|
|
979
|
+
nsfw: z.boolean().optional().describe("Post: mark the post NSFW."),
|
|
980
|
+
spoiler: z.boolean().optional().describe("Post: mark the post as a spoiler."),
|
|
981
|
+
sendreplies: z.boolean().optional().describe("Post: send inbox replies to the account."),
|
|
982
|
+
post_url: z.string().min(1).optional().describe("Comment: the reddit.com post URL to comment on. Required for a comment."),
|
|
983
|
+
text: z.string().optional().describe("Post: body text, for kind self. Comment: the comment text, up to 10,000 characters, required."),
|
|
984
|
+
}).describe(
|
|
985
|
+
"The body the live route takes, without cookies or a proxy. A post takes subreddit, kind and title, plus text or url and the optional flair and flag fields; a comment takes post_url and text. A field that does not belong to the type is refused with a 400 naming it.",
|
|
986
|
+
),
|
|
987
|
+
},
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
name: "reddit_scheduled_list",
|
|
991
|
+
path: "/api/reddit/schedule",
|
|
992
|
+
description:
|
|
993
|
+
"Lists this account's scheduled posts and comments, newest first. Returns `actions` and `count`. Each action carries `id`, `type`, `status` (scheduled, running, succeeded, failed or cancelled), `run_at`, the stored `request`, `created_at`, `finished_at`, `result` (what the post or comment returned, when the run succeeded), `error` (`code`, `message` and `http_status`, when the run failed) and `billed`: true for a run that succeeded, false for one that failed with an answer or was cancelled, null when the outcome was not confirmed (error EXECUTION_UNCONFIRMED or EXECUTION_INTERRUPTED, where the post or comment may still have been made and charged). Free.",
|
|
994
|
+
shape: {
|
|
995
|
+
status: z.enum(["scheduled", "running", "succeeded", "failed", "cancelled"]).optional().describe(
|
|
996
|
+
"Only actions in this status. Absent, every status is listed.",
|
|
997
|
+
),
|
|
998
|
+
limit: z.number().int().min(1).max(100).optional().describe("Maximum actions returned, 1 to 100. Default 50."),
|
|
999
|
+
},
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
name: "reddit_scheduled_cancel",
|
|
1003
|
+
path: "/api/reddit/schedule/cancel",
|
|
1004
|
+
method: "POST",
|
|
1005
|
+
write: true,
|
|
1006
|
+
destructive: true,
|
|
1007
|
+
description:
|
|
1008
|
+
"Cancels a scheduled post or comment by its id, while it has not run yet. Returns `cancelled`, the `action` and a `message`. An action that was still scheduled comes back with cancelled true: it will not run and is not charged. An action that already ran, or is running, comes back with cancelled false and its current status, and nothing changes. 404 NOT_FOUND when the id is not a scheduled action on this account. Free.",
|
|
1009
|
+
shape: {
|
|
1010
|
+
id: z.string().uuid().describe("The action id, as returned when the action was scheduled or listed."),
|
|
1011
|
+
},
|
|
1012
|
+
},
|
|
934
1013
|
{
|
|
935
1014
|
// ONE CALL INSTEAD OF THREE. Standing up a watch today means composing a
|
|
936
1015
|
// webhook registration, a monitor creation and a test delivery, each with
|