@cyanheads/biorxiv-mcp-server 0.2.0 → 0.2.1
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 +7 -3
- package/changelog/0.2.x/0.2.1.md +30 -0
- 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 +39 -7
- 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.map +1 -1
- package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
- package/package.json +15 -9
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** biorxiv-mcp-server
|
|
4
|
-
**Version:** 0.2.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
6
|
-
**Engines:** Bun ≥1.3.
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.
|
|
4
|
+
**Version:** 0.2.1
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
|
+
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -198,7 +198,7 @@ src/
|
|
|
198
198
|
## Domain Conventions
|
|
199
199
|
|
|
200
200
|
- **DOI format:** `10.1101/YYYY.MM.DD.NNNNNN`. Validate on input — the bioRxiv API returns empty collections for malformed DOIs without an error code.
|
|
201
|
-
- **Server parameter:** `"biorxiv" | "medrxiv" | "both"`. Default to `"both"
|
|
201
|
+
- **Server parameter:** `"biorxiv" | "medrxiv" | "both"`. Default to `"both"`, including for DOI-resolution tools — both servers issue `10.1101/` DOIs, so the DOI never identifies the server and a single-server default silently misses records held by the other. Fan out via `Promise.allSettled` when `"both"` and name the answering server in the output.
|
|
202
202
|
- **Pagination:** integer `cursor` offset (0, 30, 60, …). Page size is fixed at 30 by the API — do not expose a `limit` parameter.
|
|
203
203
|
- **Two-server pagination:** when `server="both"`, surface per-server state: `{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`. A merged cursor is ambiguous.
|
|
204
204
|
- **EuropePMC enrichment:** `biorxiv_search_preprints` uses EuropePMC for relevance then enriches matching DOIs via the details endpoint. Enrichment routes based on `input.server` — when explicit ("biorxiv" or "medrxiv"), always use that server. `10.1101/` prefix is used as a hint only within `server="both"` to prefer bioRxiv first, but is not a reliable discriminator (both servers share this prefix).
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** biorxiv-mcp-server
|
|
4
|
-
**Version:** 0.2.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
6
|
-
**Engines:** Bun ≥1.3.
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.
|
|
4
|
+
**Version:** 0.2.1
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
|
+
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -198,7 +198,7 @@ src/
|
|
|
198
198
|
## Domain Conventions
|
|
199
199
|
|
|
200
200
|
- **DOI format:** `10.1101/YYYY.MM.DD.NNNNNN`. Validate on input — the bioRxiv API returns empty collections for malformed DOIs without an error code.
|
|
201
|
-
- **Server parameter:** `"biorxiv" | "medrxiv" | "both"`. Default to `"both"
|
|
201
|
+
- **Server parameter:** `"biorxiv" | "medrxiv" | "both"`. Default to `"both"`, including for DOI-resolution tools — both servers issue `10.1101/` DOIs, so the DOI never identifies the server and a single-server default silently misses records held by the other. Fan out via `Promise.allSettled` when `"both"` and name the answering server in the output.
|
|
202
202
|
- **Pagination:** integer `cursor` offset (0, 30, 60, …). Page size is fixed at 30 by the API — do not expose a `limit` parameter.
|
|
203
203
|
- **Two-server pagination:** when `server="both"`, surface per-server state: `{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`. A merged cursor is ambiguous.
|
|
204
204
|
- **EuropePMC enrichment:** `biorxiv_search_preprints` uses EuropePMC for relevance then enriches matching DOIs via the details endpoint. Enrichment routes based on `input.server` — when explicit ("biorxiv" or "medrxiv"), always use that server. `10.1101/` prefix is used as a hint only within `server="both"` to prefer bioRxiv first, but is not a reliable discriminator (both servers share this prefix).
|
package/Dockerfile
CHANGED
|
@@ -60,7 +60,7 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
|
60
60
|
ARG OTEL_ENABLED=true
|
|
61
61
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
62
62
|
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
63
|
-
bun add @hono/otel \
|
|
63
|
+
bun add --omit=dev --ignore-scripts @hono/otel \
|
|
64
64
|
@opentelemetry/instrumentation-http \
|
|
65
65
|
@opentelemetry/exporter-metrics-otlp-http \
|
|
66
66
|
@opentelemetry/exporter-trace-otlp-http \
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/biorxiv-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/biorxiv-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -42,6 +42,7 @@ Fetch preprint metadata by DOI — all revisions in one call.
|
|
|
42
42
|
- Each DOI returns the full revision history in `collection[]` — one API call per DOI, no enumeration loop
|
|
43
43
|
- Includes title, authors, abstract, category, license, JATS XML full-text link (`jatsxml`), and published journal DOI when the preprint has been accepted
|
|
44
44
|
- Scope to `biorxiv`, `medrxiv`, or `both`; when `both`, each DOI fans out in parallel and partial failures report per-DOI in `failed[]`
|
|
45
|
+
- Each `failed[]` entry carries a `reason` (`not_found`, `invalid_doi_format`, `upstream_unavailable`) and a `retryable` flag — a DOI is only reported as not found when every attempted server answered
|
|
45
46
|
|
|
46
47
|
---
|
|
47
48
|
|
|
@@ -53,6 +54,8 @@ Page through preprints in a date interval.
|
|
|
53
54
|
- Fixed page size of 30 (API constraint); advance with integer `cursor` (0, 30, 60, …)
|
|
54
55
|
- Response includes `total` count per server for calculating remaining pages
|
|
55
56
|
- When `server="both"`, each server paginates independently; response surfaces per-server pagination state (`{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`)
|
|
57
|
+
- A server whose cursor is past its last page is marked `exhausted: true` — the API reports `total: 0` for an out-of-range cursor, so that count is an artifact rather than the interval total
|
|
58
|
+
- A server that does not answer under `server="both"` is named in `failed[]` rather than dropped; the other server's page is still returned, and a non-empty `failed[]` marks the result set as partial
|
|
56
59
|
|
|
57
60
|
---
|
|
58
61
|
|
|
@@ -72,9 +75,10 @@ Keyword and/or author search with relevance ranking.
|
|
|
72
75
|
|
|
73
76
|
Resolve a preprint DOI to its journal publication crosswalk.
|
|
74
77
|
|
|
75
|
-
- Uses the `/pubs/{server}/{doi}` endpoint for richer metadata than the `
|
|
78
|
+
- Uses the `/pubs/{server}/{doi}` endpoint for richer metadata than the `publishedJournalDoi` field in `biorxiv_get_preprint`
|
|
76
79
|
- Returns journal DOI, journal name, published date, and corresponding author institution
|
|
77
|
-
- Use when the preprint's `
|
|
80
|
+
- Use when the preprint's `publishedJournalDoi` field is present and you need the full crosswalk record
|
|
81
|
+
- Scope to `biorxiv`, `medrxiv`, or `both`; `both` is the default because the two servers share the `10.1101/` DOI prefix, and the output `server` field names the one that answered
|
|
78
82
|
|
|
79
83
|
---
|
|
80
84
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "biorxiv_get_preprint and biorxiv_get_published_version distinguish upstream failures from not-found; biorxiv_list_recent surfaces exhausted cursors and failed servers (#32, #34, #35, #39)"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.1 — 2026-08-09
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`biorxiv_get_published_version`** — `server` gains `"both"` and now defaults to it, fanning out across bioRxiv and medRxiv in parallel (the two servers share the `10.1101/` prefix, so a single-server default silently missed records held by the other). New required output field `server` names which server answered. [#34](https://github.com/cyanheads/biorxiv-mcp-server/issues/34)
|
|
12
|
+
|
|
13
|
+
## Fixed
|
|
14
|
+
|
|
15
|
+
- **`biorxiv_get_preprint`** — a DOI is now reported `not_found` only when every attempted server answered with an empty collection; a server that failed to respond leaves absence unestablished and the DOI is classified `upstream_unavailable` (retryable) instead. Each `failed[]` entry carries a new `reason` (`not_found`, `invalid_doi_format`, `upstream_unavailable`) and `retryable` flag; the batch-level thrown error follows the same discrimination via a new declared `upstream_unavailable` contract entry. [#32](https://github.com/cyanheads/biorxiv-mcp-server/issues/32)
|
|
16
|
+
- **`biorxiv_get_published_version`** — `doi_not_found` recovery hint no longer asserts the preprint is unpublished; it now points at retrying with `server="both"` or checking `publishedJournalDoi`. A server that fails to respond throws a new retryable `upstream_unavailable` instead of being folded into `doi_not_found`. [#34](https://github.com/cyanheads/biorxiv-mcp-server/issues/34)
|
|
17
|
+
- **`biorxiv_list_recent`** — under `server="both"`, a per-server cursor past the last page now sets a new `exhausted: true` flag instead of its `total: 0` reading as "nothing in the interval"; a server that fails to answer is named in a new top-level `failed[]` (rather than silently dropped) and in the response `notice`, marking the result set as partial. `ctx.enrich.notice` is last-wins, so every applicable qualification (failed servers, exhausted cursors, empty results) is now composed into one notice string. [#35](https://github.com/cyanheads/biorxiv-mcp-server/issues/35), [#39](https://github.com/cyanheads/biorxiv-mcp-server/issues/39)
|
|
18
|
+
- **README** — `biorxiv_get_published_version` section referenced a `published` field; corrected to `publishedJournalDoi`, matching the actual `biorxiv_get_preprint` output.
|
|
19
|
+
|
|
20
|
+
## Dependencies
|
|
21
|
+
|
|
22
|
+
- **`@cyanheads/mcp-ts-core`** `^0.10.14` → `^0.11.1`
|
|
23
|
+
- **`typescript`** `^6.0.3` → `^7.0.2`
|
|
24
|
+
- **`defuddle`** `^0.19.0` → `^0.19.2`
|
|
25
|
+
- **`linkedom`** `^0.18.12` → `^0.18.13`
|
|
26
|
+
- **`@biomejs/biome`** `2.5.2` → `2.5.7`
|
|
27
|
+
- **`@types/node`** `26.1.0` → `26.1.2`
|
|
28
|
+
- **`ignore`** `^7.0.5` → `^7.0.6`
|
|
29
|
+
- **`tsc-alias`** `^1.9.0` → `^1.9.1`
|
|
30
|
+
- New `overrides` block pins `fast-uri` `^3.1.5`, `ip-address` `^10.3.1`, `js-yaml` `^3.15.1`, and `postcss` `^8.5.23` — transitive advisories that a floating range alone wouldn't hold down; clears `bun audit` to zero vulnerabilities.
|
|
@@ -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 { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -12,8 +15,8 @@ export declare const biorxivGetPreprintTool: import("@cyanheads/mcp-ts-core").To
|
|
|
12
15
|
dois: z.ZodArray<z.ZodString>;
|
|
13
16
|
server: z.ZodDefault<z.ZodEnum<{
|
|
14
17
|
biorxiv: "biorxiv";
|
|
15
|
-
medrxiv: "medrxiv";
|
|
16
18
|
both: "both";
|
|
19
|
+
medrxiv: "medrxiv";
|
|
17
20
|
}>>;
|
|
18
21
|
}, z.core.$strip>, z.ZodObject<{
|
|
19
22
|
preprints: z.ZodArray<z.ZodObject<{
|
|
@@ -39,16 +42,28 @@ export declare const biorxivGetPreprintTool: import("@cyanheads/mcp-ts-core").To
|
|
|
39
42
|
failed: z.ZodArray<z.ZodObject<{
|
|
40
43
|
doi: z.ZodString;
|
|
41
44
|
error: z.ZodString;
|
|
45
|
+
reason: z.ZodEnum<{
|
|
46
|
+
invalid_doi_format: "invalid_doi_format";
|
|
47
|
+
not_found: "not_found";
|
|
48
|
+
upstream_unavailable: "upstream_unavailable";
|
|
49
|
+
}>;
|
|
50
|
+
retryable: z.ZodBoolean;
|
|
42
51
|
}, z.core.$strip>>;
|
|
43
52
|
}, z.core.$strip>, readonly [{
|
|
44
53
|
readonly reason: "doi_not_found";
|
|
45
54
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
46
|
-
readonly when: "ALL requested DOIs resolve to empty collections on all requested servers.";
|
|
55
|
+
readonly when: "ALL requested DOIs resolve to empty collections on all requested servers, with every server answering.";
|
|
47
56
|
readonly recovery: "Verify the DOI exists on bioRxiv or medRxiv. Supported prefixes: 10.1101/ and 10.64898/.";
|
|
48
57
|
}, {
|
|
49
58
|
readonly reason: "invalid_doi_format";
|
|
50
59
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
51
60
|
readonly when: "One or more input DOIs do not match the 10.NNNN/ pattern.";
|
|
52
61
|
readonly recovery: "Correct the DOI format — bioRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.";
|
|
62
|
+
}, {
|
|
63
|
+
readonly reason: "upstream_unavailable";
|
|
64
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
65
|
+
readonly retryable: true;
|
|
66
|
+
readonly when: "No DOI resolved and at least one lookup failed against api.biorxiv.org, so absence could not be established for any requested DOI.";
|
|
67
|
+
readonly recovery: "Retry the request after a short delay — the DOIs may well exist; api.biorxiv.org did not answer.";
|
|
53
68
|
}], undefined>;
|
|
54
69
|
//# sourceMappingURL=biorxiv-get-preprint.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-get-preprint.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-preprint.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"biorxiv-get-preprint.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-preprint.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAgEjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0MjC,CAAC"}
|
|
@@ -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,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,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,C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