@cyanheads/pubmed-mcp-server 2.9.8 → 2.9.9
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 +30 -8
- package/CLAUDE.md +30 -8
- package/Dockerfile +13 -7
- package/README.md +1 -1
- package/dist/mcp-server/prompts/definitions/research-plan.prompt.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/convert-ids.tool.d.ts +17 -17
- package/dist/mcp-server/tools/definitions/fetch-articles.tool.d.ts +18 -18
- package/dist/mcp-server/tools/definitions/fetch-articles.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fetch-fulltext.tool.d.ts +40 -40
- package/dist/mcp-server/tools/definitions/find-related.tool.d.ts +33 -33
- package/dist/mcp-server/tools/definitions/format-citations.tool.d.ts +17 -17
- package/dist/mcp-server/tools/definitions/format-citations.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/format-citations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-citation.tool.d.ts +16 -16
- package/dist/mcp-server/tools/definitions/lookup-citation.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-citation.tool.js +9 -12
- package/dist/mcp-server/tools/definitions/lookup-citation.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.d.ts +20 -16
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.js +73 -22
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/pubmed-europepmc-search.tool.d.ts +18 -18
- package/dist/mcp-server/tools/definitions/pubmed-europepmc-search.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-articles.tool.d.ts +22 -22
- package/dist/mcp-server/tools/definitions/spell-check.tool.d.ts +15 -15
- package/dist/mcp-server/tools/definitions/spell-check.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spell-check.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/spell-check.tool.js.map +1 -1
- package/dist/services/error-contracts.d.ts +33 -33
- package/dist/services/error-contracts.d.ts.map +1 -1
- package/dist/services/europe-pmc/api-client.d.ts.map +1 -1
- package/dist/services/europe-pmc/api-client.js +1 -0
- package/dist/services/europe-pmc/api-client.js.map +1 -1
- package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
- package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -1
- package/dist/services/europe-pmc/request-queue.d.ts.map +1 -1
- package/dist/services/europe-pmc/request-queue.js.map +1 -1
- package/dist/services/europe-pmc/types.d.ts +2 -2
- package/dist/services/europe-pmc/types.d.ts.map +1 -1
- package/dist/services/ncbi/api-client.d.ts.map +1 -1
- package/dist/services/ncbi/api-client.js.map +1 -1
- package/dist/services/ncbi/ncbi-service.d.ts.map +1 -1
- package/dist/services/ncbi/ncbi-service.js.map +1 -1
- package/dist/services/ncbi/parsing/article-parser.js.map +1 -1
- package/dist/services/ncbi/parsing/esummary-parser.d.ts.map +1 -1
- package/dist/services/ncbi/parsing/esummary-parser.js +3 -0
- package/dist/services/ncbi/parsing/esummary-parser.js.map +1 -1
- package/dist/services/ncbi/parsing/xml-helpers.js.map +1 -1
- package/dist/services/ncbi/request-queue.d.ts.map +1 -1
- package/dist/services/ncbi/request-queue.js.map +1 -1
- package/dist/services/ncbi/response-handler.d.ts.map +1 -1
- package/dist/services/ncbi/types.d.ts +6 -0
- package/dist/services/ncbi/types.d.ts.map +1 -1
- package/dist/services/openalex/api-client.d.ts.map +1 -1
- package/dist/services/openalex/api-client.js +1 -0
- package/dist/services/openalex/api-client.js.map +1 -1
- package/dist/services/openalex/openalex-service.d.ts.map +1 -1
- package/dist/services/openalex/openalex-service.js.map +1 -1
- package/dist/services/unpaywall/unpaywall-service.d.ts.map +1 -1
- package/dist/services/unpaywall/unpaywall-service.js +1 -0
- package/dist/services/unpaywall/unpaywall-service.js.map +1 -1
- package/package.json +24 -17
- package/server.json +3 -3
|
@@ -9,18 +9,18 @@ import { z } from '@cyanheads/mcp-ts-core';
|
|
|
9
9
|
export declare const findRelatedTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
10
10
|
pmid: z.ZodString;
|
|
11
11
|
relationship: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
cited_by: "cited_by";
|
|
12
13
|
references: "references";
|
|
13
14
|
similar: "similar";
|
|
14
|
-
cited_by: "cited_by";
|
|
15
15
|
}>>;
|
|
16
16
|
maxResults: z.ZodDefault<z.ZodNumber>;
|
|
17
17
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
18
18
|
}, z.core.$strip>, z.ZodObject<{
|
|
19
19
|
sourcePmid: z.ZodString;
|
|
20
20
|
relationship: z.ZodEnum<{
|
|
21
|
+
cited_by: "cited_by";
|
|
21
22
|
references: "references";
|
|
22
23
|
similar: "similar";
|
|
23
|
-
cited_by: "cited_by";
|
|
24
24
|
}>;
|
|
25
25
|
offset: z.ZodNumber;
|
|
26
26
|
articles: z.ZodArray<z.ZodObject<{
|
|
@@ -31,71 +31,71 @@ export declare const findRelatedTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
31
31
|
pubDate: z.ZodOptional<z.ZodString>;
|
|
32
32
|
}, z.core.$strip>>;
|
|
33
33
|
}, z.core.$strip>, readonly [{
|
|
34
|
-
readonly reason:
|
|
34
|
+
readonly reason: 'queue_full';
|
|
35
35
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
36
|
-
readonly when:
|
|
37
|
-
readonly recovery:
|
|
36
|
+
readonly when: 'Local NCBI request queue is at capacity.';
|
|
37
|
+
readonly recovery: 'Retry after 1-2 seconds; the request queue hit the NCBI rate limit.';
|
|
38
38
|
readonly retryable: true;
|
|
39
39
|
}, {
|
|
40
|
-
readonly reason:
|
|
40
|
+
readonly reason: 'ncbi_unreachable';
|
|
41
41
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
42
|
-
readonly when:
|
|
43
|
-
readonly recovery:
|
|
42
|
+
readonly when: 'NCBI E-utilities is unreachable after all retry attempts.';
|
|
43
|
+
readonly recovery: 'Retry after a brief delay; NCBI was unreachable across all retry attempts.';
|
|
44
44
|
readonly retryable: true;
|
|
45
45
|
}, {
|
|
46
|
-
readonly reason:
|
|
46
|
+
readonly reason: 'ncbi_deadline_exceeded';
|
|
47
47
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
48
|
-
readonly when:
|
|
49
|
-
readonly recovery:
|
|
48
|
+
readonly when: 'Total request deadline expired before NCBI returned a response.';
|
|
49
|
+
readonly recovery: 'Reduce batch size or retry; NCBI may be under temporary load.';
|
|
50
50
|
readonly retryable: true;
|
|
51
51
|
}, {
|
|
52
|
-
readonly reason:
|
|
52
|
+
readonly reason: 'ncbi_invalid_response';
|
|
53
53
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.SerializationError;
|
|
54
|
-
readonly when:
|
|
55
|
-
readonly recovery:
|
|
54
|
+
readonly when: 'NCBI returned a body that could not be parsed (invalid XML/JSON).';
|
|
55
|
+
readonly recovery: 'Retry the request; NCBI returned a malformed response that could not be parsed.';
|
|
56
56
|
readonly retryable: true;
|
|
57
57
|
}, {
|
|
58
|
-
readonly reason:
|
|
58
|
+
readonly reason: 'ncbi_resource_not_found';
|
|
59
59
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
60
|
-
readonly when:
|
|
61
|
-
readonly recovery:
|
|
60
|
+
readonly when: 'NCBI returned a structured "not found" error for the requested ID(s).';
|
|
61
|
+
readonly recovery: 'Verify the ID exists in PubMed; the resource was not found in NCBI and retrying will not help.';
|
|
62
62
|
readonly retryable: false;
|
|
63
63
|
}, {
|
|
64
|
-
readonly reason:
|
|
64
|
+
readonly reason: 'europepmc_unreachable';
|
|
65
65
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
66
|
-
readonly when:
|
|
67
|
-
readonly recovery:
|
|
66
|
+
readonly when: 'Europe PMC was unreachable after all retry attempts.';
|
|
67
|
+
readonly recovery: 'Retry after a brief delay; Europe PMC was unreachable. NCBI PMC and Unpaywall remain available.';
|
|
68
68
|
readonly retryable: true;
|
|
69
69
|
}, {
|
|
70
|
-
readonly reason:
|
|
70
|
+
readonly reason: 'europepmc_invalid_response';
|
|
71
71
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.SerializationError;
|
|
72
|
-
readonly when:
|
|
73
|
-
readonly recovery:
|
|
72
|
+
readonly when: 'Europe PMC returned a body that could not be parsed (invalid JSON or XML).';
|
|
73
|
+
readonly recovery: 'Retry the request; Europe PMC returned a malformed response that could not be parsed.';
|
|
74
74
|
readonly retryable: true;
|
|
75
75
|
}, {
|
|
76
|
-
readonly reason:
|
|
76
|
+
readonly reason: 'europepmc_invalid_input';
|
|
77
77
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
78
|
-
readonly when:
|
|
79
|
-
readonly recovery:
|
|
78
|
+
readonly when: 'Europe PMC rejected the request input (empty query, unknown sort field, malformed parameter).';
|
|
79
|
+
readonly recovery: 'Adjust the input — usually the query or sort field — before retrying; the same input will be rejected again.';
|
|
80
80
|
readonly retryable: false;
|
|
81
81
|
}, {
|
|
82
|
-
readonly reason:
|
|
82
|
+
readonly reason: 'openalex_unreachable';
|
|
83
83
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
84
|
-
readonly when:
|
|
85
|
-
readonly recovery:
|
|
84
|
+
readonly when: 'OpenAlex was unreachable after all retry attempts.';
|
|
85
|
+
readonly recovery: 'Retry after a brief delay; OpenAlex was unreachable. NCBI and Europe PMC remain available.';
|
|
86
86
|
readonly retryable: true;
|
|
87
87
|
}, {
|
|
88
|
-
readonly reason:
|
|
88
|
+
readonly reason: 'openalex_invalid_response';
|
|
89
89
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.SerializationError;
|
|
90
|
-
readonly when:
|
|
91
|
-
readonly recovery:
|
|
90
|
+
readonly when: 'OpenAlex returned a body that could not be parsed (invalid JSON).';
|
|
91
|
+
readonly recovery: 'Retry the request; OpenAlex returned a malformed response that could not be parsed.';
|
|
92
92
|
readonly retryable: true;
|
|
93
93
|
}], {
|
|
94
94
|
readonly totalCount: z.ZodNumber;
|
|
95
95
|
readonly source: z.ZodEnum<{
|
|
96
96
|
europepmc: "europepmc";
|
|
97
|
-
openalex: "openalex";
|
|
98
97
|
ncbi: "ncbi";
|
|
98
|
+
openalex: "openalex";
|
|
99
99
|
}>;
|
|
100
100
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
101
101
|
}>;
|
|
@@ -8,14 +8,14 @@ export declare const formatCitationsTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
8
8
|
pmids: z.ZodArray<z.ZodString>;
|
|
9
9
|
format: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
|
|
10
10
|
apa: "apa";
|
|
11
|
-
mla: "mla";
|
|
12
11
|
bibtex: "bibtex";
|
|
12
|
+
mla: "mla";
|
|
13
13
|
ris: "ris";
|
|
14
14
|
vancouver: "vancouver";
|
|
15
15
|
}>, z.ZodArray<z.ZodEnum<{
|
|
16
16
|
apa: "apa";
|
|
17
|
-
mla: "mla";
|
|
18
17
|
bibtex: "bibtex";
|
|
18
|
+
mla: "mla";
|
|
19
19
|
ris: "ris";
|
|
20
20
|
vancouver: "vancouver";
|
|
21
21
|
}>>]>>;
|
|
@@ -29,34 +29,34 @@ export declare const formatCitationsTool: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
29
29
|
totalFormatted: z.ZodNumber;
|
|
30
30
|
unavailablePmids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
31
|
}, z.core.$strip>, readonly [{
|
|
32
|
-
readonly reason:
|
|
32
|
+
readonly reason: 'queue_full';
|
|
33
33
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
34
|
-
readonly when:
|
|
35
|
-
readonly recovery:
|
|
34
|
+
readonly when: 'Local NCBI request queue is at capacity.';
|
|
35
|
+
readonly recovery: 'Retry after 1-2 seconds; the request queue hit the NCBI rate limit.';
|
|
36
36
|
readonly retryable: true;
|
|
37
37
|
}, {
|
|
38
|
-
readonly reason:
|
|
38
|
+
readonly reason: 'ncbi_unreachable';
|
|
39
39
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
40
|
-
readonly when:
|
|
41
|
-
readonly recovery:
|
|
40
|
+
readonly when: 'NCBI E-utilities is unreachable after all retry attempts.';
|
|
41
|
+
readonly recovery: 'Retry after a brief delay; NCBI was unreachable across all retry attempts.';
|
|
42
42
|
readonly retryable: true;
|
|
43
43
|
}, {
|
|
44
|
-
readonly reason:
|
|
44
|
+
readonly reason: 'ncbi_deadline_exceeded';
|
|
45
45
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
46
|
-
readonly when:
|
|
47
|
-
readonly recovery:
|
|
46
|
+
readonly when: 'Total request deadline expired before NCBI returned a response.';
|
|
47
|
+
readonly recovery: 'Reduce batch size or retry; NCBI may be under temporary load.';
|
|
48
48
|
readonly retryable: true;
|
|
49
49
|
}, {
|
|
50
|
-
readonly reason:
|
|
50
|
+
readonly reason: 'ncbi_invalid_response';
|
|
51
51
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.SerializationError;
|
|
52
|
-
readonly when:
|
|
53
|
-
readonly recovery:
|
|
52
|
+
readonly when: 'NCBI returned a body that could not be parsed (invalid XML/JSON).';
|
|
53
|
+
readonly recovery: 'Retry the request; NCBI returned a malformed response that could not be parsed.';
|
|
54
54
|
readonly retryable: true;
|
|
55
55
|
}, {
|
|
56
|
-
readonly reason:
|
|
56
|
+
readonly reason: 'ncbi_resource_not_found';
|
|
57
57
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
58
|
-
readonly when:
|
|
59
|
-
readonly recovery:
|
|
58
|
+
readonly when: 'NCBI returned a structured "not found" error for the requested ID(s).';
|
|
59
|
+
readonly recovery: 'Verify the ID exists in PubMed; the resource was not found in NCBI and retrying will not help.';
|
|
60
60
|
readonly retryable: false;
|
|
61
61
|
}], {
|
|
62
62
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
@@ -13,7 +13,7 @@ import { conceptMeta, EDAM_DATA_FORMATTING, SCHEMA_CREATIVE_WORK } from './_conc
|
|
|
13
13
|
import { pmidStringSchema } from './_schemas.js';
|
|
14
14
|
const CitationStyleEnum = z.enum(['apa', 'mla', 'bibtex', 'ris', 'vancouver']);
|
|
15
15
|
export const formatCitationsTool = tool('pubmed_format_citations', {
|
|
16
|
-
description: 'Get formatted citations for PubMed articles in one or more
|
|
16
|
+
description: 'Get formatted citations for PubMed articles in one or more formats (apa, mla, bibtex, ris, vancouver). Pass a single format as a string or multiple as an array.',
|
|
17
17
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
18
18
|
_meta: conceptMeta([SCHEMA_CREATIVE_WORK, EDAM_DATA_FORMATTING]),
|
|
19
19
|
sourceUrl: 'https://github.com/cyanheads/pubmed-mcp-server/blob/main/src/mcp-server/tools/definitions/format-citations.tool.ts',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-citations.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/format-citations.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAEL,eAAe,GAChB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IACjE,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"format-citations.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/format-citations.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAEL,eAAe,GAChB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AAE/E,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QACD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACtC,IAAI,KAAK,CAAC,KAAK;gBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;YAClD,KAAK,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;gBAChE,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;gBAC3C,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;oBAC1C,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,KAAK,QAAQ,UAAU,CAAC,CAAC;gBACpD,CAAC;qBAAM,CAAC;oBACN,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -21,9 +21,9 @@ export declare const lookupCitationTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
21
21
|
pmid: z.ZodOptional<z.ZodString>;
|
|
22
22
|
matched: z.ZodBoolean;
|
|
23
23
|
status: z.ZodEnum<{
|
|
24
|
+
ambiguous: "ambiguous";
|
|
24
25
|
matched: "matched";
|
|
25
26
|
not_found: "not_found";
|
|
26
|
-
ambiguous: "ambiguous";
|
|
27
27
|
}>;
|
|
28
28
|
detail: z.ZodOptional<z.ZodString>;
|
|
29
29
|
candidatePmids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -40,34 +40,34 @@ export declare const lookupCitationTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
40
40
|
totalSubmitted: z.ZodNumber;
|
|
41
41
|
totalWarnings: z.ZodNumber;
|
|
42
42
|
}, z.core.$strip>, readonly [{
|
|
43
|
-
readonly reason:
|
|
43
|
+
readonly reason: 'queue_full';
|
|
44
44
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
45
|
-
readonly when:
|
|
46
|
-
readonly recovery:
|
|
45
|
+
readonly when: 'Local NCBI request queue is at capacity.';
|
|
46
|
+
readonly recovery: 'Retry after 1-2 seconds; the request queue hit the NCBI rate limit.';
|
|
47
47
|
readonly retryable: true;
|
|
48
48
|
}, {
|
|
49
|
-
readonly reason:
|
|
49
|
+
readonly reason: 'ncbi_unreachable';
|
|
50
50
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
51
|
-
readonly when:
|
|
52
|
-
readonly recovery:
|
|
51
|
+
readonly when: 'NCBI E-utilities is unreachable after all retry attempts.';
|
|
52
|
+
readonly recovery: 'Retry after a brief delay; NCBI was unreachable across all retry attempts.';
|
|
53
53
|
readonly retryable: true;
|
|
54
54
|
}, {
|
|
55
|
-
readonly reason:
|
|
55
|
+
readonly reason: 'ncbi_deadline_exceeded';
|
|
56
56
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
57
|
-
readonly when:
|
|
58
|
-
readonly recovery:
|
|
57
|
+
readonly when: 'Total request deadline expired before NCBI returned a response.';
|
|
58
|
+
readonly recovery: 'Reduce batch size or retry; NCBI may be under temporary load.';
|
|
59
59
|
readonly retryable: true;
|
|
60
60
|
}, {
|
|
61
|
-
readonly reason:
|
|
61
|
+
readonly reason: 'ncbi_invalid_response';
|
|
62
62
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.SerializationError;
|
|
63
|
-
readonly when:
|
|
64
|
-
readonly recovery:
|
|
63
|
+
readonly when: 'NCBI returned a body that could not be parsed (invalid XML/JSON).';
|
|
64
|
+
readonly recovery: 'Retry the request; NCBI returned a malformed response that could not be parsed.';
|
|
65
65
|
readonly retryable: true;
|
|
66
66
|
}, {
|
|
67
|
-
readonly reason:
|
|
67
|
+
readonly reason: 'ncbi_resource_not_found';
|
|
68
68
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
69
|
-
readonly when:
|
|
70
|
-
readonly recovery:
|
|
69
|
+
readonly when: 'NCBI returned a structured "not found" error for the requested ID(s).';
|
|
70
|
+
readonly recovery: 'Verify the ID exists in PubMed; the resource was not found in NCBI and retrying will not help.';
|
|
71
71
|
readonly retryable: false;
|
|
72
72
|
}], undefined>;
|
|
73
73
|
//# sourceMappingURL=lookup-citation.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-citation.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-citation.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"lookup-citation.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-citation.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiBjD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+R7B,CAAC"}
|
|
@@ -14,13 +14,6 @@ import { conceptMeta, EDAM_DATA_RETRIEVAL, EDAM_PUBMED_ID, SCHEMA_SCHOLARLY_ARTI
|
|
|
14
14
|
function surname(name) {
|
|
15
15
|
return name.trim().split(/\s+/)[0]?.toLowerCase() ?? '';
|
|
16
16
|
}
|
|
17
|
-
/** Split a formatted authors string ("Lastname FI, Lastname FI, et al.") into surnames. */
|
|
18
|
-
function authorSurnames(authors) {
|
|
19
|
-
return authors
|
|
20
|
-
.split(', ')
|
|
21
|
-
.map((a) => surname(a))
|
|
22
|
-
.filter((s) => s.length > 0 && s !== 'et');
|
|
23
|
-
}
|
|
24
17
|
export const lookupCitationTool = tool('pubmed_lookup_citation', {
|
|
25
18
|
description: `Look up PubMed IDs from partial bibliographic citations. Useful when you have a reference (journal, year, volume, page, author) and need the PMID — deterministic citation matching, more reliable than free-text search for structured references. Each citation must include at least journal or year (ECitMatch primary-keys on journal+volume+page; author-only or volume-only inputs guarantee no match); more fields = better match accuracy.`,
|
|
26
19
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
@@ -125,6 +118,7 @@ export const lookupCitationTool = tool('pubmed_lookup_citation', {
|
|
|
125
118
|
for (const s of summaries) {
|
|
126
119
|
summaryByPmid.set(s.pmid, {
|
|
127
120
|
...(s.authors && { authors: s.authors }),
|
|
121
|
+
...(s.authorNames?.length && { authorNames: s.authorNames }),
|
|
128
122
|
...(s.pubDate && { pubDate: s.pubDate }),
|
|
129
123
|
});
|
|
130
124
|
}
|
|
@@ -144,25 +138,28 @@ export const lookupCitationTool = tool('pubmed_lookup_citation', {
|
|
|
144
138
|
if (!summary)
|
|
145
139
|
return base;
|
|
146
140
|
const warnings = [];
|
|
147
|
-
const { authors, pubDate } = summary;
|
|
141
|
+
const { authors, authorNames, pubDate } = summary;
|
|
148
142
|
if (authors) {
|
|
149
143
|
const firstAuthor = authors.split(', ')[0]?.trim();
|
|
150
144
|
if (firstAuthor && firstAuthor !== 'et al.')
|
|
151
145
|
base.matchedFirstAuthor = firstAuthor;
|
|
152
146
|
const queried = queriedAuthorByKey.get(r.key);
|
|
153
|
-
|
|
147
|
+
// Verified against the full roster, not `authors` — that display string
|
|
148
|
+
// collapses to three names plus "et al.", so matching on it flags a
|
|
149
|
+
// genuine fourth-or-later author as a mismatch. (#87)
|
|
150
|
+
if (queried && authorNames?.length) {
|
|
154
151
|
const querySurname = surname(queried);
|
|
155
|
-
const articleSurnames =
|
|
152
|
+
const articleSurnames = authorNames.map(surname);
|
|
156
153
|
if (querySurname && !articleSurnames.includes(querySurname)) {
|
|
157
154
|
warnings.push({
|
|
158
155
|
code: 'author_mismatch',
|
|
159
|
-
message: `Queried author "${queried}" not found in matched article
|
|
156
|
+
message: `Queried author "${queried}" not found in the matched article's ${authorNames.length}-author roster (${authors}). ECitMatch weights journal+volume+page and may return a PMID whose authors disagree with the query — verify before using this PMID.`,
|
|
160
157
|
});
|
|
161
158
|
ctx.log.warning('Citation match returned PMID with author mismatch', {
|
|
162
159
|
key: r.key,
|
|
163
160
|
pmid: r.pmid,
|
|
164
161
|
queriedAuthor: queried,
|
|
165
|
-
|
|
162
|
+
matchedAuthorCount: authorNames.length,
|
|
166
163
|
});
|
|
167
164
|
}
|
|
168
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-citation.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-citation.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAEnF,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,yFAAyF;AACzF,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAC1D,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"lookup-citation.tool.js","s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
+
* Searches the NCBI MeSH database with offset pagination and optionally
|
|
4
|
+
* retrieves detailed records.
|
|
4
5
|
* @module src/mcp-server/tools/definitions/lookup-mesh.tool
|
|
5
6
|
*/
|
|
6
7
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
8
|
export declare const lookupMeshTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
9
|
query: z.ZodString;
|
|
9
10
|
maxResults: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
10
12
|
includeDetails: z.ZodDefault<z.ZodBoolean>;
|
|
11
13
|
}, z.core.$strip>, z.ZodObject<{
|
|
12
14
|
query: z.ZodString;
|
|
15
|
+
offset: z.ZodNumber;
|
|
16
|
+
nextOffset: z.ZodOptional<z.ZodNumber>;
|
|
13
17
|
results: z.ZodArray<z.ZodObject<{
|
|
14
18
|
meshId: z.ZodString;
|
|
15
19
|
entrezUid: z.ZodString;
|
|
@@ -19,34 +23,34 @@ export declare const lookupMeshTool: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
19
23
|
entryTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
24
|
}, z.core.$strip>>;
|
|
21
25
|
}, z.core.$strip>, readonly [{
|
|
22
|
-
readonly reason:
|
|
26
|
+
readonly reason: 'queue_full';
|
|
23
27
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
|
|
24
|
-
readonly when:
|
|
25
|
-
readonly recovery:
|
|
28
|
+
readonly when: 'Local NCBI request queue is at capacity.';
|
|
29
|
+
readonly recovery: 'Retry after 1-2 seconds; the request queue hit the NCBI rate limit.';
|
|
26
30
|
readonly retryable: true;
|
|
27
31
|
}, {
|
|
28
|
-
readonly reason:
|
|
32
|
+
readonly reason: 'ncbi_unreachable';
|
|
29
33
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
30
|
-
readonly when:
|
|
31
|
-
readonly recovery:
|
|
34
|
+
readonly when: 'NCBI E-utilities is unreachable after all retry attempts.';
|
|
35
|
+
readonly recovery: 'Retry after a brief delay; NCBI was unreachable across all retry attempts.';
|
|
32
36
|
readonly retryable: true;
|
|
33
37
|
}, {
|
|
34
|
-
readonly reason:
|
|
38
|
+
readonly reason: 'ncbi_deadline_exceeded';
|
|
35
39
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Timeout;
|
|
36
|
-
readonly when:
|
|
37
|
-
readonly recovery:
|
|
40
|
+
readonly when: 'Total request deadline expired before NCBI returned a response.';
|
|
41
|
+
readonly recovery: 'Reduce batch size or retry; NCBI may be under temporary load.';
|
|
38
42
|
readonly retryable: true;
|
|
39
43
|
}, {
|
|
40
|
-
readonly reason:
|
|
44
|
+
readonly reason: 'ncbi_invalid_response';
|
|
41
45
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.SerializationError;
|
|
42
|
-
readonly when:
|
|
43
|
-
readonly recovery:
|
|
46
|
+
readonly when: 'NCBI returned a body that could not be parsed (invalid XML/JSON).';
|
|
47
|
+
readonly recovery: 'Retry the request; NCBI returned a malformed response that could not be parsed.';
|
|
44
48
|
readonly retryable: true;
|
|
45
49
|
}, {
|
|
46
|
-
readonly reason:
|
|
50
|
+
readonly reason: 'ncbi_resource_not_found';
|
|
47
51
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
48
|
-
readonly when:
|
|
49
|
-
readonly recovery:
|
|
52
|
+
readonly when: 'NCBI returned a structured "not found" error for the requested ID(s).';
|
|
53
|
+
readonly recovery: 'Verify the ID exists in PubMed; the resource was not found in NCBI and retrying will not help.';
|
|
50
54
|
readonly retryable: false;
|
|
51
55
|
}], {
|
|
52
56
|
readonly totalCount: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-mesh.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-mesh.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lookup-mesh.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-mesh.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AA6GjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwLzB,CAAC"}
|