clinicaltrialsgov-mcp-server 2.9.8 → 2.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/AGENTS.md +5 -5
  2. package/CLAUDE.md +5 -5
  3. package/README.md +6 -6
  4. package/changelog/2.9.x/2.9.10.md +16 -0
  5. package/changelog/2.9.x/2.9.8.md +2 -2
  6. package/changelog/2.9.x/2.9.9.md +25 -0
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp-server/resources/definitions/study.resource.d.ts +3 -1
  10. package/dist/mcp-server/resources/definitions/study.resource.d.ts.map +1 -1
  11. package/dist/mcp-server/resources/definitions/study.resource.js +2 -0
  12. package/dist/mcp-server/resources/definitions/study.resource.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/find-eligible.tool.d.ts +1 -0
  14. package/dist/mcp-server/tools/definitions/find-eligible.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/find-eligible.tool.js +83 -26
  16. package/dist/mcp-server/tools/definitions/find-eligible.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/get-field-definitions.tool.d.ts +1 -0
  18. package/dist/mcp-server/tools/definitions/get-field-definitions.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/get-field-definitions.tool.js +1 -0
  20. package/dist/mcp-server/tools/definitions/get-field-definitions.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/get-field-values.tool.d.ts +2 -0
  22. package/dist/mcp-server/tools/definitions/get-field-values.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/get-field-values.tool.js +2 -0
  24. package/dist/mcp-server/tools/definitions/get-field-values.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/get-study-count.tool.d.ts +4 -0
  26. package/dist/mcp-server/tools/definitions/get-study-count.tool.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/definitions/get-study-count.tool.js +12 -4
  28. package/dist/mcp-server/tools/definitions/get-study-count.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/get-study-results.tool.d.ts +1 -1
  30. package/dist/mcp-server/tools/definitions/get-study-results.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/get-study-results.tool.js +63 -30
  32. package/dist/mcp-server/tools/definitions/get-study-results.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/definitions/get-study.tool.d.ts +3 -1
  34. package/dist/mcp-server/tools/definitions/get-study.tool.d.ts.map +1 -1
  35. package/dist/mcp-server/tools/definitions/get-study.tool.js +2 -0
  36. package/dist/mcp-server/tools/definitions/get-study.tool.js.map +1 -1
  37. package/dist/mcp-server/tools/definitions/search-studies.tool.d.ts +7 -1
  38. package/dist/mcp-server/tools/definitions/search-studies.tool.d.ts.map +1 -1
  39. package/dist/mcp-server/tools/definitions/search-studies.tool.js +42 -12
  40. package/dist/mcp-server/tools/definitions/search-studies.tool.js.map +1 -1
  41. package/dist/mcp-server/tools/utils/_schemas.d.ts +9 -2
  42. package/dist/mcp-server/tools/utils/_schemas.d.ts.map +1 -1
  43. package/dist/mcp-server/tools/utils/_schemas.js +9 -2
  44. package/dist/mcp-server/tools/utils/_schemas.js.map +1 -1
  45. package/dist/mcp-server/tools/utils/query-helpers.d.ts +21 -1
  46. package/dist/mcp-server/tools/utils/query-helpers.d.ts.map +1 -1
  47. package/dist/mcp-server/tools/utils/query-helpers.js +29 -1
  48. package/dist/mcp-server/tools/utils/query-helpers.js.map +1 -1
  49. package/package.json +5 -5
  50. package/server.json +3 -3
package/AGENTS.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** clinicaltrialsgov-mcp-server
4
- **Version:** 2.9.8
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.4`
4
+ **Version:** 2.9.10
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
8
- **Zod:** ^4.6.1
8
+ **Zod:** ^4.6.5
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.
11
11
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## Overview
15
15
 
16
- MCP server wrapping the [ClinicalTrials.gov REST API v2](https://clinicaltrials.gov/data-api/api) — the US National Library of Medicine's registry of ~577K clinical trial studies. Public, read-only, no auth required.
16
+ MCP server wrapping the [ClinicalTrials.gov REST API v2](https://clinicaltrials.gov/data-api/api) — the US National Library of Medicine's registry of 600K+ clinical trial studies. Public, read-only, no auth required.
17
17
 
18
18
  **Design doc:** `docs/design.md` — full MCP surface design, tool schemas, service plan, implementation checklist.
19
19
  **API reference:** `docs/api-reference.md` — complete ClinicalTrials.gov v2 endpoint reference.
@@ -228,7 +228,7 @@ Note: `ctx.state` is available but unused — this is a stateless read-only serv
228
228
 
229
229
  Handlers throw — the framework catches, classifies, and formats.
230
230
 
231
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required descriptive metadata (≥ 5 words, lint-validated); for the wire payload's `data.recovery.hint` (which the framework mirrors into `content[]` text), spread `ctx.recoveryFor('reason')` for the contract default, or pass `{ recovery: { hint: '...' } }` explicitly when dynamic context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
231
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required descriptive metadata (≥ 5 words, lint-validated); for the wire payload's `data.recovery.hint` (which the framework mirrors into `content[]` text unless the message already contains it verbatim), spread `ctx.recoveryFor('reason')` for the contract default, or pass `{ recovery: { hint: '...' } }` explicitly when dynamic context matters. Forwarding it is lint-enforced per throw site (`error-contract-recovery-unforwarded`). Most reasons here are raised in `ClinicalTrialsService` (a factory error carrying `data.reason` and a recovery hint), not by the handler — mark those entries `thrownBy: 'service'` so `error-contract-unthrown`, which reads only the handler body, skips them; it is lint-only metadata. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
232
232
 
233
233
  ```ts
234
234
  import { JsonRpcErrorCode } from "@cyanheads/mcp-ts-core/errors";
package/CLAUDE.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** clinicaltrialsgov-mcp-server
4
- **Version:** 2.9.8
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.4`
4
+ **Version:** 2.9.10
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
8
- **Zod:** ^4.6.1
8
+ **Zod:** ^4.6.5
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.
11
11
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## Overview
15
15
 
16
- MCP server wrapping the [ClinicalTrials.gov REST API v2](https://clinicaltrials.gov/data-api/api) — the US National Library of Medicine's registry of ~577K clinical trial studies. Public, read-only, no auth required.
16
+ MCP server wrapping the [ClinicalTrials.gov REST API v2](https://clinicaltrials.gov/data-api/api) — the US National Library of Medicine's registry of 600K+ clinical trial studies. Public, read-only, no auth required.
17
17
 
18
18
  **Design doc:** `docs/design.md` — full MCP surface design, tool schemas, service plan, implementation checklist.
19
19
  **API reference:** `docs/api-reference.md` — complete ClinicalTrials.gov v2 endpoint reference.
@@ -228,7 +228,7 @@ Note: `ctx.state` is available but unused — this is a stateless read-only serv
228
228
 
229
229
  Handlers throw — the framework catches, classifies, and formats.
230
230
 
231
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required descriptive metadata (≥ 5 words, lint-validated); for the wire payload's `data.recovery.hint` (which the framework mirrors into `content[]` text), spread `ctx.recoveryFor('reason')` for the contract default, or pass `{ recovery: { hint: '...' } }` explicitly when dynamic context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
231
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required descriptive metadata (≥ 5 words, lint-validated); for the wire payload's `data.recovery.hint` (which the framework mirrors into `content[]` text unless the message already contains it verbatim), spread `ctx.recoveryFor('reason')` for the contract default, or pass `{ recovery: { hint: '...' } }` explicitly when dynamic context matters. Forwarding it is lint-enforced per throw site (`error-contract-recovery-unforwarded`). Most reasons here are raised in `ClinicalTrialsService` (a factory error carrying `data.reason` and a recovery hint), not by the handler — mark those entries `thrownBy: 'service'` so `error-contract-unthrown`, which reads only the handler body, skips them; it is lint-only metadata. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
232
232
 
233
233
  ```ts
234
234
  import { JsonRpcErrorCode } from "@cyanheads/mcp-ts-core/errors";
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-2.9.8-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/clinicaltrialsgov-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/clinicaltrialsgov-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/clinicaltrialsgov-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-2.9.10-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/clinicaltrialsgov-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/clinicaltrialsgov-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/clinicaltrialsgov-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -29,7 +29,7 @@
29
29
 
30
30
  ## Overview
31
31
 
32
- Clinical trial data from the [ClinicalTrials.gov REST API v2](https://clinicaltrials.gov/data-api/api) — the US National Library of Medicine's registry of ~577K clinical trial studies. Search trials, fetch full study records and posted results, discover field names and valid values, and match patient demographics to eligible recruiting trials. Public, read-only, no authentication required. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
32
+ Clinical trial data from the [ClinicalTrials.gov REST API v2](https://clinicaltrials.gov/data-api/api) — the US National Library of Medicine's registry of 600K+ clinical trial studies. Search trials, fetch full study records and posted results, discover field names and valid values, and match patient demographics to eligible recruiting trials. Public, read-only, no authentication required. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
33
33
 
34
34
  ### Tools
35
35
 
@@ -59,9 +59,9 @@ Clinical trial data from the [ClinicalTrials.gov REST API v2](https://clinicaltr
59
59
 
60
60
  ### `clinicaltrials_search_studies` <sub>tool</sub>
61
61
 
62
- - Free-text `query` plus field-specific `conditionQuery` / `interventionQuery` / `locationQuery` / `sponsorQuery` / `titleQuery` / `outcomeQuery`; `statusFilter` / `phaseFilter` enums, `advancedFilter` (`AREA[FieldName]value` / `RANGE[min, max]` syntax), and `geoFilter` (`distance(lat,lon,radius)` with a `mi`/`km` suffix) for proximity search with nearest-site re-ranking
63
- - Returns a compact per-study index by default (`nctId`, `briefTitle`, `overallStatus`, `phases`, `enrollmentCount`, `leadSponsor`, `conditions`, a bounded locations summary); pass `fields` (PascalCase leaves) for a full-fidelity projection — full records run ~70KB
64
- - `pageSize` 1–`CT_MAX_PAGE_SIZE` (default 200), cursor pagination via `pageToken`, `sort` on up to 2 fields
62
+ - Free-text `query` plus field-specific `conditionQuery` / `interventionQuery` / `locationQuery` / `sponsorQuery` / `titleQuery` / `outcomeQuery`; `statusFilter` (case- and separator-insensitive, registry display labels included: `"Active, not recruiting"` works) / `phaseFilter` enums, `advancedFilter` (`AREA[FieldName]value` / `RANGE[min, max]` syntax), and `geoFilter` (`distance(lat,lon,radius)` with a `mi`/`km` suffix) for proximity search with nearest-site re-ranking
63
+ - Returns a compact per-study index by default (`nctId`, `briefTitle`, `overallStatus`, `phases`, `enrollmentCount`, `leadSponsor`, `conditions`, `hasResults`, `startDate`, `primaryCompletionDate`, a bounded locations summary); pass `fields` (PascalCase leaves) for a full-fidelity projection — full records run ~70KB
64
+ - `pageSize` 1–`CT_MAX_PAGE_SIZE` (default 10; the cap is 200 unless overridden), cursor pagination via `pageToken`, `sort` on up to 2 fields
65
65
  - Excludes the upstream "unknown" enrollment sentinel (`99999999`) by default — `includeUnknownEnrollment` to include it, or automatically lifted when `nctIds` is supplied
66
66
  - Typed errors: `blank_value`, `ids_not_found`, `field_invalid`, `enum_invalid`, `query_parse_error`, `geo_invalid`, `sort_invalid`, `rate_limited`
67
67
 
@@ -115,7 +115,7 @@ Clinical trial data from the [ClinicalTrials.gov REST API v2](https://clinicaltr
115
115
 
116
116
  - Takes `age`, `sex` (`FEMALE` / `MALE` / `ALL`), `conditions[]`, `location` (`country` required, `state` / `city` optional), `healthyVolunteer`, `recruitingOnly` (default true), `maxResults` (≤50)
117
117
  - Re-ranks results so studies whose own condition list names a requested condition surface above tangential MeSH-umbrella matches from the upstream fuzzy search
118
- - Bounds each candidate's locations to the sites matching the requested location (capped by `locationLimit`, ≤500) instead of every registered site, adding the nearest recruiting site when none of the matched ones is open
118
+ - Bounds each candidate's locations to the sites matching the requested location (capped by `locationLimit`, ≤500) instead of every registered site, adding one recruiting site when none of the matched ones is open — the one nearest the matched sites by published coordinates (with `distanceMi`), kept to the requested country when a site there recruits, or the first in match order when coordinates are missing
119
119
  - `funnel` reports match counts at each filter stage (condition → +location → +demographics) to show where the query narrowed to zero
120
120
  - Typed errors: `blank_value`, `rate_limited`
121
121
 
@@ -0,0 +1,16 @@
1
+ ---
2
+ summary: "get_study_results' adverse-event summary reports each event group separately instead of pooling them, and find_eligible admits its fallback recruiting site by distance instead of upstream list order."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 2.9.10 — 2026-09-22
8
+
9
+ ## Changed
10
+
11
+ - **`get_study_results` summary-mode adverse events report per-group counts, not pooled ones** ([#137](https://github.com/cyanheads/clinicaltrialsgov-mcp-server/issues/137)) — `topEvents` rows now carry `byGroup: [{ groupId, numAffected, numAtRisk }]` in place of the pooled `numAffected`/`numAtRisk` pair, keyed against a new `eventGroups: [{ id, title }]` roster on the summary. `format()` prints the roster once under `Event Groups:` and one `groupId: affected/atRisk` cell per group on each event. Event groups can overlap (crossover and second-course arms re-count participants of their parent arm), so a summed figure was never a real participant count. Ranking uses the largest single group's `numAffected` instead of the cross-group sum.
12
+ - **`find_eligible`'s fallback recruiting site is chosen by distance, not upstream list order** ([#138](https://github.com/cyanheads/clinicaltrialsgov-mcp-server/issues/138)) — the tool now requests `LocationGeoPoint`. When none of a candidate's matched-tier sites is recruiting, the admitted site is the `RECRUITING` site with the smallest haversine distance to the nearest site of the full matched tier (before the `locationLimit` cap), chosen within the requested country whenever a site there recruits; ties keep match order. It carries `distanceMi`, rendered on its `Locations` entry as "N mi from the nearest matched site". When the matched tier or every candidate lacks coordinates, the first candidate in match order is admitted with no `distanceMi`, and the Sites line says it was picked by match order instead of calling it the nearest. Coordinates are dropped from the returned sites. The tool description and the `locationLimit` and `studies` descriptions state the same rule.
13
+
14
+ ## Fixed
15
+
16
+ - **`get_study_results` renders a one-group count as "1 group"** — outcome measure lines and the summary-mode adverse-event, participant-flow, and baseline count lines printed "1 groups".
@@ -1,5 +1,5 @@
1
1
  ---
2
- summary: "HTTP declares stateless session mode by default (mcp-ts-core 0.13.4) — source, bunx, and npm start now match the Docker image and issue no Mcp-Session-Id unless MCP_SESSION_MODE overrides it."
2
+ summary: "HTTP declares stateless session mode by default (createApp option from mcp-ts-core 0.13.1) — source, bunx, and npm start now match the Docker image and issue no Mcp-Session-Id unless MCP_SESSION_MODE overrides it."
3
3
  breaking: false
4
4
  security: false
5
5
  ---
@@ -13,7 +13,7 @@ security: false
13
13
  ## Changed
14
14
 
15
15
  - **Argument rejections carry a recovery hint** (mcp-ts-core 0.13.3) — the error text now ends with a `Recovery: …` line and `data.reason` is `"invalid_arguments"`; a missing required field reads as missing.
16
- - **Undeclared root keys are dropped instead of rejected** (mcp-ts-core 0.13.4) — a client-added key at the input root no longer fails the call. Same release adds case-style key aliasing and repair of a JSON-stringified array input.
16
+ - **Tool arguments are repaired before validation** (mcp-ts-core 0.13.4) — client-injected root keys (`_meta`, `tool_call_description`, `toolCallId`) are dropped, a case-style variant of a declared key (`nct_id` → `nctId`) is rewritten, and a JSON-stringified array input is re-parsed. Any other undeclared key is still rejected, and the error names the accepted keys.
17
17
  - **Upstream error URLs no longer echoed** (mcp-ts-core 0.13.4) — a ClinicalTrials.gov HTTP error no longer carries the request URL in `error.data.url`.
18
18
  - Framework skills, devcheck/build/lint scripts, and the CodeQL workflow template synced from mcp-ts-core 0.13.4; `package.json`'s npm `files` allowlist now also ships `changelog/`, `README.md`, `LICENSE`, `CLAUDE.md`, `AGENTS.md`, `Dockerfile`, and `server.json`; `.codex-plugin/plugin.json` gains a `Research` category.
19
19
 
@@ -0,0 +1,25 @@
1
+ ---
2
+ summary: "search_studies' default index gains hasResults and key dates, and statusFilter/NCT ID inputs now accept case and spacing variants instead of being rejected."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 2.9.9 — 2026-09-22
8
+
9
+ ## Added
10
+
11
+ - **`search_studies` compact index gains `hasResults`, `startDate`, `primaryCompletionDate`** ([#139](https://github.com/cyanheads/clinicaltrialsgov-mcp-server/issues/139)) — the default per-study projection and `format()` meta line now carry these three fields when the study publishes them; explicit `fields` projections are unchanged. `advancedFilter` gains a documented `AREA[HasResults]true` example.
12
+
13
+ ## Changed
14
+
15
+ - **`statusFilter` accepts case and spacing variants** ([#140](https://github.com/cyanheads/clinicaltrialsgov-mcp-server/issues/140)) — upstream matches `filter.overallStatus` case-sensitively; `search_studies` and `get_study_count` now normalize each entry (trim, uppercase, collapse whitespace/hyphen/underscore runs) before the request, including the registry display labels `"Active, not recruiting"` and `"Unknown status"`. A value that still names no status still reaches upstream and fails as `enum_invalid`.
16
+ - **NCT IDs accept case and whitespace variants** ([#140](https://github.com/cyanheads/clinicaltrialsgov-mcp-server/issues/140)) — the shared `nctIdSchema` trims and uppercases before the format check, so `nct03722472` resolves the same as `NCT03722472` across every tool and the `clinicaltrials://{nctId}` resource; the advertised JSON Schema `pattern` is unchanged.
17
+ - **Server instructions** now say the default search index carries `hasResults`; the registry size reads 600K+ (was ~577K) there and in the README, docs, and Codex plugin description.
18
+ - Framework skills and `scripts/lint-mcp.ts` synced from mcp-ts-core 0.13.6 (`lint-mcp.ts` reads a `lint` block from `devcheck.config.json`); error-contract entries the service raises are marked `thrownBy: 'service'`.
19
+
20
+ ## Dependencies
21
+
22
+ - `@cyanheads/mcp-ts-core` `^0.13.4` → `^0.13.6`
23
+ - `@biomejs/biome` (dev) `^2.5.13` → `^2.5.14`
24
+ - `fast-check` (dev) `^4.10.0` → `^4.10.2`
25
+ - `@types/node` (dev) `26.5.1` → `26.6.2`
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ await createApp({
15
15
  resources: allResourceDefinitions,
16
16
  prompts: allPromptDefinitions,
17
17
  sessionMode: 'stateless',
18
- instructions: `Use the clinicaltrials_* tools to access the ClinicalTrials.gov registry — public, read-only, ~577K studies. Studies are addressed by NCT ID (NCT followed by 8 digits). Field names for the fields, advancedFilter, and sort parameters are PascalCase leaves (NCTId, OverallStatus, EnrollmentCount) — call clinicaltrials_get_field_definitions to discover them and clinicaltrials_get_field_values for valid enum values. Typical workflow: clinicaltrials_search_studies (pass fields to trim ~70KB records) → clinicaltrials_get_study_record → clinicaltrials_get_study_results (only when hasResults=true). Use clinicaltrials_get_study_count for cheap breakdowns and clinicaltrials_find_eligible for patient matching.`,
18
+ instructions: `Use the clinicaltrials_* tools to access the ClinicalTrials.gov registry — public, read-only, 600K+ studies. Studies are addressed by NCT ID (NCT followed by 8 digits). Field names for the fields, advancedFilter, and sort parameters are PascalCase leaves (NCTId, OverallStatus, EnrollmentCount) — call clinicaltrials_get_field_definitions to discover them and clinicaltrials_get_field_values for valid enum values. Typical workflow: clinicaltrials_search_studies (compact per-study index by default, including hasResults; pass fields for specific leaves) → clinicaltrials_get_study_record → clinicaltrials_get_study_results (only when hasResults=true). Use clinicaltrials_get_study_count for cheap breakdowns and clinicaltrials_find_eligible for patient matching.`,
19
19
  landing: {
20
20
  requireAuth: false,
21
21
  },
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAElG,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,8BAA8B;IACrC,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,sBAAsB;IACjC,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,WAAW;IACxB,YAAY,EAAE,qsBAAqsB;IACntB,OAAO,EAAE;QACP,WAAW,EAAE,KAAK;KACnB;IACD,KAAK;QACH,yBAAyB,EAAE,CAAC;IAC9B,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAElG,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,8BAA8B;IACrC,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,sBAAsB;IACjC,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,WAAW;IACxB,YAAY,EAAE,6vBAA6vB;IAC3wB,OAAO,EAAE;QACP,WAAW,EAAE,KAAK;KACnB;IACD,KAAK;QACH,yBAAyB,EAAE,CAAC;IAC9B,CAAC;CACF,CAAC,CAAC"}
@@ -7,7 +7,7 @@
7
7
  import { z } from '@cyanheads/mcp-ts-core';
8
8
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
9
  export declare const studyResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
10
- nctId: z.ZodString;
10
+ nctId: z.ZodPreprocess<z.ZodString, unknown>;
11
11
  }, z.core.$strip>, z.ZodObject<{
12
12
  nctId: z.ZodString;
13
13
  study: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -38,11 +38,13 @@ export declare const studyResource: import("@cyanheads/mcp-ts-core").ResourceDef
38
38
  readonly code: JsonRpcErrorCode.NotFound;
39
39
  readonly when: "The provided NCT ID does not match any study at ClinicalTrials.gov.";
40
40
  readonly recovery: "Verify the NCT ID at clinicaltrials.gov or call clinicaltrials_search_studies to discover a valid identifier.";
41
+ readonly thrownBy: "service";
41
42
  }, {
42
43
  readonly reason: "rate_limited";
43
44
  readonly code: JsonRpcErrorCode.RateLimited;
44
45
  readonly when: "ClinicalTrials.gov returned 429 after retry budget exhausted.";
45
46
  readonly recovery: "ClinicalTrials.gov rate-limited the request after several retries; wait about a minute before trying again.";
46
47
  readonly retryable: true;
48
+ readonly thrownBy: "service";
47
49
  }]>;
48
50
  //# sourceMappingURL=study.resource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"study.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/study.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAgBjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsJxB,CAAC"}
1
+ {"version":3,"file":"study.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/study.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAgBjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwJxB,CAAC"}
@@ -28,6 +28,7 @@ export const studyResource = resource('clinicaltrials://{nctId}', {
28
28
  code: JsonRpcErrorCode.NotFound,
29
29
  when: 'The provided NCT ID does not match any study at ClinicalTrials.gov.',
30
30
  recovery: RECOVERY_HINTS.study_not_found,
31
+ thrownBy: 'service',
31
32
  },
32
33
  {
33
34
  reason: 'rate_limited',
@@ -35,6 +36,7 @@ export const studyResource = resource('clinicaltrials://{nctId}', {
35
36
  when: 'ClinicalTrials.gov returned 429 after retry budget exhausted.',
36
37
  recovery: RECOVERY_HINTS.rate_limited,
37
38
  retryable: true,
39
+ thrownBy: 'service',
38
40
  },
39
41
  ],
40
42
  params: z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"study.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/study.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uDAAuD,CAAC;AAEjG,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEpF;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,0BAA0B,EAAE;IAChE,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,0KAA0K,UAAU,oOAAoO;IACra,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE;QACN;YACE,MAAM,EAAE,iBAAiB;YACzB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,qEAAqE;YAC3E,QAAQ,EAAE,cAAc,CAAC,eAAe;SACzC;QACD;YACE,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,IAAI,EAAE,+DAA+D;YACrE,QAAQ,EAAE,cAAc,CAAC,YAAY;YACrC,SAAS,EAAE,IAAI;SAChB;KACF;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACnE,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;QAC/D,K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B,CAAC,CAAC;QAEH,yEAAyE;QACzE,yEAAyE;QACzE,4DAA4D;QAC5D,MAAM,cAAc,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC;QACpD,MAAM,QAAQ,GAA4B,EAAE,GAAG,KAAK,EAAE,CAAC;QACvD,OAAO,QAAQ,CAAC,cAAc,CAAC;QAE/B,MAAM,SAAS,GAAG,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAElE,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,QAAQ;YACf,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,cAAc,EAAE,IAAI;YACpB,SAAS;YACT,GAAG,CAAC,SAAS;gBACX,CAAC,CAAC;oBACE,SAAS,EAAE;wBACT,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,eAAe,EAAE,iCAAiC;wBAClD,gBAAgB,EAAE,kCAAkC;qBACrD;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"study.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/study.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uDAAuD,CAAC;AAEjG,OAAO,EAAE,WAAW,E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AAC;QAE/B,MAAM,SAAS,GAAG,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAElE,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,QAAQ;YACf,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,cAAc,EAAE,IAAI;YACpB,SAAS;YACT,GAAG,CAAC,SAAS;gBACX,CAAC,CAAC;oBACE,SAAS,EAAE;wBACT,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,eAAe,EAAE,iCAAiC;wBAClD,gBAAgB,EAAE,kCAAkC;qBACrD;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -60,6 +60,7 @@ export declare const findEligible: import("@cyanheads/mcp-ts-core").ToolDefiniti
60
60
  readonly when: "ClinicalTrials.gov returned 429 after retry budget exhausted.";
61
61
  readonly recovery: "ClinicalTrials.gov rate-limited the request after several retries; wait about a minute before trying again.";
62
62
  readonly retryable: true;
63
+ readonly thrownBy: "service";
63
64
  }], {
64
65
  readonly searchCriteria: z.ZodObject<{
65
66
  conditions: z.ZodArray<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"find-eligible.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-eligible.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAqJjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAiC1F;AA2CD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAihBvB,CAAC"}
1
+ {"version":3,"file":"find-eligible.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-eligible.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAyMjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAiC1F;AA4CD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgiBvB,CAAC"}
@@ -6,21 +6,25 @@ import { tool, z } from '@cyanheads/mcp-ts-core';
6
6
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
7
  import { getClinicalTrialsService } from '../../../services/clinical-trials/clinical-trials-service.js';
8
8
  import { formatRemainingStudyFields } from '../utils/format-helpers.js';
9
+ import { haversineMi } from '../utils/geo-helpers.js';
9
10
  import { blankValueMessage, firstBlankListParam, firstBlankParam, quoteQueryTerm, } from '../utils/query-helpers.js';
10
11
  import { RECOVERY_HINTS } from '../utils/recovery-hints.js';
12
+ /** Case-insensitive equality of two place names, false when either is absent. */
13
+ function samePlace(a, b) {
14
+ return a !== undefined && b !== undefined && a.toLowerCase() === b.toLowerCase();
15
+ }
11
16
  /**
12
17
  * How closely a site's geography matches the user's stated location. City
13
18
  * equality dominates, then state, then country, so the score doubles as a match
14
19
  * tier: every site sharing the study's best score matched at the same level.
15
20
  */
16
21
  function locationGeoScore(loc, user) {
17
- const eq = (a, b) => a !== undefined && b !== undefined && a.toLowerCase() === b.toLowerCase();
18
22
  let score = 0;
19
- if (eq(loc.city, user.city))
23
+ if (samePlace(loc.city, user.city))
20
24
  score += 4;
21
- if (eq(loc.state, user.state))
25
+ if (samePlace(loc.state, user.state))
22
26
  score += 2;
23
- if (eq(loc.country, user.country))
27
+ if (samePlace(loc.country, user.country))
24
28
  score += 1;
25
29
  return score;
26
30
  }
@@ -43,6 +47,36 @@ function isRecruiting(loc) {
43
47
  function locationMatchScore(loc, user) {
44
48
  return locationGeoScore(loc, user) + (isRecruiting(loc) ? 0.5 : 0);
45
49
  }
50
+ function hasGeoPoint(loc) {
51
+ return loc.geoPoint != null;
52
+ }
53
+ /**
54
+ * Pick the one recruiting site to admit when a candidate's matched tier holds
55
+ * none (#114), from the recruiting candidates the caller narrowed down.
56
+ *
57
+ * The nearest by great-circle distance to the closest site of the whole matched
58
+ * tier — measured before the locationLimit cap, since the cap bounds payload,
59
+ * not which sites the patient is near. Ties keep match order. Candidates that
60
+ * publish no coordinates cannot be measured and sit out, as in the other
61
+ * geo-aware tools. With no coordinates on the matched tier or on any candidate,
62
+ * the first candidate in match order is admitted and carries no distanceMi, so
63
+ * nothing downstream presents it as the nearest.
64
+ */
65
+ function admitRecruitingSite(candidates, matched) {
66
+ const origins = matched.filter(hasGeoPoint);
67
+ let nearest;
68
+ if (origins.length > 0) {
69
+ for (const loc of candidates.filter(hasGeoPoint)) {
70
+ const distanceMi = Math.min(...origins.map((o) => haversineMi(o.geoPoint, loc.geoPoint)));
71
+ if (!nearest || distanceMi < nearest.distanceMi)
72
+ nearest = { distanceMi, loc };
73
+ }
74
+ }
75
+ if (!nearest)
76
+ return candidates[0];
77
+ // One decimal, as rendered — both channels then carry the identical value.
78
+ return { ...nearest.loc, distanceMi: Math.round(nearest.distanceMi * 10) / 10 };
79
+ }
46
80
  /**
47
81
  * Bound a candidate's site list to the sites that answer the caller's question.
48
82
  *
@@ -54,11 +88,12 @@ function locationMatchScore(loc, user) {
54
88
  *
55
89
  * Geography alone decides the tier, so a tier can hold nothing but closed sites
56
90
  * while the study's one open site sits further out — a patient-matching answer
57
- * whose every shown site can enroll no one (#114). When that happens, admit the
58
- * nearest recruiting site alongside the tier. Admitting one site keeps the
59
- * local answer local; widening to that site's whole tier would trade a
60
- * city-precise answer for a statewide dump and reinflate the payload this bound
61
- * exists to hold down.
91
+ * whose every shown site can enroll no one (#114). When that happens, admit one
92
+ * recruiting site alongside the tier, the nearest one by distance when the sites
93
+ * publish coordinates (#138), in the requested country when one recruits there.
94
+ * Admitting one site keeps the local answer local;
95
+ * widening to that site's whole tier would trade a city-precise answer for a
96
+ * statewide dump and reinflate the payload this bound exists to hold down.
62
97
  *
63
98
  * The summary is returned only when the returned set is genuinely smaller than
64
99
  * the upstream one — reporting a bound that dropped nothing would imply a filter
@@ -74,13 +109,20 @@ function boundLocations(sortedLocations, user, limit) {
74
109
  // would answer with a candidate that appears to have nowhere to enroll.
75
110
  const matched = sortedLocations.filter((loc) => locationGeoScore(loc, user) === best);
76
111
  const capped = matched.slice(0, limit);
77
- // sortedLocations runs best-match first, so the first recruiting site below
78
- // the tier is the nearest one. Nothing is found when best === 0 (no site
79
- // scores below it) or when the study registers no recruiting site at all —
80
- // both leave the tier answer exactly as it was.
81
- const admitted = capped.some(isRecruiting)
82
- ? undefined
83
- : sortedLocations.find((loc) => isRecruiting(loc) && locationGeoScore(loc, user) < best);
112
+ // The recruiting tie-break sorts any open matched site to the front of the
113
+ // tier, so a cap showing no open site means the tier holds none: every
114
+ // candidate sits below it. Nothing is admitted when best === 0 (the tier is
115
+ // every site) or when the study registers no recruiting site at all — both
116
+ // leave the tier answer exactly as it was. Candidates in the requested country
117
+ // go first when there are any: distance alone would send a patient who named
118
+ // their country across a border (Seattle → Vancouver, BC) while a site at home
119
+ // recruits.
120
+ let admitted;
121
+ if (!capped.some(isRecruiting)) {
122
+ const open = sortedLocations.filter(isRecruiting);
123
+ const home = open.filter((loc) => samePlace(loc.country, user.country));
124
+ admitted = admitRecruitingSite(home.length > 0 ? home : open, matched);
125
+ }
84
126
  const locations = admitted ? [...capped, admitted] : capped;
85
127
  if (locations.length === total)
86
128
  return { locations };
@@ -212,12 +254,13 @@ const ELIGIBLE_FIELDS = [
212
254
  'LocationState',
213
255
  'LocationCountry',
214
256
  'LocationStatus',
257
+ 'LocationGeoPoint',
215
258
  'CentralContactName',
216
259
  'CentralContactPhone',
217
260
  'CentralContactEMail',
218
261
  ];
219
262
  export const findEligible = tool('clinicaltrials_find_eligible', {
220
- description: "Match patient demographics and conditions to eligible recruiting clinical trials. Provide age, sex, conditions, and location to find studies with matching eligibility criteria, contact information, and recruiting locations. Results are re-ranked so studies whose own condition matches a requested condition surface above tangential matches from ClinicalTrials.gov's fuzzy condition search. Each candidate returns only the sites matching the requested location (capped by locationLimit), not the study's full registered site list — a large trial can register hundreds of sites worldwide. When none of a candidate's matched sites is recruiting, its nearest recruiting site is added, so an enrollable site is never hidden behind a closer closed one. Fetch a study's complete record with clinicaltrials_get_study_record.",
263
+ description: "Match patient demographics and conditions to eligible recruiting clinical trials. Provide age, sex, conditions, and location to find studies with matching eligibility criteria, contact information, and recruiting locations. Results are re-ranked so studies whose own condition matches a requested condition surface above tangential matches from ClinicalTrials.gov's fuzzy condition search. Each candidate returns only the sites matching the requested location (capped by locationLimit), not the study's full registered site list — a large trial can register hundreds of sites worldwide. When none of a candidate's matched sites is recruiting, one recruiting site is added so an enrollable site is never hidden behind a closer closed one: the one nearest the matched sites by their published coordinates, in the requested country whenever a site there recruits, carrying distanceMi, or the first in match order when coordinates are missing. Fetch a study's complete record with clinicaltrials_get_study_record.",
221
264
  annotations: {
222
265
  readOnlyHint: true,
223
266
  idempotentHint: true,
@@ -236,6 +279,7 @@ export const findEligible = tool('clinicaltrials_find_eligible', {
236
279
  when: 'ClinicalTrials.gov returned 429 after retry budget exhausted.',
237
280
  recovery: RECOVERY_HINTS.rate_limited,
238
281
  retryable: true,
282
+ thrownBy: 'service',
239
283
  },
240
284
  ],
241
285
  input: z.object({
@@ -266,12 +310,12 @@ export const findEligible = tool('clinicaltrials_find_eligible', {
266
310
  .min(1)
267
311
  .max(500)
268
312
  .default(10)
269
- .describe("Cap on the sites returned per candidate. Each candidate keeps only the sites matching the requested location at the narrowest level that matched (city, else state, else country), capped at this many; the rest of the study's registered sites are omitted. The cap governs those matched sites — when none of them is recruiting, the candidate's nearest recruiting site is added on top of it, so a candidate can carry one site more than this. Raise it to see more nearby sites, or fetch the complete site list with clinicaltrials_get_study_record. Each candidate reports totalLocations / matchedLocations / locationsTruncated / nearestRecruitingSiteAdded in locationSummary only when the bound actually dropped sites."),
313
+ .describe("Cap on the sites returned per candidate. Each candidate keeps only the sites matching the requested location at the narrowest level that matched (city, else state, else country), capped at this many; the rest of the study's registered sites are omitted. The cap governs those matched sites — when none of them is recruiting, one recruiting site is added on top of it (the nearest to any matched site, measured before this cap, when coordinates allow — in the requested country whenever a site there recruits), so a candidate can carry one site more than this. Raise it to see more nearby sites, or fetch the complete site list with clinicaltrials_get_study_record. Each candidate reports totalLocations / matchedLocations / locationsTruncated / nearestRecruitingSiteAdded in locationSummary only when the bound actually dropped sites."),
270
314
  }),
271
315
  output: z.object({
272
316
  studies: z
273
317
  .array(z.record(z.string(), z.unknown()))
274
- .describe("Matching studies with eligibility and location fields. Each candidate's protocolSection.contactsLocationsModule.locations is BOUNDED to the sites matching the requested location (capped at locationLimit) plus, when none of those is recruiting, the candidate's nearest recruiting site — not the study's full registered site list. A candidate whose sites were bounded also carries a top-level locationSummary object — { totalLocations, matchedLocations, locationsTruncated, nearestRecruitingSiteAdded?, retrieveFullStudyWith } — absent when nothing was dropped; nearestRecruitingSiteAdded is present only when that extra site was added. Fetch a study's complete record and site list with clinicaltrials_get_study_record."),
318
+ .describe("Matching studies with eligibility and location fields. Each candidate's protocolSection.contactsLocationsModule.locations is BOUNDED to the sites matching the requested location (capped at locationLimit) plus, when none of those is recruiting, one added recruiting site — not the study's full registered site list. The added site is the one nearest any matched site by published coordinates, taken from the requested country whenever a site there recruits, and carries distanceMi (miles to that nearest matched site); when the matched or recruiting sites publish no coordinates it is the first in match order and carries no distanceMi. A candidate whose sites were bounded also carries a top-level locationSummary object — { totalLocations, matchedLocations, locationsTruncated, nearestRecruitingSiteAdded?, retrieveFullStudyWith } — absent when nothing was dropped; nearestRecruitingSiteAdded is present only when that extra site was added (the key keeps its name in the match-order fallback). Fetch a study's complete record and site list with clinicaltrials_get_study_record."),
275
319
  totalCount: z.number().optional().describe('Total matching studies from the API.'),
276
320
  }),
277
321
  // Agent-facing context — search echo, funnel diagnostics, and no-match guidance.
@@ -476,7 +520,9 @@ export const findEligible = tool('clinicaltrials_find_eligible', {
476
520
  // buries the answer and dominates the payload. The bound is applied here,
477
521
  // once, before either output channel sees the record, so structuredContent
478
522
  // and format() render the same sites (#46, #91). Stable sort preserves
479
- // upstream order for sites with equal match scores.
523
+ // upstream order for sites with equal match scores. Site coordinates are
524
+ // requested only to measure the admitted site's distance (#138) and are
525
+ // dropped here, so neither channel carries a leaf the other never renders.
480
526
  const studies = result.studies.map((study) => {
481
527
  const raw = study;
482
528
  const locationsModule = raw.protocolSection?.contactsLocationsModule;
@@ -489,7 +535,10 @@ export const findEligible = tool('clinicaltrials_find_eligible', {
489
535
  ...study,
490
536
  protocolSection: {
491
537
  ...raw.protocolSection,
492
- contactsLocationsModule: { ...locationsModule, locations },
538
+ contactsLocationsModule: {
539
+ ...locationsModule,
540
+ locations: locations.map(({ geoPoint: _measuredOnly, ...loc }) => loc),
541
+ },
493
542
  },
494
543
  ...(summary ? { locationSummary: summary } : {}),
495
544
  };
@@ -623,9 +672,14 @@ export const findEligible = tool('clinicaltrials_find_eligible', {
623
672
  const locationSummary = study.locationSummary;
624
673
  if (locationSummary) {
625
674
  const truncated = locationSummary.locationsTruncated ? ', list truncated' : '';
626
- const admitted = locationSummary.nearestRecruitingSiteAdded
627
- ? '; none of them is recruiting, so the nearest recruiting site is included'
628
- : '';
675
+ // "Nearest" is claimed only when the admitted site was measured — it
676
+ // then carries distanceMi, rendered on the site itself below (#138).
677
+ const measured = locs.some((l) => l.distanceMi != null);
678
+ const admitted = !locationSummary.nearestRecruitingSiteAdded
679
+ ? ''
680
+ : measured
681
+ ? '; none of them is recruiting, so the nearest recruiting site is included'
682
+ : '; none of them is recruiting, so one recruiting site from a wider area is included (picked by match order — coordinates to measure distance are missing)';
629
683
  lines.push(` Sites: showing ${locs.length} of ${locationSummary.totalLocations} registered (${locationSummary.matchedLocations} match the requested location${truncated}${admitted}). Full site list: ${locationSummary.retrieveFullStudyWith} with ${nctId}.`);
630
684
  }
631
685
  // Locations are sorted by match-score and bounded in the handler, so the
@@ -637,12 +691,15 @@ export const findEligible = tool('clinicaltrials_find_eligible', {
637
691
  // rides along: the tool requests LocationStatus and returns it in
638
692
  // structuredContent, and a site-level status can differ from the study's
639
693
  // overall status, so omitting it made a NOT_YET_RECRUITING site read as
640
- // currently open (#91).
694
+ // currently open (#91). An admitted site's distanceMi renders on the site
695
+ // itself, so it reaches content[] even when no Sites line does (#138).
641
696
  if (locs.length > 0) {
642
697
  const locStr = locs
643
698
  .map((l) => {
644
699
  const site = [l.facility, l.city, l.state, l.country].filter(Boolean).join(', ');
645
- return l.status ? `${site} [${l.status}]` : site;
700
+ const status = l.status ? ` [${l.status}]` : '';
701
+ const distance = l.distanceMi != null ? ` (${l.distanceMi} mi from the nearest matched site)` : '';
702
+ return `${site}${status}${distance}`;
646
703
  })
647
704
  .join(' | ');
648
705
  lines.push(` Locations: ${locStr}`);
@@ -1 +1 @@
1
- {"version":3,"file":"find-eligible.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-eligible.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAw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KAAK,CAAC,IAAI,CACR,GAAG,0BAA0B,CAAC,KAAgC,EAAE,iBAAiB,EAAE;oBACjF,QAAQ,EAAE,MAAM,CAAC,iBAAiB;oBAClC,WAAW,EAAE,MAAM,CAAC,iBAAiB;iBACtC,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"find-eligible.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-eligible.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uDAAuD,CAAC;AAEjG,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,WAAW,EAA6B,MAAM,yBAAyB,CAAC;AACjF,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAQ5D,iFAAiF;AACjF,SAAS,SAAS,CAAC,CAAU,EAAE,CAAU;IACvC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACnF,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,GAAkB,EAAE,IAAkB;IAC9D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QAAE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