@cyanheads/biorxiv-mcp-server 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -5
- package/CLAUDE.md +5 -5
- package/Dockerfile +1 -1
- package/README.md +10 -4
- package/changelog/0.2.x/0.2.1.md +30 -0
- package/changelog/0.2.x/0.2.2.md +21 -0
- package/dist/config/server-config.d.ts +5 -4
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +12 -11
- package/dist/config/server-config.js.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts +24 -6
- package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js +77 -23
- package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +17 -2
- package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +56 -37
- package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +17 -2
- package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +41 -10
- package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +18 -2
- package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js +104 -23
- package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/index.d.ts +54 -9
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
- package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
- package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts +29 -7
- package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
- package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +136 -14
- package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
- package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
- package/package.json +15 -9
- package/server.json +31 -3
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* by DOI. Each DOI call returns all revisions in a single response. When
|
|
5
5
|
* server="both", each DOI fans out across bioRxiv and medRxiv in parallel;
|
|
6
6
|
* per-DOI failures are reported in failed[] rather than aborting the batch.
|
|
7
|
+
* A DOI is only reported as not found when every attempted server answered
|
|
8
|
+
* with an empty collection — if a server never answered, the DOI is reported
|
|
9
|
+
* as upstream-unavailable and retryable, on both the per-DOI and batch surfaces.
|
|
7
10
|
* @module mcp-server/tools/definitions/biorxiv-get-preprint.tool
|
|
8
11
|
*/
|
|
9
12
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
@@ -79,7 +82,7 @@ const RevisionSchema = z.object({
|
|
|
79
82
|
});
|
|
80
83
|
export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
|
|
81
84
|
title: 'Get Preprint by DOI',
|
|
82
|
-
description: 'Fetch full metadata, abstract, all revision history, JATS XML full-text links, and published-journal DOI for one or more preprints by DOI. Each DOI returns all revisions in one response. When server="both" (default), each DOI is checked against both bioRxiv and medRxiv; the response includes which server the preprint was found on. Failed lookups are reported per-DOI rather than aborting the batch. DOIs must match the pattern 10.NNNN/…',
|
|
85
|
+
description: 'Fetch full metadata, abstract, all revision history, JATS XML full-text links, and published-journal DOI for one or more preprints by DOI. Each DOI returns all revisions in one response. When server="both" (default), each DOI is checked against both bioRxiv and medRxiv; the response includes which server the preprint was found on. Failed lookups are reported per-DOI in failed[] rather than aborting the batch, each carrying a reason (not_found, invalid_doi_format, upstream_unavailable) and a retryable flag. DOIs must match the pattern 10.NNNN/…',
|
|
83
86
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
84
87
|
input: z.object({
|
|
85
88
|
dois: z
|
|
@@ -110,6 +113,12 @@ export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
|
|
|
110
113
|
.object({
|
|
111
114
|
doi: z.string().describe('DOI that failed to resolve.'),
|
|
112
115
|
error: z.string().describe('Error description.'),
|
|
116
|
+
reason: z
|
|
117
|
+
.enum(['not_found', 'invalid_doi_format', 'upstream_unavailable'])
|
|
118
|
+
.describe('Why this DOI failed: not_found (every attempted server answered with an empty collection), invalid_doi_format (the DOI does not match 10.NNNN/…), or upstream_unavailable (a server never answered, so absence could not be established).'),
|
|
119
|
+
retryable: z
|
|
120
|
+
.boolean()
|
|
121
|
+
.describe('True when retrying this DOI may succeed — set only for upstream_unavailable. A not_found or invalid_doi_format entry will not change on retry.'),
|
|
113
122
|
})
|
|
114
123
|
.describe('A DOI that failed to resolve.'))
|
|
115
124
|
.describe('DOIs that could not be resolved, with per-DOI error details.'),
|
|
@@ -118,7 +127,7 @@ export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
|
|
|
118
127
|
{
|
|
119
128
|
reason: 'doi_not_found',
|
|
120
129
|
code: JsonRpcErrorCode.NotFound,
|
|
121
|
-
when: 'ALL requested DOIs resolve to empty collections on all requested servers.',
|
|
130
|
+
when: 'ALL requested DOIs resolve to empty collections on all requested servers, with every server answering.',
|
|
122
131
|
recovery: 'Verify the DOI exists on bioRxiv or medRxiv. Supported prefixes: 10.1101/ and 10.64898/.',
|
|
123
132
|
},
|
|
124
133
|
{
|
|
@@ -127,6 +136,13 @@ export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
|
|
|
127
136
|
when: 'One or more input DOIs do not match the 10.NNNN/ pattern.',
|
|
128
137
|
recovery: 'Correct the DOI format — bioRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.',
|
|
129
138
|
},
|
|
139
|
+
{
|
|
140
|
+
reason: 'upstream_unavailable',
|
|
141
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
142
|
+
retryable: true,
|
|
143
|
+
when: 'No DOI resolved and at least one lookup failed against api.biorxiv.org, so absence could not be established for any requested DOI.',
|
|
144
|
+
recovery: 'Retry the request after a short delay — the DOIs may well exist; api.biorxiv.org did not answer.',
|
|
145
|
+
},
|
|
130
146
|
],
|
|
131
147
|
async handler(input, ctx) {
|
|
132
148
|
ctx.log.info('Executing biorxiv_get_preprint', {
|
|
@@ -136,6 +152,7 @@ export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
|
|
|
136
152
|
const service = getBiorxivApiService();
|
|
137
153
|
const preprints = [];
|
|
138
154
|
const failed = [];
|
|
155
|
+
const servers = input.server === 'both' ? ['biorxiv', 'medrxiv'] : [input.server];
|
|
139
156
|
// For each DOI, fan out across servers in parallel
|
|
140
157
|
await Promise.all(input.dois.map(async (doi) => {
|
|
141
158
|
// Route format-invalid DOIs to failed[] rather than aborting the batch
|
|
@@ -143,55 +160,57 @@ export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
|
|
|
143
160
|
failed.push({
|
|
144
161
|
doi,
|
|
145
162
|
error: `Invalid DOI format — must match 10.NNNN/… (e.g. 10.1101/… or 10.64898/…).`,
|
|
163
|
+
reason: 'invalid_doi_format',
|
|
164
|
+
retryable: false,
|
|
146
165
|
});
|
|
147
166
|
return;
|
|
148
167
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
service.getDetails(doi, 'medrxiv', ctx),
|
|
155
|
-
]);
|
|
156
|
-
if (bxResult.status === 'fulfilled')
|
|
157
|
-
revisions.push(...bxResult.value);
|
|
158
|
-
if (mxResult.status === 'fulfilled')
|
|
159
|
-
revisions.push(...mxResult.value);
|
|
160
|
-
// If both failed, surface the error
|
|
161
|
-
if (bxResult.status === 'rejected' && mxResult.status === 'rejected') {
|
|
162
|
-
throw bxResult.reason instanceof Error
|
|
163
|
-
? bxResult.reason
|
|
164
|
-
: new Error(String(bxResult.reason));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
revisions = await service.getDetails(doi, input.server, ctx);
|
|
169
|
-
}
|
|
170
|
-
if (revisions.length > 0) {
|
|
171
|
-
preprints.push({ doi, revisions });
|
|
172
|
-
}
|
|
173
|
-
else if (input.server !== 'both') {
|
|
174
|
-
failed.push({ doi, error: `Not found on ${input.server}.` });
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
failed.push({ doi, error: 'Not found on bioRxiv or medRxiv.' });
|
|
178
|
-
}
|
|
168
|
+
const settled = await Promise.allSettled(servers.map((server) => service.getDetails(doi, server, ctx)));
|
|
169
|
+
const revisions = settled.flatMap((r) => (r.status === 'fulfilled' ? r.value : []));
|
|
170
|
+
if (revisions.length > 0) {
|
|
171
|
+
preprints.push({ doi, revisions });
|
|
172
|
+
return;
|
|
179
173
|
}
|
|
180
|
-
|
|
174
|
+
// No revisions. "Not found" is a claim about what the servers reported, so it
|
|
175
|
+
// requires every attempted server to have answered — a server that failed
|
|
176
|
+
// leaves absence unestablished and the DOI retryable.
|
|
177
|
+
const rejections = settled.flatMap((r, i) => r.status === 'rejected'
|
|
178
|
+
? [
|
|
179
|
+
{
|
|
180
|
+
server: servers[i],
|
|
181
|
+
message: r.reason instanceof Error ? r.reason.message : String(r.reason),
|
|
182
|
+
},
|
|
183
|
+
]
|
|
184
|
+
: []);
|
|
185
|
+
if (rejections.length > 0) {
|
|
181
186
|
failed.push({
|
|
182
187
|
doi,
|
|
183
|
-
error:
|
|
188
|
+
error: `Lookup failed — ${rejections.map((f) => `${f.server}: ${f.message}`).join('; ')}`,
|
|
189
|
+
reason: 'upstream_unavailable',
|
|
190
|
+
retryable: true,
|
|
184
191
|
});
|
|
192
|
+
return;
|
|
185
193
|
}
|
|
194
|
+
failed.push({
|
|
195
|
+
doi,
|
|
196
|
+
error: input.server === 'both'
|
|
197
|
+
? 'Not found on bioRxiv or medRxiv.'
|
|
198
|
+
: `Not found on ${input.server}.`,
|
|
199
|
+
reason: 'not_found',
|
|
200
|
+
retryable: false,
|
|
201
|
+
});
|
|
186
202
|
}));
|
|
187
203
|
// All DOIs failed — pick the appropriate declared error
|
|
188
204
|
if (preprints.length === 0 && failed.length === input.dois.length) {
|
|
189
|
-
|
|
190
|
-
if (allFormatErrors) {
|
|
205
|
+
if (failed.every((f) => f.reason === 'invalid_doi_format')) {
|
|
191
206
|
throw ctx.fail('invalid_doi_format', `Invalid DOI format: ${input.dois.join(', ')}`, {
|
|
192
207
|
...ctx.recoveryFor('invalid_doi_format'),
|
|
193
208
|
});
|
|
194
209
|
}
|
|
210
|
+
const unavailable = failed.filter((f) => f.reason === 'upstream_unavailable');
|
|
211
|
+
if (unavailable.length > 0) {
|
|
212
|
+
throw ctx.fail('upstream_unavailable', `No DOI could be resolved — ${unavailable.map((f) => `${f.doi}: ${f.error}`).join('; ')}`, { ...ctx.recoveryFor('upstream_unavailable') });
|
|
213
|
+
}
|
|
195
214
|
throw ctx.fail('doi_not_found', `None of the requested DOIs were found: ${input.dois.join(', ')}`, { ...ctx.recoveryFor('doi_not_found') });
|
|
196
215
|
}
|
|
197
216
|
return { preprints, failed };
|
|
@@ -208,7 +227,7 @@ export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
|
|
|
208
227
|
if (result.failed.length > 0) {
|
|
209
228
|
lines.push('\n## Failed DOIs');
|
|
210
229
|
for (const f of result.failed) {
|
|
211
|
-
lines.push(`- **${f.doi}**: ${f.error}`);
|
|
230
|
+
lines.push(`- **${f.doi}**: ${f.error} (${f.reason}, retryable: ${f.retryable})`);
|
|
212
231
|
}
|
|
213
232
|
}
|
|
214
233
|
return [{ type: 'text', text: lines.join('\n') || 'No results.' }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-get-preprint.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-preprint.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"biorxiv-get-preprint.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-preprint.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;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;AAG7E,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,SAAS,cAAc,CAAC,CAAmB;IACzC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI,GAAG,MAAM,CAAC,CAAC,IAAI,IAAI,cAAc,EAAE,CAAC,CAAC;IACtE,IAAI,CAAC,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACjD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAChC,IAAI,CAAC,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACpD,IAAI,CAAC,CAAC,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,QAAQ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GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CACxC,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;YACxD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACjC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,SAA+B,CAAC,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC/B,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,MAAM,gBAAgB,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC;YACpF,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;IACrE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* to its full journal publication record using the /pubs endpoint. Use when
|
|
4
4
|
* you need richer crosswalk metadata than biorxiv_get_preprint provides
|
|
5
5
|
* (journal name, published date, full abstract, corresponding author details).
|
|
6
|
+
* bioRxiv and medRxiv share the 10.1101/ DOI prefix, so the DOI alone does not
|
|
7
|
+
* identify the server: the default server="both" resolves against both in
|
|
8
|
+
* parallel and the output names the server that answered. Not-found is reported
|
|
9
|
+
* only when every attempted server answered with an empty collection.
|
|
6
10
|
* @module mcp-server/tools/definitions/biorxiv-get-published-version.tool
|
|
7
11
|
*/
|
|
8
12
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -11,10 +15,15 @@ export declare const biorxivGetPublishedVersionTool: import("@cyanheads/mcp-ts-c
|
|
|
11
15
|
doi: z.ZodString;
|
|
12
16
|
server: z.ZodDefault<z.ZodEnum<{
|
|
13
17
|
biorxiv: "biorxiv";
|
|
18
|
+
both: "both";
|
|
14
19
|
medrxiv: "medrxiv";
|
|
15
20
|
}>>;
|
|
16
21
|
}, z.core.$strip>, z.ZodObject<{
|
|
17
22
|
preprintDoi: z.ZodString;
|
|
23
|
+
server: z.ZodEnum<{
|
|
24
|
+
biorxiv: "biorxiv";
|
|
25
|
+
medrxiv: "medrxiv";
|
|
26
|
+
}>;
|
|
18
27
|
publishedDoi: z.ZodOptional<z.ZodString>;
|
|
19
28
|
publishedJournal: z.ZodOptional<z.ZodString>;
|
|
20
29
|
publishedDate: z.ZodOptional<z.ZodString>;
|
|
@@ -28,12 +37,18 @@ export declare const biorxivGetPublishedVersionTool: import("@cyanheads/mcp-ts-c
|
|
|
28
37
|
}, z.core.$strip>, readonly [{
|
|
29
38
|
readonly reason: "doi_not_found";
|
|
30
39
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
31
|
-
readonly when: "Crosswalk endpoint returns empty collection
|
|
32
|
-
readonly recovery: "
|
|
40
|
+
readonly when: "Crosswalk endpoint returns an empty collection on every attempted server.";
|
|
41
|
+
readonly recovery: "Retry with server=\"both\" if you scoped to one server, or check publishedJournalDoi in biorxiv_get_preprint — when it is absent the preprint has no journal version yet.";
|
|
33
42
|
}, {
|
|
34
43
|
readonly reason: "invalid_doi_format";
|
|
35
44
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
36
45
|
readonly when: "The input DOI does not match the 10.NNNN/ pattern.";
|
|
37
46
|
readonly recovery: "Correct the DOI format — bioRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.";
|
|
47
|
+
}, {
|
|
48
|
+
readonly reason: "upstream_unavailable";
|
|
49
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
50
|
+
readonly retryable: true;
|
|
51
|
+
readonly when: "No attempted server returned a record and at least one lookup failed against api.biorxiv.org.";
|
|
52
|
+
readonly recovery: "Retry the request after a short delay — a published version may well exist; api.biorxiv.org did not answer.";
|
|
38
53
|
}], undefined>;
|
|
39
54
|
//# sourceMappingURL=biorxiv-get-published-version.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-get-published-version.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-published-version.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"biorxiv-get-published-version.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-published-version.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0IzC,CAAC"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* to its full journal publication record using the /pubs endpoint. Use when
|
|
4
4
|
* you need richer crosswalk metadata than biorxiv_get_preprint provides
|
|
5
5
|
* (journal name, published date, full abstract, corresponding author details).
|
|
6
|
+
* bioRxiv and medRxiv share the 10.1101/ DOI prefix, so the DOI alone does not
|
|
7
|
+
* identify the server: the default server="both" resolves against both in
|
|
8
|
+
* parallel and the output names the server that answered. Not-found is reported
|
|
9
|
+
* only when every attempted server answered with an empty collection.
|
|
6
10
|
* @module mcp-server/tools/definitions/biorxiv-get-published-version.tool
|
|
7
11
|
*/
|
|
8
12
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
@@ -11,19 +15,22 @@ import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.
|
|
|
11
15
|
const DOI_REGEX = /^10\.\d{4,}\//;
|
|
12
16
|
export const biorxivGetPublishedVersionTool = tool('biorxiv_get_published_version', {
|
|
13
17
|
title: 'Get Published Journal Version',
|
|
14
|
-
description:
|
|
18
|
+
description: 'Resolve a preprint DOI to its full journal publication record — journal DOI, journal name, published date, and corresponding author details. Use when the preprint\'s `publishedJournalDoi` field from biorxiv_get_preprint is present and you need the full crosswalk metadata. bioRxiv and medRxiv share the 10.1101/ DOI prefix, so server="both" (the default) checks both in parallel and the response reports which server answered. Returns a not-found error when no attempted server holds a published record — check biorxiv_get_preprint if you need to confirm the preprint is published at all.',
|
|
15
19
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
16
20
|
input: z.object({
|
|
17
21
|
doi: z
|
|
18
22
|
.string()
|
|
19
23
|
.describe('Preprint DOI to resolve (e.g. 10.1101/2024.01.15.575123 or 10.64898/2026.05.07.723463).'),
|
|
20
24
|
server: z
|
|
21
|
-
.enum(['biorxiv', 'medrxiv'])
|
|
22
|
-
.default('
|
|
23
|
-
.describe('Server the preprint was posted on.
|
|
25
|
+
.enum(['biorxiv', 'medrxiv', 'both'])
|
|
26
|
+
.default('both')
|
|
27
|
+
.describe('Server the preprint was posted on. "both" (default) checks bioRxiv and medRxiv in parallel — use it when the DOI alone does not tell you which server holds the preprint.'),
|
|
24
28
|
}),
|
|
25
29
|
output: z.object({
|
|
26
30
|
preprintDoi: z.string().describe('The preprint DOI that was resolved.'),
|
|
31
|
+
server: z
|
|
32
|
+
.enum(['biorxiv', 'medrxiv'])
|
|
33
|
+
.describe('The server that returned this published record — never "both".'),
|
|
27
34
|
publishedDoi: z.string().optional().describe('The journal publication DOI.'),
|
|
28
35
|
publishedJournal: z.string().optional().describe('Name of the publishing journal.'),
|
|
29
36
|
publishedDate: z.string().optional().describe('Journal publication date (YYYY-MM-DD).'),
|
|
@@ -42,8 +49,8 @@ export const biorxivGetPublishedVersionTool = tool('biorxiv_get_published_versio
|
|
|
42
49
|
{
|
|
43
50
|
reason: 'doi_not_found',
|
|
44
51
|
code: JsonRpcErrorCode.NotFound,
|
|
45
|
-
when: 'Crosswalk endpoint returns empty collection
|
|
46
|
-
recovery: '
|
|
52
|
+
when: 'Crosswalk endpoint returns an empty collection on every attempted server.',
|
|
53
|
+
recovery: 'Retry with server="both" if you scoped to one server, or check publishedJournalDoi in biorxiv_get_preprint — when it is absent the preprint has no journal version yet.',
|
|
47
54
|
},
|
|
48
55
|
{
|
|
49
56
|
reason: 'invalid_doi_format',
|
|
@@ -51,6 +58,13 @@ export const biorxivGetPublishedVersionTool = tool('biorxiv_get_published_versio
|
|
|
51
58
|
when: 'The input DOI does not match the 10.NNNN/ pattern.',
|
|
52
59
|
recovery: 'Correct the DOI format — bioRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.',
|
|
53
60
|
},
|
|
61
|
+
{
|
|
62
|
+
reason: 'upstream_unavailable',
|
|
63
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
64
|
+
retryable: true,
|
|
65
|
+
when: 'No attempted server returned a record and at least one lookup failed against api.biorxiv.org.',
|
|
66
|
+
recovery: 'Retry the request after a short delay — a published version may well exist; api.biorxiv.org did not answer.',
|
|
67
|
+
},
|
|
54
68
|
],
|
|
55
69
|
async handler(input, ctx) {
|
|
56
70
|
ctx.log.info('Executing biorxiv_get_published_version', {
|
|
@@ -63,16 +77,33 @@ export const biorxivGetPublishedVersionTool = tool('biorxiv_get_published_versio
|
|
|
63
77
|
});
|
|
64
78
|
}
|
|
65
79
|
const service = getBiorxivApiService();
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
80
|
+
const servers = input.server === 'both' ? ['biorxiv', 'medrxiv'] : [input.server];
|
|
81
|
+
const settled = await Promise.allSettled(servers.map((server) => service.getPublishedVersion(input.doi, server, ctx)));
|
|
82
|
+
for (const [i, settledResult] of settled.entries()) {
|
|
83
|
+
if (settledResult.status === 'fulfilled' && settledResult.value) {
|
|
84
|
+
return { ...settledResult.value, server: servers[i] };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Nothing resolved. "Not published" is a claim about what the crosswalk endpoint
|
|
88
|
+
// reported, so a server that never answered leaves it unestablished and retryable.
|
|
89
|
+
const rejections = settled.flatMap((r, i) => r.status === 'rejected' ? [{ server: servers[i], error: r.reason }] : []);
|
|
90
|
+
if (rejections.length > 0) {
|
|
91
|
+
const detail = rejections
|
|
92
|
+
.map((f) => `${f.server}: ${f.error instanceof Error ? f.error.message : String(f.error)}`)
|
|
93
|
+
.join('; ');
|
|
94
|
+
throw ctx.fail('upstream_unavailable', `Crosswalk lookup for ${input.doi} failed — ${detail}`, {
|
|
95
|
+
doi: input.doi,
|
|
96
|
+
servers: rejections.map((f) => f.server),
|
|
97
|
+
...ctx.recoveryFor('upstream_unavailable'),
|
|
98
|
+
}, { cause: rejections[0]?.error });
|
|
69
99
|
}
|
|
70
|
-
|
|
100
|
+
throw ctx.fail('doi_not_found', `No published version found for ${input.doi} on ${servers.join(' or ')}.`, { doi: input.doi, servers, ...ctx.recoveryFor('doi_not_found') });
|
|
71
101
|
},
|
|
72
102
|
format: (result) => {
|
|
73
103
|
const lines = [];
|
|
74
104
|
lines.push(`## Published Version`);
|
|
75
105
|
lines.push(`**Preprint DOI:** ${result.preprintDoi}`);
|
|
106
|
+
lines.push(`**Resolved on server:** ${result.server}`);
|
|
76
107
|
if (result.publishedDoi)
|
|
77
108
|
lines.push(`**Published DOI:** ${result.publishedDoi}`);
|
|
78
109
|
if (result.publishedJournal)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-get-published-version.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-published-version.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"biorxiv-get-published-version.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-published-version.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;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;AAG7E,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,CAAC,+BAA+B,EAAE;IAClF,KAAK,EAAE,+BAA+B;IACtC,WAAW,EACT,8kBAA8kB;IAChlB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,QAAQ,CACP,yFAAyF,CAC1F;QACH,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;aACpC,OAAO,CAAC,MAAM,CAAC;aACf,QAAQ,CACP,2KAA2K,CAC5K;KACJ,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QACvE,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC5B,QAAQ,CAAC,gEAAgE,CAAC;QAC7E,YAAY,EAAE,CAAC,CAAC,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ChF,IAAI,MAAM,CAAC,sCAAsC;YAC/C,KAAK,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,sCAAsC,EAAE,CAAC,CAAC;QAClF,IAAI,MAAM,CAAC,gBAAgB;YAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
* within a date interval. Fans out to both bioRxiv and medRxiv when
|
|
4
4
|
* server="both". Category filtering is applied server-side via the ?category=
|
|
5
5
|
* query param. Returns 30 results per page (API-fixed); use cursor to paginate.
|
|
6
|
-
* When server="both", per-server pagination state is surfaced independently
|
|
6
|
+
* When server="both", per-server pagination state is surfaced independently,
|
|
7
|
+
* including per-server cursor exhaustion: the two servers hold different result
|
|
8
|
+
* counts, so one cursor can be valid for one and past the end for the other.
|
|
9
|
+
* The API reports total 0 for an out-of-range cursor, so an exhausted entry is
|
|
10
|
+
* flagged rather than left to read as "this server has nothing in the interval".
|
|
11
|
+
* A server that never answered is a separate condition: it has no pagination
|
|
12
|
+
* state at all, so it is named in failed[] and in the notice rather than
|
|
13
|
+
* dropped, which would leave a partial result reading as a complete one.
|
|
7
14
|
* @module mcp-server/tools/definitions/biorxiv-list-recent.tool
|
|
8
15
|
*/
|
|
9
16
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -13,8 +20,8 @@ export declare const biorxivListRecentTool: import("@cyanheads/mcp-ts-core").Too
|
|
|
13
20
|
end_date: z.ZodString;
|
|
14
21
|
server: z.ZodDefault<z.ZodEnum<{
|
|
15
22
|
biorxiv: "biorxiv";
|
|
16
|
-
medrxiv: "medrxiv";
|
|
17
23
|
both: "both";
|
|
24
|
+
medrxiv: "medrxiv";
|
|
18
25
|
}>>;
|
|
19
26
|
category: z.ZodOptional<z.ZodString>;
|
|
20
27
|
cursor: z.ZodDefault<z.ZodNumber>;
|
|
@@ -41,13 +48,22 @@ export declare const biorxivListRecentTool: import("@cyanheads/mcp-ts-core").Too
|
|
|
41
48
|
cursor: z.ZodNumber;
|
|
42
49
|
total: z.ZodNumber;
|
|
43
50
|
nextCursor: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
exhausted: z.ZodOptional<z.ZodBoolean>;
|
|
44
52
|
}, z.core.$strip>>;
|
|
45
53
|
medrxiv: z.ZodOptional<z.ZodObject<{
|
|
46
54
|
cursor: z.ZodNumber;
|
|
47
55
|
total: z.ZodNumber;
|
|
48
56
|
nextCursor: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
exhausted: z.ZodOptional<z.ZodBoolean>;
|
|
49
58
|
}, z.core.$strip>>;
|
|
50
59
|
}, z.core.$strip>;
|
|
60
|
+
failed: z.ZodArray<z.ZodObject<{
|
|
61
|
+
server: z.ZodEnum<{
|
|
62
|
+
biorxiv: "biorxiv";
|
|
63
|
+
medrxiv: "medrxiv";
|
|
64
|
+
}>;
|
|
65
|
+
error: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
51
67
|
}, z.core.$strip>, readonly [{
|
|
52
68
|
readonly reason: "invalid_date_range";
|
|
53
69
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
@@ -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
|
|
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;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwCjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0YhC,CAAC"}
|