@cyanheads/biorxiv-mcp-server 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/AGENTS.md +12 -8
  2. package/CLAUDE.md +12 -8
  3. package/Dockerfile +3 -3
  4. package/README.md +31 -30
  5. package/changelog/0.4.x/0.4.1.md +27 -0
  6. package/changelog/0.4.x/0.4.2.md +34 -0
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts +8 -6
  10. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts.map +1 -1
  11. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js +94 -28
  12. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +24 -9
  14. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +137 -52
  16. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +22 -9
  18. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +78 -33
  20. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.d.ts +25 -5
  22. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.js +130 -22
  24. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +5 -2
  26. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js +51 -34
  28. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts +24 -7
  30. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js +78 -38
  32. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/definitions/index.d.ts +47 -19
  34. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  35. package/dist/services/biorxiv/biorxiv-service.d.ts +51 -31
  36. package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
  37. package/dist/services/biorxiv/biorxiv-service.js +132 -74
  38. package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
  39. package/dist/services/biorxiv/types.d.ts +33 -6
  40. package/dist/services/biorxiv/types.d.ts.map +1 -1
  41. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts +9 -6
  42. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
  43. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +178 -23
  44. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
  45. package/dist/services/europe-pmc/europe-pmc-service.d.ts +26 -6
  46. package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
  47. package/dist/services/europe-pmc/europe-pmc-service.js +124 -32
  48. package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -1
  49. package/dist/services/shared.d.ts +105 -5
  50. package/dist/services/shared.d.ts.map +1 -1
  51. package/dist/services/shared.js +191 -9
  52. package/dist/services/shared.js.map +1 -1
  53. package/dist/services/upstream-text-tables.d.ts +11 -1
  54. package/dist/services/upstream-text-tables.d.ts.map +1 -1
  55. package/dist/services/upstream-text-tables.js +42 -1
  56. package/dist/services/upstream-text-tables.js.map +1 -1
  57. package/package.json +6 -6
  58. package/server.json +3 -3
@@ -9,24 +9,38 @@
9
9
  * Fans out to bioRxiv and medRxiv when server="both", with one input cursor
10
10
  * and per-server pagination state: the servers hold different row counts, so
11
11
  * one cursor can be inside one server's rows and past the end of the other's.
12
- * Pages hold 100 rows per server (API-fixed). Upstream answers an empty
13
- * interval and a cursor at or past the last row identically — "no articles
14
- * found", no total — so dates are validated before any call, a zero-row page
15
- * at cursor 0 reports total 0, and one at a later cursor is flagged exhausted
16
- * with no total rather than claiming the interval is empty.
12
+ * The API serves 100 rows a page and takes no size parameter, so each server
13
+ * returns the first `limit` rows (default 25) of its page, sliced in the
14
+ * service before rows are normalized, and nextCursor advances by the upstream
15
+ * rows served; a limit above 100 serves the whole page and says so. Upstream
16
+ * answers an empty interval and a cursor at or past the last row identically —
17
+ * "no articles found", no total — so dates are validated before any call, a
18
+ * zero-row page at cursor 0 reports total 0, and one at a later cursor is
19
+ * flagged exhausted with no total rather than claiming the interval is empty.
17
20
  *
18
21
  * A server that did not answer is named in failed[] and the notice; when no
19
22
  * server answered the call raises a retryable error instead of an empty page.
20
23
  * Abstracts are about three quarters of a page and are omitted unless
21
24
  * include_abstract is true; nothing else in a record changes.
25
+ *
26
+ * A publisher filter (a journal DOI prefix) reads bioRxiv's /publisher listing,
27
+ * which pages like /pubs. No medRxiv equivalent exists, so it narrows
28
+ * server="both" to bioRxiv with a notice and is rejected with server="medrxiv";
29
+ * a prefix the API cannot read raises invalid_publisher rather than reading as
30
+ * an empty page. Its rows carry no journal name, authors, or abstract, and the
31
+ * notice says so rather than leaving the gap unexplained.
22
32
  * @module mcp-server/tools/definitions/biorxiv-list-published-versions.tool
23
33
  */
24
34
  import { tool, z } from '@cyanheads/mcp-ts-core';
25
35
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
26
36
  import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.js';
27
- import { describeWait, escapeMarkdown, findRateLimit, isValidCalendarDate, } from '../../../services/shared.js';
37
+ import { describeWait, escapeMarkdown, findRateLimit, isValidCalendarDate, startCallDeadline, } from '../../../services/shared.js';
28
38
  const SERVERS = ['biorxiv', 'medrxiv'];
29
39
  const SERVER_LABEL = { biorxiv: 'bioRxiv', medrxiv: 'medRxiv' };
40
+ /** Rows api.biorxiv.org serves per `/pubs` interval page — the most one call can return per server. */
41
+ const UPSTREAM_PAGE_ROWS = 100;
42
+ /** A blank or whitespace-only value from a form client is "unset", never a value to validate; any other is trimmed. */
43
+ const blankAsUnset = (schema) => z.preprocess((value) => (typeof value === 'string' ? value.trim() || undefined : value), schema);
30
44
  function errorMessage(reason) {
31
45
  return reason instanceof Error ? reason.message : String(reason);
32
46
  }
@@ -72,7 +86,7 @@ const paginationEntry = (label) => z
72
86
  nextCursor: z
73
87
  .number()
74
88
  .optional()
75
- .describe('Cursor for the next page, when rows remain past this one.'),
89
+ .describe(`Cursor for the next page, when rows remain on ${label} past this one: this page's cursor plus the rows it served. Pass it as cursor to continue, at any limit.`),
76
90
  exhausted: z
77
91
  .boolean()
78
92
  .optional()
@@ -82,29 +96,40 @@ const paginationEntry = (label) => z
82
96
  .describe(`${label} pagination state. Present when ${label} was queried and answered.`);
83
97
  export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_versions', {
84
98
  title: 'List Published Journal Versions',
85
- description: 'List preprints that appeared as journal articles within a journal publication-date interval, each with its journal DOI, journal name, publication date, and preprint metadata — the same record biorxiv_get_published_version returns for one DOI. The dates filter on journal publication, not preprint posting, so most rows were posted months or years earlier; use biorxiv_list_recent for preprints posted in an interval. Returns up to 100 publications per server per page (fixed by the API); pass `cursor` as an integer offset (0, 100, 200, …) to step through additional pages. When server="both" (default), per-server pagination state is returned separately, since one cursor can be past the end of one server and inside the other — to continue a single server, pass its `nextCursor` with `server` set to that server. One server failing under server="both" does not abort the call: the other server\'s page is still returned and the failed one is named in `failed[]`. Every attempted server failing raises a retryable upstream_unavailable (or rate_limited) error rather than an empty page. Abstracts are omitted by default to keep the page small — pass include_abstract: true for the whole page. Every preprintDoi, 10.1101/ and 10.64898/ alike, is accepted by biorxiv_get_preprint and the other DOI tools.',
99
+ description: 'List preprints that appeared as journal articles within a journal publication-date interval, each with its journal DOI, journal name, publication date, and preprint metadata — the same record biorxiv_get_published_version returns for one DOI. The dates filter on journal publication, not preprint posting, so most rows were posted months or years earlier; use biorxiv_list_recent for preprints posted in an interval. `publisher`, a journal DOI prefix such as 10.7554 for eLife, limits the listing to the bioRxiv preprints published under it; those rows carry no journal name, authors, or abstract, and a prefix api.biorxiv.org does not recognize raises invalid_publisher. Returns `limit` publications per server (default 25, up to 100 — the page api.biorxiv.org serves; a larger limit returns 100 and says so). Continue at the `nextCursor` a page returns rather than stepping `cursor` by a fixed amount; `limit: 100` walks an interval in the fewest calls. When server="both" (default), per-server pagination state is returned separately, since one cursor can be past the end of one server and inside the other — to continue a single server, pass its `nextCursor` with `server` set to that server. One server failing under server="both" does not abort the call: the other server\'s page is still returned and the failed one is named in `failed[]`. Every attempted server failing raises a retryable upstream_unavailable (or rate_limited) error rather than an empty page. Abstracts are omitted by default to keep the page small — pass include_abstract: true for the whole page. Every preprintDoi, 10.1101/ and 10.64898/ alike, is accepted by biorxiv_get_preprint and the other DOI tools.',
86
100
  annotations: { readOnlyHint: true, openWorldHint: true },
87
101
  // biorxiv_search_preprints spells its date bounds date_from / date_to.
88
102
  inputAliases: { date_from: 'start_date', date_to: 'end_date' },
89
103
  input: z.object({
90
104
  start_date: z
91
105
  .string()
92
- .regex(/^\d{4}-\d{2}-\d{2}$/)
106
+ .regex(/^\d{4}-\d{2}-\d{2}$/, 'Use YYYY-MM-DD, e.g. 2025-03-04')
93
107
  .describe('Start of the journal publication-date interval (YYYY-MM-DD), inclusive.'),
94
108
  end_date: z
95
109
  .string()
96
- .regex(/^\d{4}-\d{2}-\d{2}$/)
110
+ .regex(/^\d{4}-\d{2}-\d{2}$/, 'Use YYYY-MM-DD, e.g. 2025-03-04')
97
111
  .describe('End of the journal publication-date interval (YYYY-MM-DD), inclusive.'),
98
112
  server: z
99
113
  .enum(['biorxiv', 'medrxiv', 'both'])
100
114
  .default('both')
101
115
  .describe('Preprint server to list. "both" lists bioRxiv and medRxiv in parallel; their rows do not overlap.'),
116
+ publisher: blankAsUnset(z
117
+ .string()
118
+ .regex(/^10\.\d{4,}$/, 'Use the DOI prefix alone, the part before the slash, e.g. 10.7554 for eLife')
119
+ .optional()).describe('Journal publisher filter: the DOI prefix its journal articles share, the part before the slash — "10.7554" for eLife, "10.1016" for Elsevier. Lists only the bioRxiv preprints published under that prefix: medRxiv has no publisher listing, so server="both" queries bioRxiv alone and server="medrxiv" is rejected. Rows listed this way carry no journal name, authors, corresponding author, or abstract.'),
102
120
  cursor: z
103
121
  .number()
104
122
  .int()
105
123
  .min(0)
106
124
  .default(0)
107
- .describe('Integer row offset (0, 100, 200, …), applied to each queried server. Defaults to 0 (first page).'),
125
+ .describe('Integer row offset, applied to each queried server. Defaults to 0 (first page). To continue, pass the nextCursor the previous page returned for that server — it advances by the rows actually served.'),
126
+ limit: z
127
+ .number()
128
+ .int()
129
+ .min(1)
130
+ .max(1000)
131
+ .default(25)
132
+ .describe('Rows to return per queried server, starting at cursor. Defaults to 25. Up to 100, the page api.biorxiv.org serves: a larger value returns 100 rows per server and says so in the notice. limit: 100 walks an interval in the fewest calls.'),
108
133
  include_abstract: z
109
134
  .boolean()
110
135
  .default(false)
@@ -121,7 +146,10 @@ export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_ver
121
146
  .string()
122
147
  .describe('Preprint DOI — input to biorxiv_get_preprint and the other DOI tools.'),
123
148
  publishedDoi: z.string().optional().describe('Journal article DOI.'),
124
- publishedJournal: z.string().optional().describe('Name of the publishing journal.'),
149
+ publishedJournal: z
150
+ .string()
151
+ .optional()
152
+ .describe('Name of the publishing journal. Absent under a publisher filter, whose rows carry none.'),
125
153
  publishedDate: z
126
154
  .string()
127
155
  .optional()
@@ -129,22 +157,25 @@ export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_ver
129
157
  preprintDate: z
130
158
  .string()
131
159
  .optional()
132
- .describe('Date the preprint was first posted (YYYY-MM-DD). Not derivable from the DOI.'),
160
+ .describe('Preprint posting date (YYYY-MM-DD) as this row records it — the first posting for most preprints. medRxiv lists some 10.64898/ preprints on two rows that differ in this date, and sometimes in title or authors; both rows are returned. Not derivable from the DOI.'),
133
161
  preprintTitle: z.string().optional().describe('Title of the preprint.'),
134
- preprintAuthors: z.string().optional().describe('Preprint author list.'),
162
+ preprintAuthors: z
163
+ .string()
164
+ .optional()
165
+ .describe('Preprint author list. Absent under a publisher filter.'),
135
166
  preprintCategory: z.string().optional().describe('Subject category.'),
136
167
  preprintAuthorCorresponding: z
137
168
  .string()
138
169
  .optional()
139
- .describe('Corresponding author name.'),
170
+ .describe('Corresponding author name. Absent under a publisher filter.'),
140
171
  preprintAuthorCorrespondingInstitution: z
141
172
  .string()
142
173
  .optional()
143
- .describe('Corresponding author institution.'),
174
+ .describe('Corresponding author institution. Absent under a publisher filter.'),
144
175
  preprintAbstract: z
145
176
  .string()
146
177
  .optional()
147
- .describe('Preprint abstract. Present only when include_abstract is true.'),
178
+ .describe('Preprint abstract. Present only when include_abstract is true, and never under a publisher filter.'),
148
179
  })
149
180
  .describe('One preprint and the journal article it became.'))
150
181
  .describe('Publications in the interval, in upstream order: bioRxiv rows first, then medRxiv rows.'),
@@ -169,7 +200,19 @@ export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_ver
169
200
  notice: z
170
201
  .string()
171
202
  .optional()
172
- .describe('Guidance on how to read this result set: which servers did not answer, which cursors are past the end, and — when nothing came back — the interval and how to broaden it. All applicable qualifications are composed into one string.'),
203
+ .describe('Guidance on how to read this result set: which servers did not answer, that a publisher filter limited server="both" to bioRxiv and which fields its rows lack, a limit above the 100-row page, which cursors are past the end, which servers have rows past this page, and — when nothing came back — the interval and how to broaden it. All applicable qualifications are composed into one string.'),
204
+ truncated: z
205
+ .boolean()
206
+ .optional()
207
+ .describe("True when at least one server has rows past this page — continue at that server's nextCursor. Absent when every server queried is on its last page."),
208
+ shown: z
209
+ .number()
210
+ .optional()
211
+ .describe('Publications on this page, across every server queried. Set with truncated.'),
212
+ cap: z
213
+ .number()
214
+ .optional()
215
+ .describe('Most publications this page can hold: rows per server (limit, or 100 when limit asked for more) times the servers queried. Set with truncated.'),
173
216
  },
174
217
  errors: [
175
218
  {
@@ -178,6 +221,12 @@ export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_ver
178
221
  when: 'start_date or end_date is not a real calendar date (2024-02-30, 2024-13-01), or end_date is before start_date.',
179
222
  recovery: 'Provide valid YYYY-MM-DD journal publication dates where start_date is on or before end_date.',
180
223
  },
224
+ {
225
+ reason: 'invalid_publisher',
226
+ code: JsonRpcErrorCode.ValidationError,
227
+ when: 'publisher is combined with server="medrxiv", or is a prefix api.biorxiv.org does not recognize.',
228
+ recovery: 'Pass the publisher DOI prefix alone — the part of a journal DOI before the slash, such as 10.7554 — with server "biorxiv" or "both".',
229
+ },
181
230
  {
182
231
  reason: 'upstream_unavailable',
183
232
  code: JsonRpcErrorCode.ServiceUnavailable,
@@ -198,7 +247,9 @@ export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_ver
198
247
  start_date: input.start_date,
199
248
  end_date: input.end_date,
200
249
  server: input.server,
250
+ publisher: input.publisher,
201
251
  cursor: input.cursor,
252
+ limit: input.limit,
202
253
  });
203
254
  // Upstream answers a malformed or inverted interval with HTTP 200 and an
204
255
  // empty page. The schema holds both bounds to YYYY-MM-DD; what it cannot
@@ -209,9 +260,27 @@ export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_ver
209
260
  if (input.start_date > input.end_date) {
210
261
  throw ctx.fail('invalid_date_range', `start_date (${input.start_date}) must be on or before end_date (${input.end_date}).`);
211
262
  }
263
+ // api.biorxiv.org's publisher listing is bioRxiv's alone: it takes no server,
264
+ // ignores ?server=medrxiv, and has no medRxiv path, so a medRxiv publisher
265
+ // listing would never hold a medRxiv row.
266
+ const { publisher } = input;
267
+ if (publisher && input.server === 'medrxiv') {
268
+ throw ctx.fail('invalid_publisher', 'The publisher filter applies to bioRxiv only — api.biorxiv.org has no medRxiv publisher listing.', {
269
+ publisher,
270
+ recovery: {
271
+ hint: 'Set server to "biorxiv" or "both" (which queries bioRxiv alone under a publisher filter), or omit publisher to list medRxiv.',
272
+ },
273
+ });
274
+ }
212
275
  const service = getBiorxivApiService();
213
- const servers = input.server === 'both' ? SERVERS : [input.server];
214
- const settled = await Promise.allSettled(servers.map((server) => service.getPublishedListing(server, input.start_date, input.end_date, input.cursor, ctx)));
276
+ const deadline = startCallDeadline();
277
+ const servers = publisher
278
+ ? ['biorxiv']
279
+ : input.server === 'both'
280
+ ? SERVERS
281
+ : [input.server];
282
+ const limit = Math.min(input.limit, UPSTREAM_PAGE_ROWS);
283
+ const settled = await Promise.allSettled(servers.map((server) => service.getPublishedListing(publisher ? { publisher } : server, input.start_date, input.end_date, input.cursor, limit, deadline, ctx)));
215
284
  // A cancelled call is not a partial result, whichever leg the abort reached first.
216
285
  ctx.signal.throwIfAborted();
217
286
  const pagination = {};
@@ -264,23 +333,62 @@ export const biorxivListPublishedVersionsTool = tool('biorxiv_list_published_ver
264
333
  }
265
334
  throw ctx.fail('upstream_unavailable', message, { servers: failedServers }, { cause: rejections[0] });
266
335
  }
336
+ // A prefix the API could not read filtered nothing — the empty page says
337
+ // nothing about what that publisher published.
338
+ if (settled.some((r) => r.status === 'fulfilled' && r.value.publisherNotRecognized)) {
339
+ throw ctx.fail('invalid_publisher', `api.biorxiv.org does not recognize publisher prefix ${publisher}, so it cannot filter on it — this is not an empty result.`, { publisher });
340
+ }
267
341
  // ctx.enrich.notice is last-wins, so every qualification is collected first.
268
342
  const notices = [];
269
343
  if (failed.length > 0) {
270
344
  const labels = serverLabels(failed.map((f) => f.server));
271
345
  notices.push(`${labels} did not answer, so this result set is partial — it holds no ${labels} publications. See failed[] for the error and retry to include them.`);
272
346
  }
347
+ // The absent medRxiv entry and the absent journal fields each need saying,
348
+ // or they read as an accident rather than as what the publisher listing holds.
349
+ if (publisher && input.server === 'both') {
350
+ notices.push('The publisher filter applies to bioRxiv only — api.biorxiv.org has no medRxiv publisher listing — so only bioRxiv was queried and there is no medRxiv pagination entry.');
351
+ }
352
+ if (publisher && publications.length > 0) {
353
+ notices.push('Rows listed by publisher carry no journal name, authors, corresponding author, or abstract — pass a preprintDoi to biorxiv_get_published_version for its full record.');
354
+ }
355
+ if (input.limit > UPSTREAM_PAGE_ROWS) {
356
+ notices.push(`A limit of ${input.limit} is above the ${UPSTREAM_PAGE_ROWS}-row page api.biorxiv.org serves, so this page holds up to ${UPSTREAM_PAGE_ROWS} rows per server.`);
357
+ }
273
358
  const exhausted = SERVERS.filter((s) => pagination[s]?.exhausted);
274
359
  if (upstreamRows === 0) {
360
+ const scope = `publication dates ${input.start_date}–${input.end_date}${servers.length > 1 ? '' : ` on ${SERVER_LABEL[servers[0]]}`}`;
275
361
  notices.push(input.cursor > 0
276
362
  ? `Cursor ${input.cursor} is at or past the last row for this interval${failed.length > 0 ? ' on the servers that answered' : ''}. Set cursor to a lower offset.`
277
- : `No journal publications found for publication dates ${input.start_date}–${input.end_date}${input.server === 'both' ? '' : ` on ${SERVER_LABEL[input.server]}`}. Try widening the date range, or use biorxiv_list_recent to list preprints by posting date instead.`);
363
+ : publisher
364
+ ? `No journal publications found for ${scope} under publisher prefix ${publisher}. Try widening the date range, or check the prefix against one of the publisher's journal DOIs — the part before the slash.`
365
+ : `No journal publications found for ${scope}. Try widening the date range, or use biorxiv_list_recent to list preprints by posting date instead.`);
278
366
  }
279
367
  else if (exhausted.length > 0) {
280
368
  notices.push(`Cursor ${input.cursor} is at or past the last row on ${serverLabels(exhausted)} — that entry is marked exhausted and carries no total. Lower the cursor to page that server.`);
281
369
  }
282
- if (notices.length > 0)
370
+ const continuing = SERVERS.filter((s) => pagination[s]?.nextCursor !== undefined);
371
+ if (continuing.length > 0) {
372
+ const where = continuing
373
+ .map((s) => `${SERVER_LABEL[s]} (next cursor ${pagination[s]?.nextCursor})`)
374
+ .join(' and ');
375
+ // Kept at "both", a server already on its last page is re-requested on every
376
+ // later page. A failed server is the exception: retrying "both" includes it.
377
+ const [only] = continuing;
378
+ const how = servers.length > 1 && failed.length === 0 && continuing.length === 1
379
+ ? `pass that nextCursor as cursor with server set to "${only}" to continue it`
380
+ : "pass a server's nextCursor as cursor to continue it";
381
+ notices.push(`More rows remain past this page on ${where} — ${how}.`);
382
+ // truncated() writes the notice too, so it carries the composed string.
383
+ ctx.enrich.truncated({
384
+ shown: publications.length,
385
+ cap: limit * servers.length,
386
+ guidance: notices.join(' '),
387
+ });
388
+ }
389
+ else if (notices.length > 0) {
283
390
  ctx.enrich.notice(notices.join(' '));
391
+ }
284
392
  if (!input.include_abstract) {
285
393
  publications = publications.map(({ preprintAbstract: _abstract, ...rest }) => rest);
286
394
  }
@@ -1 +1 @@
1
- {"version":3,"file":"biorxiv-list-published-versions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAM7E,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC;AAChD,MAAM,YAAY,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,S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AK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC9B,KAAK,CAAC,IAAI,CACR,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,qEAAqE,CAAC,CAAC,KAAK,GAAG,CAC3G,CAAC;QACJ,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,YAAY,CAAC,MAAM,SAAS,CAAC,CAAC;YAC9E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;gBACpC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAgB,CAAC,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"biorxiv-list-published-versions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAM7E,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC;AAChD,MAAM,YAAY,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,O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,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC9B,KAAK,CAAC,IAAI,CACR,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,qEAAqE,CAAC,CAAC,KAAK,GAAG,CAC3G,CAAC;QACJ,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,YAAY,CAAC,MAAM,SAAS,CAAC,CAAC;YAC9E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;gBACpC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAgB,CAAC,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -58,7 +58,10 @@ export declare const biorxivListRecentTool: import("@cyanheads/mcp-ts-core").Too
58
58
  abstract: z.ZodOptional<z.ZodString>;
59
59
  awards: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
60
  publishedJournalDoi: z.ZodOptional<z.ZodString>;
61
- server: z.ZodOptional<z.ZodString>;
61
+ server: z.ZodEnum<{
62
+ biorxiv: "biorxiv";
63
+ medrxiv: "medrxiv";
64
+ }>;
62
65
  }, z.core.$strip>>;
63
66
  pagination: z.ZodObject<{
64
67
  biorxiv: z.ZodOptional<z.ZodObject<{
@@ -84,7 +87,7 @@ export declare const biorxivListRecentTool: import("@cyanheads/mcp-ts-core").Too
84
87
  }, z.core.$strip>, readonly [{
85
88
  readonly reason: "invalid_date_range";
86
89
  readonly code: JsonRpcErrorCode.ValidationError;
87
- readonly when: "end_date is before start_date, or either date is malformed.";
90
+ readonly when: "end_date is before start_date, or either date names no calendar day (2024-02-30, 2024-13-01).";
88
91
  readonly recovery: "Provide valid YYYY-MM-DD dates where start_date is on or before end_date.";
89
92
  }, {
90
93
  readonly reason: "invalid_category";
@@ -1 +1 @@
1
- {"version":3,"file":"biorxiv-list-recent.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-recent.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAkDjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAshBhC,CAAC"}
1
+ {"version":3,"file":"biorxiv-list-recent.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-recent.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAiDjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyjBhC,CAAC"}
@@ -31,8 +31,7 @@
31
31
  import { tool, z } from '@cyanheads/mcp-ts-core';
32
32
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
33
33
  import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.js';
34
- import { describeWait, escapeMarkdown, findRateLimit, isValidCalendarDate, normalizeRorId, } from '../../../services/shared.js';
35
- const DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
34
+ import { describeWait, escapeMarkdown, findRateLimit, isValidCalendarDate, normalizeRorId, startCallDeadline, } from '../../../services/shared.js';
36
35
  const SERVERS = ['biorxiv', 'medrxiv'];
37
36
  const SERVER_LABEL = { biorxiv: 'bioRxiv', medrxiv: 'medRxiv' };
38
37
  function errorMessage(reason) {
@@ -55,8 +54,7 @@ function formatPreprint(p) {
55
54
  lines.push(`**Version:** ${p.version}`);
56
55
  if (p.type)
57
56
  lines.push(`**Type:** ${escapeMarkdown(p.type)}`);
58
- if (p.server)
59
- lines.push(`**Server:** ${p.server}`);
57
+ lines.push(`**Server:** ${p.server}`);
60
58
  if (p.category)
61
59
  lines.push(`**Category:** ${escapeMarkdown(p.category)}`);
62
60
  if (p.license)
@@ -79,13 +77,19 @@ function formatPreprint(p) {
79
77
  }
80
78
  export const biorxivListRecentTool = tool('biorxiv_list_recent', {
81
79
  title: 'List Recent Preprints',
82
- description: 'List preprints posted or revised within a date interval, optionally scoped to one server or a subject category. Returns 30 preprints per page (fixed by the API); pass `cursor` as an integer offset (0, 30, 60, …) to step through additional pages. Abstracts are omitted by default to keep the page small — pass include_abstract: true for the whole page, or call biorxiv_get_preprint (up to 10 DOIs per call) for a few. When server="both" (default), per-server pagination state is returned separately — use each server\'s `cursor` field for independent advancement. One server failing under server="both" does not abort the call: the other server\'s page is still returned and the failed one is named in `failed[]`, marking the result set as partial rather than complete. Every attempted server failing is a different case and does abort the call, with a retryable upstream_unavailable (or rate_limited) error — an empty page would otherwise be indistinguishable from an interval that genuinely holds nothing. Call biorxiv_list_categories for valid category strings; a server that answers a category filter with its unfiltered listing is left out with a notice, and invalid_category is raised when no server applied it. `funder` limits the listing to bioRxiv preprints funded by that organization, given its ROR ID; an ID api.biorxiv.org has no funder record for raises invalid_funder rather than returning an empty page.',
80
+ description: 'List preprints posted or revised within a date interval, optionally scoped to one server or a subject category. Returns 30 preprints per page (fixed by the API); pass `cursor` as an integer offset (0, 30, 60, …) to step through additional pages. Abstracts are omitted by default to keep the page small — pass include_abstract: true for the whole page (each row carries the latest-revision abstract of its preprint, whichever revision the row is), or call biorxiv_get_preprint (up to 10 DOIs per call) for a few. When server="both" (default), per-server pagination state is returned separately — use each server\'s `cursor` field for independent advancement. One server failing under server="both" does not abort the call: the other server\'s page is still returned and the failed one is named in `failed[]`, marking the result set as partial rather than complete. Every attempted server failing is a different case and does abort the call, with a retryable upstream_unavailable (or rate_limited) error — an empty page would otherwise be indistinguishable from an interval that genuinely holds nothing. Call biorxiv_list_categories for valid category strings; a server that answers a category filter with its unfiltered listing is left out with a notice, and invalid_category is raised when no server applied it. `funder` limits the listing to bioRxiv preprints funded by that organization, given its ROR ID; an ID api.biorxiv.org has no funder record for raises invalid_funder rather than returning an empty page.',
83
81
  annotations: { readOnlyHint: true, openWorldHint: true },
84
82
  // biorxiv_search_preprints spells its date bounds date_from / date_to.
85
83
  inputAliases: { date_from: 'start_date', date_to: 'end_date' },
86
84
  input: z.object({
87
- start_date: z.string().describe('Start of the date interval (YYYY-MM-DD).'),
88
- end_date: z.string().describe('End of the date interval (YYYY-MM-DD).'),
85
+ start_date: z
86
+ .string()
87
+ .regex(/^\d{4}-\d{2}-\d{2}$/, 'Use YYYY-MM-DD, e.g. 2025-03-04')
88
+ .describe('Start of the date interval (YYYY-MM-DD).'),
89
+ end_date: z
90
+ .string()
91
+ .regex(/^\d{4}-\d{2}-\d{2}$/, 'Use YYYY-MM-DD, e.g. 2025-03-04')
92
+ .describe('End of the date interval (YYYY-MM-DD).'),
89
93
  server: z
90
94
  .enum(['biorxiv', 'medrxiv', 'both'])
91
95
  .default('both')
@@ -130,7 +134,7 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
130
134
  abstract: z
131
135
  .string()
132
136
  .optional()
133
- .describe('Abstract text. Present only when include_abstract is true.'),
137
+ .describe("The preprint's latest-revision abstract, which differs from this row's own revision when a later one exists — api.biorxiv.org keeps one abstract per preprint. Present only when include_abstract is true."),
134
138
  awards: z
135
139
  .array(z.string().describe('One award value as upstream records it.'))
136
140
  .optional()
@@ -139,7 +143,9 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
139
143
  .string()
140
144
  .optional()
141
145
  .describe('Published journal DOI when this preprint has been accepted.'),
142
- server: z.string().optional().describe('Source server (biorxiv or medrxiv).'),
146
+ server: z
147
+ .enum(['biorxiv', 'medrxiv'])
148
+ .describe('Server the preprint was listed on — accepted as the server input of every tool.'),
143
149
  })
144
150
  .describe('A single preprint entry.'))
145
151
  .describe('Preprints in the requested date interval.'),
@@ -197,7 +203,7 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
197
203
  {
198
204
  reason: 'invalid_date_range',
199
205
  code: JsonRpcErrorCode.ValidationError,
200
- when: 'end_date is before start_date, or either date is malformed.',
206
+ when: 'end_date is before start_date, or either date names no calendar day (2024-02-30, 2024-13-01).',
201
207
  recovery: 'Provide valid YYYY-MM-DD dates where start_date is on or before end_date.',
202
208
  },
203
209
  {
@@ -236,11 +242,8 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
236
242
  category: input.category,
237
243
  funder: input.funder,
238
244
  });
239
- // Validate dates: shape first, then real-calendar-date (rejects overflow days
240
- // like 2024-02-30 that the shape regex accepts but no calendar holds), then range.
241
- if (!DATE_REGEX.test(input.start_date) || !DATE_REGEX.test(input.end_date)) {
242
- throw ctx.fail('invalid_date_range', 'Date must be in YYYY-MM-DD format.');
243
- }
245
+ // The schema has checked the shape; reject overflow days like 2024-02-30
246
+ // that the shape accepts but no calendar holds, then an inverted range.
244
247
  if (!isValidCalendarDate(input.start_date) || !isValidCalendarDate(input.end_date)) {
245
248
  throw ctx.fail('invalid_date_range', 'Date must be a real calendar date (YYYY-MM-DD).');
246
249
  }
@@ -273,11 +276,29 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
273
276
  throw ctx.fail('invalid_category', `Category "${category}" is not valid for ${serverLabel}${scope}.`);
274
277
  }
275
278
  const filters = { category, funder };
279
+ const deadline = startCallDeadline();
276
280
  const pagination = {};
277
281
  const failed = [];
278
282
  // Raw rejection values alongside failed[], so the all-failed branch can tell
279
283
  // a rate limit from a generic outage and preserve the original as `cause`.
280
284
  const rejections = [];
285
+ // No server returned a usable page. A rate limit outranks a generic outage:
286
+ // both say "retry", but only one says when, and retrying sooner would land
287
+ // inside the same limit.
288
+ const unanswered = (message, servers) => {
289
+ const rateLimit = findRateLimit(rejections);
290
+ if (rateLimit) {
291
+ const wait = describeWait(rateLimit.retryAfter);
292
+ return ctx.fail('rate_limited', message, {
293
+ servers,
294
+ ...(rateLimit.retryAfter !== undefined && { retryAfter: rateLimit.retryAfter }),
295
+ recovery: {
296
+ hint: `Wait ${wait} before retrying — api.biorxiv.org is rate-limiting this host, and every preprint metadata tool queries the same origin.`,
297
+ },
298
+ }, { cause: rejections[0] });
299
+ }
300
+ return ctx.fail('upstream_unavailable', message, { servers }, { cause: rejections[0] });
301
+ };
281
302
  // ctx.enrich.notice is last-wins, so every qualification that applies to this
282
303
  // result set is collected here and flushed as one string before returning.
283
304
  const notices = [];
@@ -330,7 +351,16 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
330
351
  // funder filter or onto the server owning a server-exclusive category.
331
352
  const singleServer = exclusiveServer ?? (target === 'both' ? undefined : target);
332
353
  if (singleServer) {
333
- const r = await service.getListing(singleServer, input.start_date, input.end_date, input.cursor, filters, ctx);
354
+ const r = await service
355
+ .getListing(singleServer, input.start_date, input.end_date, input.cursor, filters, deadline, ctx)
356
+ .catch((err) => {
357
+ // A listing the caller's cancellation stopped is that cancellation.
358
+ ctx.signal.throwIfAborted();
359
+ rejections.push(err);
360
+ throw unanswered(`${SERVER_LABEL[singleServer]} did not answer — ${errorMessage(err)}`, [
361
+ singleServer,
362
+ ]);
363
+ });
334
364
  // No funder record means no filter was applied at all — the empty page
335
365
  // says nothing about what the funder posted.
336
366
  if (r.funderNotFound) {
@@ -350,7 +380,9 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
350
380
  // Fan out to both servers. Any category here is shared by both taxonomies,
351
381
  // so it applies to each; with no category both return unfiltered pages.
352
382
  // A funder filter never reaches this branch — it narrows the call to bioRxiv.
353
- const settled = await Promise.allSettled(SERVERS.map((server) => service.getListing(server, input.start_date, input.end_date, input.cursor, filters, ctx)));
383
+ const settled = await Promise.allSettled(SERVERS.map((server) => service.getListing(server, input.start_date, input.end_date, input.cursor, filters, deadline, ctx)));
384
+ // A cancelled call is not a partial result, whichever leg the abort reached first.
385
+ ctx.signal.throwIfAborted();
354
386
  // Servers that answered but ignored the category filter — their pages are
355
387
  // unfiltered, so they are left out rather than mixed in with filtered ones.
356
388
  const ignored = [];
@@ -387,24 +419,9 @@ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
387
419
  ...failed.map((f) => `${SERVER_LABEL[f.server]}: ${f.error}`),
388
420
  ...ignored.map((s) => `${SERVER_LABEL[s]} ignored the category filter "${category}"`),
389
421
  ].join('; ');
390
- const message = ignored.length === 0
422
+ throw unanswered(ignored.length === 0
391
423
  ? `Neither bioRxiv nor medRxiv answered — ${detail}`
392
- : `No server returned a usable page — ${detail}`;
393
- const servers = failed.map((f) => f.server);
394
- // A rate limit outranks a generic outage: both say "retry", but only one
395
- // says when, and retrying sooner would land inside the same limit.
396
- const rateLimit = findRateLimit(rejections);
397
- if (rateLimit) {
398
- const wait = describeWait(rateLimit.retryAfter);
399
- throw ctx.fail('rate_limited', message, {
400
- servers,
401
- ...(rateLimit.retryAfter !== undefined && { retryAfter: rateLimit.retryAfter }),
402
- recovery: {
403
- hint: `Wait ${wait} before retrying — api.biorxiv.org is rate-limiting this host, and every preprint metadata tool queries the same origin.`,
404
- },
405
- }, { cause: rejections[0] });
406
- }
407
- throw ctx.fail('upstream_unavailable', message, { servers }, { cause: rejections[0] });
424
+ : `No server returned a usable page — ${detail}`, failed.map((f) => f.server));
408
425
  }
409
426
  // A server that never answered contributes no pagination entry, so nothing
410
427
  // else in the response distinguishes "that server had no preprints" from