feedkeeper 0.36.3 → 0.36.5
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/package.json +1 -1
- package/server/dist/mcp/server.js +250 -161
- package/server/dist/native/editions.js +9 -9
- package/server/package.json +1 -1
package/package.json
CHANGED
|
@@ -13,8 +13,8 @@ import { generateOpml, importOpmlFeeds } from "../feeds/opml.js";
|
|
|
13
13
|
import { pollFeed } from "../feeds/poller.js";
|
|
14
14
|
import { discoverFeeds } from "../feeds/discovery.js";
|
|
15
15
|
import { APP_VERSION } from "../version.js";
|
|
16
|
-
import { dismissEdition, editionCandidates,
|
|
17
|
-
import { getNativePreferences
|
|
16
|
+
import { dismissEdition, editionCandidates, getEditionState, publishCuratedEdition, publishEditionFields } from "../native/editions.js";
|
|
17
|
+
import { getNativePreferences } from "../native/preferences.js";
|
|
18
18
|
import { NativeError } from "../native/requests.js";
|
|
19
19
|
import { capabilityDenial, hasUserCapability } from "../auth/capabilities.js";
|
|
20
20
|
function textResult(payload) {
|
|
@@ -25,13 +25,13 @@ function errorResult(message) {
|
|
|
25
25
|
}
|
|
26
26
|
const dateInput = z.union([z.string().datetime({ offset: true }), z.string().date()]);
|
|
27
27
|
const publishedRange = {
|
|
28
|
-
since: dateInput.optional().describe("
|
|
29
|
-
until: dateInput.optional().describe("
|
|
28
|
+
since: dateInput.optional().describe("Filter for items published at or after this ISO date or date-time"),
|
|
29
|
+
until: dateInput.optional().describe("Filter for items published at or before this ISO date or date-time"),
|
|
30
30
|
};
|
|
31
31
|
// Item actions accept one ID or a batch, so clients can triage many articles in one call.
|
|
32
32
|
const itemSelection = {
|
|
33
|
-
itemId: z.number().int().positive().optional().describe("A single item ID"),
|
|
34
|
-
itemIds: z.array(z.number().int().positive()).min(1).max(200).optional().describe("
|
|
33
|
+
itemId: z.number().int().positive().optional().describe("A single item ID to target"),
|
|
34
|
+
itemIds: z.array(z.number().int().positive()).min(1).max(200).optional().describe("An array of up to 200 item IDs to target in batch"),
|
|
35
35
|
};
|
|
36
36
|
function selectedItemIds({ itemId, itemIds }) {
|
|
37
37
|
return [...(itemIds ?? []), ...(itemId ? [itemId] : [])];
|
|
@@ -45,25 +45,81 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
45
45
|
"Use it to read, search, and triage RSS/Atom feeds, fetch full article text, manage reading lists, " +
|
|
46
46
|
"and read or publish curated newspaper editions.",
|
|
47
47
|
});
|
|
48
|
+
const mcpUrlSchema = z.preprocess((val) => (typeof val === "string" ? normalizeUrlCandidate(val) : val), z.string().url());
|
|
49
|
+
const readOnlyAnnotations = {
|
|
50
|
+
readOnlyHint: true,
|
|
51
|
+
destructiveHint: false,
|
|
52
|
+
idempotentHint: true,
|
|
53
|
+
openWorldHint: false,
|
|
54
|
+
};
|
|
55
|
+
const readOnlyOpenWorldAnnotations = {
|
|
56
|
+
readOnlyHint: true,
|
|
57
|
+
destructiveHint: false,
|
|
58
|
+
idempotentHint: true,
|
|
59
|
+
openWorldHint: true,
|
|
60
|
+
};
|
|
61
|
+
const writeAdditiveAnnotations = {
|
|
62
|
+
readOnlyHint: false,
|
|
63
|
+
destructiveHint: false,
|
|
64
|
+
idempotentHint: false,
|
|
65
|
+
openWorldHint: false,
|
|
66
|
+
};
|
|
67
|
+
const writeAdditiveIdempotentAnnotations = {
|
|
68
|
+
readOnlyHint: false,
|
|
69
|
+
destructiveHint: false,
|
|
70
|
+
idempotentHint: true,
|
|
71
|
+
openWorldHint: false,
|
|
72
|
+
};
|
|
73
|
+
const writeOpenWorldAnnotations = {
|
|
74
|
+
readOnlyHint: false,
|
|
75
|
+
destructiveHint: false,
|
|
76
|
+
idempotentHint: false,
|
|
77
|
+
openWorldHint: true,
|
|
78
|
+
};
|
|
79
|
+
const writeDestructiveAnnotations = {
|
|
80
|
+
readOnlyHint: false,
|
|
81
|
+
destructiveHint: true,
|
|
82
|
+
idempotentHint: true,
|
|
83
|
+
openWorldHint: false,
|
|
84
|
+
};
|
|
48
85
|
server.registerTool("list_feeds", {
|
|
49
86
|
title: "List subscribed feeds",
|
|
50
|
-
description: "Lists all RSS/Atom feeds the current user is subscribed to, including unread counts and polling health.",
|
|
87
|
+
description: "Lists all RSS/Atom feeds the current user is subscribed to, including subscription settings, unread counts, and polling health status. Safe read-only operation. To inspect a single feed in detail, use get_feed. To discover new feeds, use discover_feeds.",
|
|
88
|
+
annotations: readOnlyAnnotations,
|
|
51
89
|
inputSchema: {
|
|
52
|
-
onlyWithErrors: z.boolean().optional().describe("
|
|
90
|
+
onlyWithErrors: z.boolean().optional().describe("When true, only returns feeds whose last poll failed or that have consecutive errors"),
|
|
53
91
|
},
|
|
54
92
|
}, async ({ onlyWithErrors }) => {
|
|
55
93
|
const feeds = listSubscriptionsForUser(userId);
|
|
56
94
|
return textResult(onlyWithErrors ? feeds.filter((feed) => feed.last_error || feed.consecutive_errors > 0) : feeds);
|
|
57
95
|
});
|
|
58
|
-
|
|
96
|
+
server.registerTool("get_feed", {
|
|
97
|
+
title: "Get subscribed feed details",
|
|
98
|
+
description: "Returns metadata, subscription settings, polling health status, and unread count for a single subscribed feed by its numeric feed ID. Safe read-only operation. Use list_feeds to view all subscribed feeds.",
|
|
99
|
+
annotations: readOnlyAnnotations,
|
|
100
|
+
inputSchema: {
|
|
101
|
+
feedId: z.number().int().positive().describe("The numeric ID of the subscribed feed to inspect"),
|
|
102
|
+
},
|
|
103
|
+
}, async ({ feedId }) => {
|
|
104
|
+
const feed = listSubscriptionsForUser(userId).find((f) => f.id === feedId);
|
|
105
|
+
if (!feed)
|
|
106
|
+
return errorResult("feed_not_found: Feed does not exist or user is not subscribed");
|
|
107
|
+
return textResult(feed);
|
|
108
|
+
});
|
|
59
109
|
if (scope === "write")
|
|
60
110
|
server.registerTool("subscribe_feed", {
|
|
61
111
|
title: "Subscribe to a feed",
|
|
62
|
-
description: "Subscribes the current user to an RSS/Atom feed URL or website URL (auto-discovering the feed).",
|
|
112
|
+
description: "Subscribes the current user to an RSS/Atom feed URL or website URL (auto-discovering the feed link if a website URL is provided). Requires write scope. Idempotent: subscribing to an already subscribed feed returns the existing subscription. Returns the subscription record. For API documentation, see https://github.com/visualfusion/feedkeeper.",
|
|
113
|
+
annotations: {
|
|
114
|
+
readOnlyHint: false,
|
|
115
|
+
destructiveHint: false,
|
|
116
|
+
idempotentHint: true,
|
|
117
|
+
openWorldHint: true,
|
|
118
|
+
},
|
|
63
119
|
inputSchema: {
|
|
64
|
-
url: mcpUrlSchema.describe("The feed URL or website URL"),
|
|
65
|
-
label: z.string().max(200).optional().describe("Optional display name for this feed"),
|
|
66
|
-
folderId: z.number().int().positive().optional().describe("Optional folder/category ID"),
|
|
120
|
+
url: mcpUrlSchema.describe("The RSS/Atom feed URL or website URL to subscribe to"),
|
|
121
|
+
label: z.string().max(200).optional().describe("Optional custom display name for this feed subscription"),
|
|
122
|
+
folderId: z.number().int().positive().optional().describe("Optional folder/category ID to place the new subscription in"),
|
|
67
123
|
},
|
|
68
124
|
}, async ({ url, label, folderId }) => {
|
|
69
125
|
if (!hasUserCapability(userId, "sync"))
|
|
@@ -89,9 +145,10 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
89
145
|
});
|
|
90
146
|
server.registerTool("discover_feeds", {
|
|
91
147
|
title: "Discover feeds on a website",
|
|
92
|
-
description: "Inspects a website URL and discovers available RSS
|
|
148
|
+
description: "Inspects a website URL and discovers available RSS, Atom, and JSON feed links from HTML link tags. Safe read-only operation: does NOT subscribe to any feed. Returns a list of discovered candidate feed URLs and titles. Use subscribe_feed to subscribe to one of the discovered URLs. For API documentation, see https://github.com/visualfusion/feedkeeper.",
|
|
149
|
+
annotations: readOnlyOpenWorldAnnotations,
|
|
93
150
|
inputSchema: {
|
|
94
|
-
url: mcpUrlSchema.describe("The website URL to
|
|
151
|
+
url: mcpUrlSchema.describe("The website URL to scan for available RSS/Atom feed links"),
|
|
95
152
|
},
|
|
96
153
|
}, async ({ url }) => {
|
|
97
154
|
if (!hasUserCapability(userId, "sync"))
|
|
@@ -109,8 +166,11 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
109
166
|
if (scope === "write")
|
|
110
167
|
server.registerTool("unsubscribe_feed", {
|
|
111
168
|
title: "Unsubscribe from a feed",
|
|
112
|
-
description: "Unsubscribes the current user from a feed. Feeds and other users' subscriptions are unaffected.",
|
|
113
|
-
|
|
169
|
+
description: "Unsubscribes the current user from a feed by its feed ID. Destructive action. Feeds and other users' subscriptions are unaffected. Returns { ok: true } on success.",
|
|
170
|
+
annotations: writeDestructiveAnnotations,
|
|
171
|
+
inputSchema: {
|
|
172
|
+
feedId: z.number().int().positive().describe("The numeric ID of the feed to unsubscribe from"),
|
|
173
|
+
},
|
|
114
174
|
}, async ({ feedId }) => {
|
|
115
175
|
try {
|
|
116
176
|
unsubscribeFromFeed(userId, feedId);
|
|
@@ -122,14 +182,15 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
122
182
|
});
|
|
123
183
|
if (scope === "write")
|
|
124
184
|
server.registerTool("save_to_inbox", {
|
|
125
|
-
title: "Save article or clipping to Inbox",
|
|
126
|
-
description: "Saves a web article URL, raw HTML, text clipping, or note directly into the user's Universal Inbox.",
|
|
185
|
+
title: "Save article or clipping to Universal Inbox",
|
|
186
|
+
description: "Saves a web article URL, raw HTML, plain text/markdown clipping, or personal note directly into the user's Universal Inbox. At least one of url, contentHtml, or textContent must be provided. Returns { success: true, itemId: number, title: string, url: string, hasNote: boolean }. For API documentation, see https://github.com/visualfusion/feedkeeper.",
|
|
187
|
+
annotations: writeOpenWorldAnnotations,
|
|
127
188
|
inputSchema: {
|
|
128
|
-
url: mcpUrlSchema.optional().describe("Web page URL to fetch, extract, and save"),
|
|
129
|
-
title: z.string().max(500).optional().describe("Optional custom title"),
|
|
130
|
-
contentHtml: z.string().optional().describe("Optional pre-rendered HTML content"),
|
|
131
|
-
textContent: z.string().optional().describe("Optional plain text or markdown clipping"),
|
|
132
|
-
note: z.string().max(20000).optional().describe("Optional note or summary attached to the saved item"),
|
|
189
|
+
url: mcpUrlSchema.optional().describe("Web page URL to fetch, extract via Readability, and save"),
|
|
190
|
+
title: z.string().max(500).optional().describe("Optional custom title for the saved inbox item"),
|
|
191
|
+
contentHtml: z.string().optional().describe("Optional pre-rendered HTML content for the clipping"),
|
|
192
|
+
textContent: z.string().optional().describe("Optional plain text or markdown clipping content"),
|
|
193
|
+
note: z.string().max(20000).optional().describe("Optional personal note or editorial summary attached to the saved item"),
|
|
133
194
|
},
|
|
134
195
|
}, async ({ url, title, contentHtml, textContent, note }) => {
|
|
135
196
|
if (!url && !contentHtml && !textContent) {
|
|
@@ -156,22 +217,27 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
156
217
|
});
|
|
157
218
|
server.registerTool("list_folders", {
|
|
158
219
|
title: "List folders / categories",
|
|
159
|
-
description: "Lists all feed categories/folders created by the user, including feed and unread counts.",
|
|
220
|
+
description: "Lists all feed categories/folders created by the current user, including feed counts and unread article counts per folder. Safe read-only operation.",
|
|
221
|
+
annotations: readOnlyAnnotations,
|
|
160
222
|
inputSchema: {},
|
|
161
223
|
}, async () => textResult(listFoldersForUser(userId)));
|
|
162
224
|
if (scope === "write")
|
|
163
225
|
server.registerTool("create_folder", {
|
|
164
|
-
title: "Create folder",
|
|
165
|
-
description: "Creates a new category
|
|
166
|
-
|
|
226
|
+
title: "Create a feed folder",
|
|
227
|
+
description: "Creates a new category folder to organize feed subscriptions. Requires write scope. Returns the created folder object with its assigned id, name, and position. Folders can be assigned to feeds using move_feed_to_folder.",
|
|
228
|
+
annotations: writeAdditiveAnnotations,
|
|
229
|
+
inputSchema: {
|
|
230
|
+
name: z.string().trim().min(1).max(100).describe("The unique display name for the new folder (1 to 100 characters)"),
|
|
231
|
+
},
|
|
167
232
|
}, async ({ name }) => textResult(createFolder(userId, name)));
|
|
168
233
|
if (scope === "write")
|
|
169
234
|
server.registerTool("move_feed_to_folder", {
|
|
170
235
|
title: "Move feed to folder",
|
|
171
|
-
description: "Assigns a feed to a folder, or removes it from all folders if folderId is null.",
|
|
236
|
+
description: "Assigns a subscribed feed to a folder, or removes it from all folders (unfiled) if folderId is null. Requires write scope. Returns { ok: true } on success.",
|
|
237
|
+
annotations: writeAdditiveIdempotentAnnotations,
|
|
172
238
|
inputSchema: {
|
|
173
|
-
feedId: z.number().int().positive(),
|
|
174
|
-
folderId: z.number().int().positive().nullable(),
|
|
239
|
+
feedId: z.number().int().positive().describe("The numeric ID of the subscribed feed to move"),
|
|
240
|
+
folderId: z.number().int().positive().nullable().describe("The target folder ID, or null to move the feed to unfiled (root level)"),
|
|
175
241
|
},
|
|
176
242
|
}, async ({ feedId, folderId }) => {
|
|
177
243
|
if (!isUserSubscribed(userId, feedId))
|
|
@@ -184,15 +250,21 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
184
250
|
if (scope === "write")
|
|
185
251
|
server.registerTool("update_feed", {
|
|
186
252
|
title: "Update feed settings",
|
|
187
|
-
description: "
|
|
253
|
+
description: "Updates subscription settings for a feed: custom display name, poll interval, full-text extraction policy, push notification preference, badge counter inclusion, or updates the feed URL if the publisher relocated. Returns the updated subscription record. For API documentation, see https://github.com/visualfusion/feedkeeper.",
|
|
254
|
+
annotations: {
|
|
255
|
+
readOnlyHint: false,
|
|
256
|
+
destructiveHint: false,
|
|
257
|
+
idempotentHint: true,
|
|
258
|
+
openWorldHint: true,
|
|
259
|
+
},
|
|
188
260
|
inputSchema: {
|
|
189
|
-
feedId: z.number().int().positive(),
|
|
190
|
-
url: mcpUrlSchema.optional().describe("New feed URL or website URL
|
|
191
|
-
label: z.string().max(200).nullable().optional().describe("Custom display name; null or empty
|
|
192
|
-
pollIntervalMinutes: z.number().int().positive().max(10_080).optional(),
|
|
193
|
-
fullText: z.enum(["auto", "never"]).optional().describe("auto
|
|
194
|
-
notify: z.boolean().optional().describe("
|
|
195
|
-
badge: z.boolean().optional().describe("
|
|
261
|
+
feedId: z.number().int().positive().describe("The numeric ID of the subscribed feed to update"),
|
|
262
|
+
url: mcpUrlSchema.optional().describe("New feed URL or website URL if the feed moved (auto-discovered and validated)"),
|
|
263
|
+
label: z.string().max(200).nullable().optional().describe("Custom display name; pass null or empty string to restore the original feed title"),
|
|
264
|
+
pollIntervalMinutes: z.number().int().positive().max(10_080).optional().describe("Poll interval in minutes (subject to server minimum)"),
|
|
265
|
+
fullText: z.enum(["auto", "never"]).optional().describe("'auto' allows the reader to fetch full articles; 'never' always retains the feed content"),
|
|
266
|
+
notify: z.boolean().optional().describe("Whether to send push notifications to user devices when new articles arrive"),
|
|
267
|
+
badge: z.boolean().optional().describe("Whether to count unread articles from this feed in the app icon badge number"),
|
|
196
268
|
},
|
|
197
269
|
}, async ({ feedId, url, label, pollIntervalMinutes, fullText, notify, badge }) => {
|
|
198
270
|
if (url && !hasUserCapability(userId, "sync"))
|
|
@@ -223,9 +295,13 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
223
295
|
});
|
|
224
296
|
if (scope === "write")
|
|
225
297
|
server.registerTool("rename_folder", {
|
|
226
|
-
title: "Rename folder",
|
|
227
|
-
description: "Renames
|
|
228
|
-
|
|
298
|
+
title: "Rename a feed folder",
|
|
299
|
+
description: "Renames an existing feed category folder for the current user. Requires write scope. Returns the updated folder record { id, name, position }. Returns error if folderId is not found or name is already taken.",
|
|
300
|
+
annotations: writeAdditiveIdempotentAnnotations,
|
|
301
|
+
inputSchema: {
|
|
302
|
+
folderId: z.number().int().positive().describe("The numeric ID of the folder to rename"),
|
|
303
|
+
name: z.string().trim().min(1).max(100).describe("The new unique display name for the folder (1 to 100 characters)"),
|
|
304
|
+
},
|
|
229
305
|
}, async ({ folderId, name }) => {
|
|
230
306
|
if (!findFolderById(userId, folderId))
|
|
231
307
|
return errorResult("folder_not_found");
|
|
@@ -238,27 +314,51 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
238
314
|
});
|
|
239
315
|
if (scope === "write")
|
|
240
316
|
server.registerTool("delete_folder", {
|
|
241
|
-
title: "Delete folder",
|
|
242
|
-
description: "Deletes a
|
|
243
|
-
|
|
317
|
+
title: "Delete a feed folder",
|
|
318
|
+
description: "Deletes a feed category folder. Subscribed feeds inside the folder remain intact and are moved to the root level (unfiled). Destructive action for the folder organization. Returns { ok: true } on success.",
|
|
319
|
+
annotations: writeDestructiveAnnotations,
|
|
320
|
+
inputSchema: {
|
|
321
|
+
folderId: z.number().int().positive().describe("The numeric ID of the folder to delete"),
|
|
322
|
+
},
|
|
244
323
|
}, async ({ folderId }) => {
|
|
245
324
|
if (!findFolderById(userId, folderId))
|
|
246
325
|
return errorResult("folder_not_found");
|
|
247
326
|
deleteFolder(userId, folderId);
|
|
248
327
|
return textResult({ ok: true });
|
|
249
328
|
});
|
|
329
|
+
server.registerTool("get_digest", {
|
|
330
|
+
title: "Digest of recent articles grouped by feed",
|
|
331
|
+
description: "Returns recent articles grouped by subscribed feed with short summaries (newest first). This is the fastest and most token-efficient way to scan what is new. Defaults to unread articles. Do NOT use this tool for pagination, full text, or deep filtering—use list_items for cursor pagination or get_new_items for unread filtering, and follow up with get_item for full article bodies.",
|
|
332
|
+
annotations: readOnlyAnnotations,
|
|
333
|
+
inputSchema: {
|
|
334
|
+
feedId: z.number().int().positive().optional().describe("Optional feed ID to limit the digest to a single feed"),
|
|
335
|
+
folderId: z.number().int().positive().optional().describe("Optional folder ID to limit the digest to feeds in that folder"),
|
|
336
|
+
unreadOnly: z.boolean().optional().describe("When true (default), includes only unread articles; set false to include read articles"),
|
|
337
|
+
hours: z.number().int().positive().max(720).optional().describe("Only include articles published in the last N hours (e.g. 24)"),
|
|
338
|
+
since: dateInput.optional().describe("Only articles published at or after this ISO date or date-time (overrides hours)"),
|
|
339
|
+
maxItemsPerFeed: z.number().int().positive().max(20).optional().describe("Maximum number of articles to include per feed (default: 5)"),
|
|
340
|
+
snippetChars: z.number().int().positive().max(1000).optional().describe("Maximum character length of each article summary snippet (default: 200)"),
|
|
341
|
+
},
|
|
342
|
+
}, async (args) => textResult(buildDigest(userId, args)));
|
|
343
|
+
server.registerTool("get_overview", {
|
|
344
|
+
title: "Account overview and reading statistics",
|
|
345
|
+
description: "Returns account-wide statistics: total subscribed feeds, total unread articles, saved/bookmarked count, top feeds with the most unread items, folder unread counts, and feeds currently experiencing poll failures. Safe read-only overview.",
|
|
346
|
+
annotations: readOnlyAnnotations,
|
|
347
|
+
inputSchema: {},
|
|
348
|
+
}, async () => textResult(buildOverview(userId)));
|
|
250
349
|
server.registerTool("get_new_items", {
|
|
251
|
-
title: "
|
|
252
|
-
description: "Returns unread
|
|
350
|
+
title: "List unread articles with optional filters",
|
|
351
|
+
description: "Returns a flat list of unread articles matching specified filters (feed, folder, search query, bookmarked status, date range). Use this tool when you specifically need unread articles as a flat list or need article HTML content. Unlike get_digest, articles are flat rather than grouped. Unlike list_items, this tool returns only unread articles and does not use cursors. Follow up with get_item for individual full articles.",
|
|
352
|
+
annotations: readOnlyAnnotations,
|
|
253
353
|
inputSchema: {
|
|
254
|
-
feedId: z.number().int().positive().optional(),
|
|
255
|
-
folderId: z.number().int().positive().optional(),
|
|
256
|
-
search: z.string().max(200).optional(),
|
|
257
|
-
bookmarkedOnly: z.boolean().optional(),
|
|
354
|
+
feedId: z.number().int().positive().optional().describe("Optional feed ID filter"),
|
|
355
|
+
folderId: z.number().int().positive().optional().describe("Optional folder ID filter"),
|
|
356
|
+
search: z.string().max(200).optional().describe("Optional search phrase to match against title or summary"),
|
|
357
|
+
bookmarkedOnly: z.boolean().optional().describe("When true, only returns unread articles that are bookmarked"),
|
|
258
358
|
...publishedRange,
|
|
259
|
-
limit: z.number().int().positive().max(200).optional(),
|
|
260
|
-
includeContent: z.boolean().optional().describe("
|
|
261
|
-
snippetChars: z.number().int().positive().max(2000).optional().describe("
|
|
359
|
+
limit: z.number().int().positive().max(200).optional().describe("Maximum number of unread items to return (1 to 200, default: 50)"),
|
|
360
|
+
includeContent: z.boolean().optional().describe("When false, omits article HTML content to save tokens (default: true)"),
|
|
361
|
+
snippetChars: z.number().int().positive().max(2000).optional().describe("Truncate each item summary to this many characters"),
|
|
262
362
|
},
|
|
263
363
|
}, async ({ feedId, folderId, search, bookmarkedOnly, since, until, limit, includeContent, snippetChars }) => textResult(listItemsForUser(userId, {
|
|
264
364
|
feedId, folderId, search, bookmarkedOnly, limit, unreadOnly: true, publishedSince: since, publishedUntil: until,
|
|
@@ -267,36 +367,19 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
267
367
|
...(includeContent === false ? {} : { content_html, full_content_html }),
|
|
268
368
|
content_snippet: snippetChars ? truncate(item.content_snippet, snippetChars) : item.content_snippet,
|
|
269
369
|
}))));
|
|
270
|
-
server.registerTool("get_digest", {
|
|
271
|
-
title: "Digest of new articles",
|
|
272
|
-
description: "Returns articles grouped by feed with short snippets, newest first: the cheapest way to see what is new. Defaults to unread articles. Use hours (e.g. 24) or since to limit the period, and maxItemsPerFeed / snippetChars to control size. Follow up with get_item for the full article.",
|
|
273
|
-
inputSchema: {
|
|
274
|
-
feedId: z.number().int().positive().optional(),
|
|
275
|
-
folderId: z.number().int().positive().optional(),
|
|
276
|
-
unreadOnly: z.boolean().optional().describe("Include read articles too when false (default: true)"),
|
|
277
|
-
hours: z.number().int().positive().max(720).optional().describe("Only articles published in the last N hours"),
|
|
278
|
-
since: dateInput.optional().describe("Only articles published at or after this ISO date or date-time (overrides hours)"),
|
|
279
|
-
maxItemsPerFeed: z.number().int().positive().max(20).optional().describe("Articles listed per feed (default: 5)"),
|
|
280
|
-
snippetChars: z.number().int().positive().max(1000).optional().describe("Length of each snippet (default: 200)"),
|
|
281
|
-
},
|
|
282
|
-
}, async (args) => textResult(buildDigest(userId, args)));
|
|
283
|
-
server.registerTool("get_overview", {
|
|
284
|
-
title: "Account overview",
|
|
285
|
-
description: "Returns counts for the whole account: subscribed feeds, unread and saved articles, the feeds with the most unread articles, folders with their unread counts, and feeds that are failing.",
|
|
286
|
-
inputSchema: {},
|
|
287
|
-
}, async () => textResult(buildOverview(userId)));
|
|
288
370
|
server.registerTool("list_items", {
|
|
289
|
-
title: "
|
|
290
|
-
description: "Lists
|
|
371
|
+
title: "Paginate items chronologically with cursors",
|
|
372
|
+
description: "Lists articles chronologically with bidirectional cursor-based pagination. Use this tool for comprehensive browsing or historical paging through both read and unread articles. Pass nextCursor as 'before' to page backwards into older history, or newestCursor as 'after' to stream newly added items. Do NOT use for quick digests (use get_digest) or unread-only triage (use get_new_items).",
|
|
373
|
+
annotations: readOnlyAnnotations,
|
|
291
374
|
inputSchema: {
|
|
292
|
-
feedId: z.number().int().positive().optional(),
|
|
293
|
-
folderId: z.number().int().positive().optional(),
|
|
294
|
-
unreadOnly: z.boolean().optional(),
|
|
295
|
-
bookmarkedOnly: z.boolean().optional(),
|
|
296
|
-
before: z.string().max(256).optional(),
|
|
297
|
-
after: z.string().max(256).optional(),
|
|
375
|
+
feedId: z.number().int().positive().optional().describe("Optional feed ID filter"),
|
|
376
|
+
folderId: z.number().int().positive().optional().describe("Optional folder ID filter"),
|
|
377
|
+
unreadOnly: z.boolean().optional().describe("When true, only lists unread articles; default is false (all articles)"),
|
|
378
|
+
bookmarkedOnly: z.boolean().optional().describe("When true, only lists bookmarked articles"),
|
|
379
|
+
before: z.string().max(256).optional().describe("Cursor to fetch older items (pass nextCursor from a previous page)"),
|
|
380
|
+
after: z.string().max(256).optional().describe("Cursor to fetch newer items (pass newestCursor from a previous page)"),
|
|
298
381
|
...publishedRange,
|
|
299
|
-
limit: z.number().int().positive().max(100).optional(),
|
|
382
|
+
limit: z.number().int().positive().max(100).optional().describe("Number of items to fetch per page (1 to 100, default: 20)"),
|
|
300
383
|
},
|
|
301
384
|
}, async (args) => {
|
|
302
385
|
try {
|
|
@@ -307,14 +390,15 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
307
390
|
}
|
|
308
391
|
});
|
|
309
392
|
server.registerTool("get_item", {
|
|
310
|
-
title: "Get
|
|
311
|
-
description: "Returns
|
|
393
|
+
title: "Get single article content and metadata",
|
|
394
|
+
description: "Returns full metadata and stored content (HTML or plain text) for a single subscribed article by its numeric itemId. Content is chunked at 40,000 characters; use offset and content.revision to paginate large articles. If an article only has an RSS teaser/summary and full web text is desired, call fetch_full_text.",
|
|
395
|
+
annotations: readOnlyAnnotations,
|
|
312
396
|
inputSchema: {
|
|
313
|
-
itemId: z.number().int().positive(),
|
|
314
|
-
maxChars: z.number().int().positive().max(40_000).optional().describe("
|
|
315
|
-
format: z.enum(["html", "text"]).optional().describe("
|
|
316
|
-
offset: z.number().int().nonnegative().max(10_000_000).optional(),
|
|
317
|
-
revision: z.number().int().positive().optional().describe("
|
|
397
|
+
itemId: z.number().int().positive().describe("The numeric ID of the article to retrieve"),
|
|
398
|
+
maxChars: z.number().int().positive().max(40_000).optional().describe("Maximum character length of content to return (up to 40,000)"),
|
|
399
|
+
format: z.enum(["html", "text"]).optional().describe("Format of content: 'html' for sanitized HTML, 'text' for plain text extraction"),
|
|
400
|
+
offset: z.number().int().nonnegative().max(10_000_000).optional().describe("Character offset for reading subsequent chunks of large articles"),
|
|
401
|
+
revision: z.number().int().positive().optional().describe("Revision token returned in previous chunk to ensure pagination consistency"),
|
|
318
402
|
},
|
|
319
403
|
}, async ({ itemId, maxChars, offset, revision, format }) => {
|
|
320
404
|
try {
|
|
@@ -327,11 +411,17 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
327
411
|
});
|
|
328
412
|
if (scope === "write")
|
|
329
413
|
server.registerTool("fetch_full_text", {
|
|
330
|
-
title: "
|
|
331
|
-
description: "Downloads the full article from
|
|
414
|
+
title: "Extract full web article text",
|
|
415
|
+
description: "Downloads and extracts the clean, full-length article text from the original publisher website via Readability, permanently caching it on the server and returning it. Use this tool ONLY when get_item indicates that the feed provided only an excerpt or teaser. If full text is already cached, it returns cached content unless force=true is passed.",
|
|
416
|
+
annotations: {
|
|
417
|
+
readOnlyHint: false,
|
|
418
|
+
destructiveHint: false,
|
|
419
|
+
idempotentHint: true,
|
|
420
|
+
openWorldHint: true,
|
|
421
|
+
},
|
|
332
422
|
inputSchema: {
|
|
333
|
-
itemId: z.number().int().positive(),
|
|
334
|
-
force: z.boolean().optional().describe("
|
|
423
|
+
itemId: z.number().int().positive().describe("The numeric ID of the article whose full web content should be extracted"),
|
|
424
|
+
force: z.boolean().optional().describe("When true, forces re-downloading and re-extracting from the web even if already cached"),
|
|
335
425
|
},
|
|
336
426
|
}, async ({ itemId, force }) => {
|
|
337
427
|
if (!hasUserCapability(userId, "fulltext"))
|
|
@@ -348,29 +438,30 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
348
438
|
});
|
|
349
439
|
});
|
|
350
440
|
server.registerTool("search_items", {
|
|
351
|
-
title: "Search
|
|
352
|
-
description: "Searches
|
|
441
|
+
title: "Search articles by keyword or phrase",
|
|
442
|
+
description: "Searches article titles and summaries using SQLite FTS5 full-text search across all accessible items. Returns matching articles matching the query phrase, with optional feed, folder, bookmark, and date filters. Safe read-only search.",
|
|
443
|
+
annotations: readOnlyAnnotations,
|
|
353
444
|
inputSchema: {
|
|
354
|
-
query: z.string().min(1).max(200),
|
|
355
|
-
feedId: z.number().int().positive().optional(),
|
|
356
|
-
folderId: z.number().int().positive().optional(),
|
|
357
|
-
bookmarkedOnly: z.boolean().optional(),
|
|
445
|
+
query: z.string().min(1).max(200).describe("The search term or phrase to find in article titles and content summaries"),
|
|
446
|
+
feedId: z.number().int().positive().optional().describe("Optional feed ID filter"),
|
|
447
|
+
folderId: z.number().int().positive().optional().describe("Optional folder ID filter"),
|
|
448
|
+
bookmarkedOnly: z.boolean().optional().describe("When true, restricts search to bookmarked items"),
|
|
358
449
|
...publishedRange,
|
|
359
|
-
limit: z.number().int().positive().max(200).optional(),
|
|
450
|
+
limit: z.number().int().positive().max(200).optional().describe("Maximum number of search results to return (1 to 200, default: 50)"),
|
|
360
451
|
},
|
|
361
452
|
}, async ({ query, feedId, folderId, bookmarkedOnly, since, until, limit }) => textResult(listItemsForUser(userId, {
|
|
362
453
|
search: query, feedId, folderId, bookmarkedOnly, limit, publishedSince: since, publishedUntil: until,
|
|
363
454
|
})));
|
|
364
455
|
const itemActions = [
|
|
365
|
-
["mark_read", "Mark
|
|
366
|
-
["mark_unread", "Mark
|
|
367
|
-
["bookmark_item", "Bookmark
|
|
456
|
+
["mark_read", "Mark articles as read", "Marks one or more subscribed articles as read. Accepts a single itemId or an array of itemIds for batch processing. Idempotent: already-read articles remain read. Returns { ok: true, updated: number } where updated is the count of items that actually transitioned from unread to read.", writeAdditiveIdempotentAnnotations, markItemRead],
|
|
457
|
+
["mark_unread", "Mark articles as unread", "Marks one or more subscribed articles as unread. Accepts a single itemId or an array of itemIds for batch processing. Idempotent. Returns { ok: true, updated: number } where updated is the count of items that actually transitioned to unread.", writeAdditiveIdempotentAnnotations, markItemUnread],
|
|
458
|
+
["bookmark_item", "Bookmark articles for later", "Bookmarks (stars) one or more articles for permanent retention. Bookmarked articles retain full text and images and survive automatic retention cleanup and feed unsubscription. Idempotent. Returns { ok: true, updated: number }.", writeAdditiveIdempotentAnnotations, (userId, itemId) => {
|
|
368
459
|
const changed = bookmarkItem(userId, itemId);
|
|
369
460
|
if (changed)
|
|
370
461
|
scheduleArchive(itemId);
|
|
371
462
|
return changed;
|
|
372
463
|
}],
|
|
373
|
-
["unbookmark_item", "Remove bookmarks", "Removes
|
|
464
|
+
["unbookmark_item", "Remove article bookmarks", "Removes bookmark status from one or more articles. Safely triggers archive pruning for unreferenced cached assets. Idempotent. Returns { ok: true, updated: number }.", writeDestructiveAnnotations, (userId, itemId) => {
|
|
374
465
|
const changed = unbookmarkItem(userId, itemId);
|
|
375
466
|
if (changed)
|
|
376
467
|
pruneArchive();
|
|
@@ -378,59 +469,68 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
378
469
|
}],
|
|
379
470
|
];
|
|
380
471
|
if (scope === "write")
|
|
381
|
-
for (const [name, title, description, change] of itemActions) {
|
|
382
|
-
server.registerTool(name, { title, description, inputSchema: itemSelection }, async (args) => {
|
|
472
|
+
for (const [name, title, description, annotations, change] of itemActions) {
|
|
473
|
+
server.registerTool(name, { title, description, annotations, inputSchema: itemSelection }, async (args) => {
|
|
383
474
|
if (!hasUserCapability(userId, "sync"))
|
|
384
475
|
return { ...textResult(capabilityDenial(userId, "sync")), isError: true };
|
|
385
476
|
const itemIds = selectedItemIds(args);
|
|
386
477
|
if (itemIds.length === 0)
|
|
387
478
|
return errorResult("Provide itemId or itemIds");
|
|
388
|
-
// `updated` counts items whose state actually changed.
|
|
389
479
|
return textResult({ ok: true, updated: applyToItems(itemIds, (itemId) => change(userId, itemId)) });
|
|
390
480
|
});
|
|
391
481
|
}
|
|
392
482
|
if (scope === "write")
|
|
393
483
|
server.registerTool("mark_all_read", {
|
|
394
|
-
title: "Mark all
|
|
395
|
-
description: "Marks all
|
|
484
|
+
title: "Mark all articles as read",
|
|
485
|
+
description: "Marks all unread articles as read in a single operation. Can be scoped to a single feed or an entire folder. Idempotent. Returns { marked: number } with the count of newly read items.",
|
|
486
|
+
annotations: writeDestructiveAnnotations,
|
|
396
487
|
inputSchema: {
|
|
397
|
-
feedId: z.number().int().positive().optional(),
|
|
398
|
-
folderId: z.number().int().positive().optional(),
|
|
488
|
+
feedId: z.number().int().positive().optional().describe("Optional feed ID to limit the mark-all-read operation to one feed"),
|
|
489
|
+
folderId: z.number().int().positive().optional().describe("Optional folder ID to limit the mark-all-read operation to one folder"),
|
|
399
490
|
},
|
|
400
491
|
}, async ({ feedId, folderId }) => hasUserCapability(userId, "sync")
|
|
401
492
|
? textResult({ marked: markAllRead(userId, { feedId, folderId }) })
|
|
402
493
|
: { ...textResult(capabilityDenial(userId, "sync")), isError: true });
|
|
403
494
|
server.registerTool("list_muted_keywords", {
|
|
404
495
|
title: "List muted keywords",
|
|
405
|
-
description: "Lists all
|
|
496
|
+
description: "Lists all keyword filters configured for the current user. Articles matching any active muted keyword are automatically filtered out from new item views and newspaper editions. Safe read-only.",
|
|
497
|
+
annotations: readOnlyAnnotations,
|
|
406
498
|
inputSchema: {},
|
|
407
499
|
}, async () => textResult(listMutedKeywords(userId)));
|
|
408
500
|
if (scope === "write")
|
|
409
501
|
server.registerTool("add_muted_keyword", {
|
|
410
|
-
title: "Add muted keyword",
|
|
411
|
-
description: "
|
|
412
|
-
|
|
502
|
+
title: "Add a muted keyword filter",
|
|
503
|
+
description: "Adds a new keyword filter rule. Articles whose title or summary contains this keyword (case-insensitive) will be suppressed from feeds and editions. Requires write scope. Returns the created keyword rule { id, keyword, created_at }.",
|
|
504
|
+
annotations: writeAdditiveAnnotations,
|
|
505
|
+
inputSchema: {
|
|
506
|
+
keyword: z.string().trim().min(1).max(100).describe("The keyword phrase to filter out from feeds and editions (1 to 100 characters)"),
|
|
507
|
+
},
|
|
413
508
|
}, async ({ keyword }) => textResult(addMutedKeyword(userId, keyword)));
|
|
414
509
|
if (scope === "write")
|
|
415
510
|
server.registerTool("unmute_keyword", {
|
|
416
|
-
title: "
|
|
417
|
-
description: "
|
|
418
|
-
|
|
511
|
+
title: "Remove a muted keyword filter",
|
|
512
|
+
description: "Removes an existing muted keyword filter by its numeric keywordId. Future and existing articles matching this keyword will once again be visible. Returns { ok: true } on success.",
|
|
513
|
+
annotations: writeDestructiveAnnotations,
|
|
514
|
+
inputSchema: {
|
|
515
|
+
keywordId: z.number().int().positive().describe("The numeric ID of the muted keyword rule to remove"),
|
|
516
|
+
},
|
|
419
517
|
}, async ({ keywordId }) => {
|
|
420
518
|
removeMutedKeyword(userId, keywordId);
|
|
421
519
|
return textResult({ ok: true });
|
|
422
520
|
});
|
|
423
521
|
server.registerTool("export_opml", {
|
|
424
|
-
title: "Export feeds as OPML",
|
|
425
|
-
description: "Exports all subscribed feeds of the current user as an OPML 2.0 XML
|
|
522
|
+
title: "Export feeds as OPML XML",
|
|
523
|
+
description: "Exports all subscribed feeds and folder structures of the current user as an OPML 2.0 XML document. Safe read-only operation.",
|
|
524
|
+
annotations: readOnlyAnnotations,
|
|
426
525
|
inputSchema: {},
|
|
427
526
|
}, async () => ({ content: [{ type: "text", text: generateOpml(userId) }] }));
|
|
428
527
|
if (scope === "write")
|
|
429
528
|
server.registerTool("import_opml", {
|
|
430
|
-
title: "Import feeds from OPML",
|
|
431
|
-
description: "Imports
|
|
529
|
+
title: "Import feeds from OPML XML",
|
|
530
|
+
description: "Imports feed subscriptions and folders from an OPML 2.0 XML string for the current user. Existing subscriptions are preserved. Requires write scope. Returns { imported: number, failed: number, foldersCreated: number }.",
|
|
531
|
+
annotations: writeAdditiveAnnotations,
|
|
432
532
|
inputSchema: {
|
|
433
|
-
opml: z.string().min(1).describe("The OPML XML
|
|
533
|
+
opml: z.string().min(1).describe("The OPML 2.0 XML document string to parse and import"),
|
|
434
534
|
},
|
|
435
535
|
}, async ({ opml }) => {
|
|
436
536
|
if (!hasUserCapability(userId, "sync"))
|
|
@@ -445,10 +545,16 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
445
545
|
});
|
|
446
546
|
if (scope === "write")
|
|
447
547
|
server.registerTool("refresh_feed", {
|
|
448
|
-
title: "Refresh
|
|
449
|
-
description: "Requests an
|
|
548
|
+
title: "Refresh feed poll",
|
|
549
|
+
description: "Requests an immediate poll of a subscribed feed from its origin URL and returns its updated health status, number of new items found, and error state. Respects origin HTTP cache headers and backoff pauses. Returns { success: boolean, newItems: number, error: string | null, deferred: boolean, retryAt: string | null, feed: object }.",
|
|
550
|
+
annotations: {
|
|
551
|
+
readOnlyHint: false,
|
|
552
|
+
destructiveHint: false,
|
|
553
|
+
idempotentHint: false,
|
|
554
|
+
openWorldHint: true,
|
|
555
|
+
},
|
|
450
556
|
inputSchema: {
|
|
451
|
-
feedId: z.number().int().positive().describe("The ID of the feed to refresh"),
|
|
557
|
+
feedId: z.number().int().positive().describe("The numeric ID of the subscribed feed to refresh"),
|
|
452
558
|
},
|
|
453
559
|
}, async ({ feedId }) => {
|
|
454
560
|
if (!hasUserCapability(userId, "sync"))
|
|
@@ -488,53 +594,36 @@ export function createMcpServerForUser(userId, scope) {
|
|
|
488
594
|
return { ...textResult(capabilityDenial(userId, capability)), isError: true };
|
|
489
595
|
return editionAction(action);
|
|
490
596
|
};
|
|
491
|
-
server.registerTool("get_native_preferences", {
|
|
492
|
-
title: "Get native reading preferences",
|
|
493
|
-
description: "Returns the user's app-only folder order, newspaper exclusions, preferred sections, time zone and edition size. These settings do not change the web reader.",
|
|
494
|
-
inputSchema: {},
|
|
495
|
-
}, async () => textResult(getNativePreferences(userId)));
|
|
496
597
|
server.registerTool("get_edition", {
|
|
497
|
-
title: "Get current edition",
|
|
498
|
-
description: "Returns the authoritative edition state and revision
|
|
598
|
+
title: "Get current curated newspaper edition",
|
|
599
|
+
description: "Returns the authoritative edition state, publication metadata, article list, and revision number for the user's curated newspaper edition ('Deine Zeitung'). Returns the current revision (even if empty, expired, or dismissed), which must be passed as expectedRevision when calling publish_edition. Safe read-only.",
|
|
600
|
+
annotations: readOnlyAnnotations,
|
|
499
601
|
inputSchema: {},
|
|
500
602
|
}, async () => textResult(getEditionState(userId)));
|
|
501
603
|
server.registerTool("get_edition_candidates", {
|
|
502
|
-
title: "Get
|
|
503
|
-
description: "Returns a bounded shortlist of unread articles from the last
|
|
504
|
-
|
|
604
|
+
title: "Get candidate articles for newspaper curation",
|
|
605
|
+
description: "Use this tool ONLY when preparing to curate a newspaper edition with publish_edition. Returns a bounded shortlist of unread articles from the last 7 days scored for editorial curation, user reading preferences, and current revision. Do NOT use for general reading or browsing (use get_digest or get_new_items instead).",
|
|
606
|
+
annotations: readOnlyAnnotations,
|
|
607
|
+
inputSchema: {
|
|
608
|
+
limit: z.number().int().min(1).max(200).default(100).describe("Maximum number of candidate articles to evaluate (1 to 200, default: 100)"),
|
|
609
|
+
},
|
|
505
610
|
}, async ({ limit }) => capabilityAction("editions", () => ({ preferences: getNativePreferences(userId), current: getEditionState(userId), candidates: editionCandidates(userId, new Date(), limit) })));
|
|
506
|
-
if (scope === "write")
|
|
507
|
-
server.registerTool("update_native_preferences", {
|
|
508
|
-
title: "Update native reading preferences",
|
|
509
|
-
description: "Patches app-only preferences using expectedRevision and a UUID requestId. Retried requests return their original result; conflicts include the current settings. Folder IDs must belong to the current user. Never changes the web folder list or stream.",
|
|
510
|
-
inputSchema: preferencePatchSchema.shape,
|
|
511
|
-
}, async (input) => capabilityAction("sync", () => patchNativePreferences(userId, input)));
|
|
512
611
|
if (scope === "write")
|
|
513
612
|
server.registerTool("publish_edition", {
|
|
514
|
-
title: "Publish curated edition",
|
|
515
|
-
description: "Publishes an ordered
|
|
613
|
+
title: "Publish curated newspaper edition",
|
|
614
|
+
description: "Publishes an ordered selection of 1 to 24 article IDs as the user's official curated edition ('Deine Zeitung'). The published edition remains available until the next edition is published or expires. Pass the revision from get_edition as expectedRevision for optimistic concurrency, and a UUID requestId for idempotent retries. Does NOT alter underlying articles. Requires write scope.",
|
|
615
|
+
annotations: writeAdditiveIdempotentAnnotations,
|
|
516
616
|
inputSchema: publishEditionFields,
|
|
517
617
|
}, async (input) => capabilityAction("editions", () => publishCuratedEdition(userId, input)));
|
|
518
|
-
if (scope === "write")
|
|
519
|
-
server.registerTool("generate_edition", {
|
|
520
|
-
title: "Get the latest curated edition",
|
|
521
|
-
description: "Compatibility alias for reading the latest curated publication. It never selects articles or publishes an edition. force is accepted for older clients but does not create a replacement; use publish_edition to publish a new curated selection.",
|
|
522
|
-
inputSchema: ensureEditionSchema.shape,
|
|
523
|
-
}, async (input) => capabilityAction("editions", () => {
|
|
524
|
-
const parsed = ensureEditionSchema.safeParse(input);
|
|
525
|
-
if (!parsed.success)
|
|
526
|
-
throw new NativeError("invalid_input");
|
|
527
|
-
const current = getEditionState(userId);
|
|
528
|
-
if (parsed.data.expectedRevision !== undefined && parsed.data.expectedRevision !== current.revision) {
|
|
529
|
-
throw new NativeError("revision_conflict", 409, current);
|
|
530
|
-
}
|
|
531
|
-
return { edition: getEdition(userId), current };
|
|
532
|
-
}));
|
|
533
618
|
if (scope === "write")
|
|
534
619
|
server.registerTool("dismiss_edition", {
|
|
535
|
-
title: "Dismiss the current edition",
|
|
536
|
-
description: "Explicitly dismisses the current edition
|
|
537
|
-
|
|
620
|
+
title: "Dismiss the current newspaper edition",
|
|
621
|
+
description: "Explicitly dismisses the current curated edition so it is no longer shown as active. Requires a UUID requestId and the current revision as expectedRevision for conflict detection. Requires write scope. Returns { ok: true } on success.",
|
|
622
|
+
annotations: writeDestructiveAnnotations,
|
|
623
|
+
inputSchema: {
|
|
624
|
+
requestId: z.uuid().describe("Unique idempotency UUID for this dismiss operation"),
|
|
625
|
+
expectedRevision: z.number().int().min(0).describe("The current edition revision number obtained from get_edition"),
|
|
626
|
+
},
|
|
538
627
|
}, async (input) => editionAction(() => dismissEdition(userId, input)));
|
|
539
628
|
registerPromptsAndResources(server, userId, scope);
|
|
540
629
|
return server;
|
|
@@ -69,15 +69,15 @@ function writeEdition(userId, itemIds, source, expiry, now, title = null, summar
|
|
|
69
69
|
return serialize(storedEdition(userId));
|
|
70
70
|
}
|
|
71
71
|
export const publishEditionFields = {
|
|
72
|
-
itemIds: z.array(z.number().int().positive()).min(1).max(24),
|
|
73
|
-
expiresAt: z.string().datetime({ offset: true }).optional(),
|
|
74
|
-
durationHours: z.number().positive().max(168).optional(),
|
|
75
|
-
expectedRevision: z.number().int().min(0).optional(),
|
|
76
|
-
requestId: z.uuid().optional(),
|
|
77
|
-
title: z.string().trim().min(1).max(200).optional(),
|
|
78
|
-
summary: z.string().trim().min(1).max(2000).optional(),
|
|
79
|
-
overview: overviewSchema.optional(),
|
|
80
|
-
layout: editionLayoutSchema.optional(),
|
|
72
|
+
itemIds: z.array(z.number().int().positive()).min(1).max(24).describe("Ordered list of 1 to 24 article IDs to include in this edition"),
|
|
73
|
+
expiresAt: z.string().datetime({ offset: true }).optional().describe("ISO datetime when this edition expires and a new issue is due (max 7 days)"),
|
|
74
|
+
durationHours: z.number().positive().max(168).optional().describe("Duration in hours until this edition expires (1 to 168 hours, default: 24)"),
|
|
75
|
+
expectedRevision: z.number().int().min(0).optional().describe("The revision from get_edition to ensure optimistic concurrency and avoid conflicts"),
|
|
76
|
+
requestId: z.uuid().optional().describe("Idempotency key (UUID v4) to safely retry publication without duplicate processing"),
|
|
77
|
+
title: z.string().trim().min(1).max(200).optional().describe("Optional editorial headline for this edition (e.g. 'Monday Morning Briefing')"),
|
|
78
|
+
summary: z.string().trim().min(1).max(2000).optional().describe("Optional editorial summary or introduction text for the edition"),
|
|
79
|
+
overview: overviewSchema.optional().describe("Optional structured briefing sections grouping items with editorial commentary"),
|
|
80
|
+
layout: editionLayoutSchema.optional().describe("Optional visual layout specification (character and editorial blocks)"),
|
|
81
81
|
};
|
|
82
82
|
const publishSchema = z.object(publishEditionFields).strict().refine((input) => !(input.expiresAt && input.durationHours), "Use expiresAt or durationHours, not both");
|
|
83
83
|
/** Legacy ensure requests read the latest publication; they never select or publish articles. */
|