clinicaltrialsgov-mcp-server 2.9.2 → 2.9.4
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/README.md +7 -4
- package/dist/mcp-server/tools/definitions/get-field-definitions.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/get-study-results.tool.d.ts +15 -0
- package/dist/mcp-server/tools/definitions/get-study-results.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-study-results.tool.js +436 -152
- package/dist/mcp-server/tools/definitions/get-study-results.tool.js.map +1 -1
- package/dist/services/clinical-trials/clinical-trials-service.d.ts +9 -1
- package/dist/services/clinical-trials/clinical-trials-service.d.ts.map +1 -1
- package/dist/services/clinical-trials/clinical-trials-service.js +18 -4
- package/dist/services/clinical-trials/clinical-trials-service.js.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](https://www.npmjs.com/package/clinicaltrialsgov-mcp-server) [](https://github.com/users/cyanheads/packages/container/package/clinicaltrialsgov-mcp-server) [](https://www.npmjs.com/package/clinicaltrialsgov-mcp-server) [](https://github.com/users/cyanheads/packages/container/package/clinicaltrialsgov-mcp-server) [](./CHANGELOG.md) [](https://modelcontextprotocol.io/) [](./LICENSE) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -38,7 +38,7 @@ Seven tools for searching, discovering, analyzing, and matching clinical trials:
|
|
|
38
38
|
| `clinicaltrials_get_study_count` | Get total study count for a query without fetching data. Fast statistics and breakdowns. |
|
|
39
39
|
| `clinicaltrials_get_field_values` | Discover valid values for API fields (status, phase, study type, etc.) with per-value counts. |
|
|
40
40
|
| `clinicaltrials_get_field_definitions` | Browse the study data model field tree — piece names, types, nesting. Supports subtree navigation and keyword search. |
|
|
41
|
-
| `clinicaltrials_get_study_results` | Extract outcomes, adverse events, participant flow, and baseline from completed studies.
|
|
41
|
+
| `clinicaltrials_get_study_results` | Extract outcomes, adverse events, participant flow, and baseline from completed studies. A results-rich record can exceed 500KB per study in full mode; summary mode typically cuts that to a few KB, and `outcomeLimit` / `adverseEventLimit` cap full mode without leaving it. `outcomeOffset` / `seriousEventOffset` / `otherEventOffset` resume a capped list, with the next offset reported per study. |
|
|
42
42
|
| `clinicaltrials_find_eligible` | Match patient demographics and conditions to eligible recruiting trials. Provide age, sex, conditions, and location to find studies with matching eligibility criteria, contacts, and recruiting locations. |
|
|
43
43
|
|
|
44
44
|
| Resource | Description |
|
|
@@ -70,8 +70,11 @@ Fetch posted results data for completed studies.
|
|
|
70
70
|
|
|
71
71
|
- Outcome measures with statistics, adverse events, participant flow, baseline characteristics
|
|
72
72
|
- Section-level filtering (request only the data you need)
|
|
73
|
-
- Optional summary mode condenses full results
|
|
74
|
-
-
|
|
73
|
+
- Optional summary mode condenses full results — which can exceed 500KB per study — to per-measure metadata, denominators, and a labelled top-line projection, typically a few KB per study
|
|
74
|
+
- `outcomeLimit` and `adverseEventLimit` cap the two lists that carry the bulk without leaving full mode, capping serious and other adverse events separately
|
|
75
|
+
- `outcomeOffset`, `seriousEventOffset`, and `otherEventOffset` resume a capped list from where the last page stopped — each study reports the next offset for every list left short, and the group rosters ride every page
|
|
76
|
+
- Batch multiple NCT IDs per call with partial-success reporting; repeated IDs collapse to one entry
|
|
77
|
+
- Previous (alias) NCT IDs resolve to their canonical study, named alongside the ID you requested
|
|
75
78
|
- Separate tracking of studies without results and fetch errors
|
|
76
79
|
|
|
77
80
|
---
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
7
7
|
import { JsonRpcErrorCode, validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
-
import { RECOVERY_HINTS } from '
|
|
8
|
+
import { RECOVERY_HINTS } from '../utils/recovery-hints.js';
|
|
9
9
|
import { getClinicalTrialsService } from '../../../services/clinical-trials/clinical-trials-service.js';
|
|
10
10
|
/** Build a result object, omitting undefined optional fields (exactOptionalPropertyTypes). */
|
|
11
11
|
function toFieldResult(node, path) {
|
|
@@ -22,9 +22,13 @@ export declare const getStudyResults: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
22
22
|
summary: z.ZodDefault<z.ZodBoolean>;
|
|
23
23
|
outcomeLimit: z.ZodOptional<z.ZodNumber>;
|
|
24
24
|
adverseEventLimit: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
outcomeOffset: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
seriousEventOffset: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
otherEventOffset: z.ZodOptional<z.ZodNumber>;
|
|
25
28
|
}, z.core.$strip>, z.ZodObject<{
|
|
26
29
|
results: z.ZodArray<z.ZodObject<{
|
|
27
30
|
nctId: z.ZodString;
|
|
31
|
+
canonicalNctId: z.ZodOptional<z.ZodString>;
|
|
28
32
|
title: z.ZodString;
|
|
29
33
|
hasResults: z.ZodBoolean;
|
|
30
34
|
outcomes: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -35,9 +39,15 @@ export declare const getStudyResults: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
35
39
|
filtersApplied: z.ZodOptional<z.ZodObject<{
|
|
36
40
|
totalOutcomes: z.ZodOptional<z.ZodNumber>;
|
|
37
41
|
outcomeLimit: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
outcomeOffset: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
nextOutcomeOffset: z.ZodOptional<z.ZodNumber>;
|
|
38
44
|
totalSeriousEvents: z.ZodOptional<z.ZodNumber>;
|
|
39
45
|
totalOtherEvents: z.ZodOptional<z.ZodNumber>;
|
|
40
46
|
adverseEventLimit: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
seriousEventOffset: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
nextSeriousEventOffset: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
otherEventOffset: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
nextOtherEventOffset: z.ZodOptional<z.ZodNumber>;
|
|
41
51
|
}, z.core.$strip>>;
|
|
42
52
|
}, z.core.$strip>>;
|
|
43
53
|
studiesWithoutResults: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -51,6 +61,11 @@ export declare const getStudyResults: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
51
61
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
52
62
|
readonly when: "A parameter was supplied with a blank, whitespace-only, or empty-list value.";
|
|
53
63
|
readonly recovery: "Supply a value containing non-whitespace, or for a list parameter at least one non-blank entry. Only when the parameter is optional and you meant to leave it unset, omit it entirely instead — omission and a blank value mean different things here.";
|
|
64
|
+
}, {
|
|
65
|
+
readonly reason: "offset_not_applicable";
|
|
66
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
67
|
+
readonly when: "An offset was supplied for a list this call does not return — summary mode returns a condensed projection rather than a bounded window, or the sections filter excludes the offset’s own section.";
|
|
68
|
+
readonly recovery: "Drop the offset, or re-run with summary: false and the offset’s own section named in sections — outcomes for outcomeOffset, adverseEvents for seriousEventOffset and otherEventOffset.";
|
|
54
69
|
}, {
|
|
55
70
|
readonly reason: "rate_limited";
|
|
56
71
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-study-results.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-study-results.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-study-results.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-study-results.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AA47B3E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsf1B,CAAC"}
|