@cyanheads/brapi-mcp-server 0.3.9 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +3 -2
- package/README.md +1 -1
- package/changelog/0.4.x/0.4.0.md +29 -0
- package/changelog/0.4.x/0.4.1.md +20 -0
- package/changelog/0.4.x/0.4.2.md +23 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-connect.tool.d.ts +11 -0
- package/dist/mcp-server/tools/definitions/brapi-connect.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.d.ts +19 -14
- package/dist/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.js +24 -13
- package/dist/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-germplasm.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-germplasm.tool.js +53 -31
- package/dist/mcp-server/tools/definitions/brapi-find-germplasm.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.d.ts +16 -16
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.js +32 -18
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-locations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-locations.tool.js +12 -2
- package/dist/mcp-server/tools/definitions/brapi-find-locations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.d.ts +20 -20
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.js +40 -21
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.d.ts +0 -1
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.js +22 -11
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variables.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variables.tool.js +17 -4
- package/dist/mcp-server/tools/definitions/brapi-find-variables.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.d.ts +3 -3
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.js +14 -5
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-raw-search.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-raw-search.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-raw-search.tool.js +19 -0
- package/dist/mcp-server/tools/definitions/brapi-raw-search.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-server-info.tool.d.ts +11 -0
- package/dist/mcp-server/tools/definitions/brapi-server-info.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +86 -55
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/find-helpers.d.ts +16 -0
- package/dist/mcp-server/tools/shared/find-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/find-helpers.js +25 -0
- package/dist/mcp-server/tools/shared/find-helpers.js.map +1 -1
- package/dist/mcp-server/tools/shared/orientation-envelope.d.ts +22 -0
- package/dist/mcp-server/tools/shared/orientation-envelope.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/orientation-envelope.js +39 -0
- package/dist/mcp-server/tools/shared/orientation-envelope.js.map +1 -1
- package/dist/services/brapi-dialect/cassavabase-dialect.d.ts +28 -0
- package/dist/services/brapi-dialect/cassavabase-dialect.d.ts.map +1 -0
- package/dist/services/brapi-dialect/cassavabase-dialect.js +196 -0
- package/dist/services/brapi-dialect/cassavabase-dialect.js.map +1 -0
- package/dist/services/brapi-dialect/detect.d.ts +53 -0
- package/dist/services/brapi-dialect/detect.d.ts.map +1 -0
- package/dist/services/brapi-dialect/detect.js +68 -0
- package/dist/services/brapi-dialect/detect.js.map +1 -0
- package/dist/services/brapi-dialect/index.d.ts +29 -0
- package/dist/services/brapi-dialect/index.d.ts.map +1 -0
- package/dist/services/brapi-dialect/index.js +31 -0
- package/dist/services/brapi-dialect/index.js.map +1 -0
- package/dist/services/brapi-dialect/registry.d.ts +25 -0
- package/dist/services/brapi-dialect/registry.d.ts.map +1 -0
- package/dist/services/brapi-dialect/registry.js +39 -0
- package/dist/services/brapi-dialect/registry.js.map +1 -0
- package/dist/services/brapi-dialect/spec-dialect.d.ts +13 -0
- package/dist/services/brapi-dialect/spec-dialect.d.ts.map +1 -0
- package/dist/services/brapi-dialect/spec-dialect.js +17 -0
- package/dist/services/brapi-dialect/spec-dialect.js.map +1 -0
- package/dist/services/brapi-dialect/types.d.ts +58 -0
- package/dist/services/brapi-dialect/types.d.ts.map +1 -0
- package/dist/services/brapi-dialect/types.js +18 -0
- package/dist/services/brapi-dialect/types.js.map +1 -0
- package/package.json +1 -1
- package/server.json +3 -3
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** brapi-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
4
|
+
**Version:** 0.4.2
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
6
6
|
|
|
7
7
|
> **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.
|
|
@@ -172,7 +172,7 @@ Handlers receive a unified `ctx` object. Currently used surface:
|
|
|
172
172
|
|
|
173
173
|
Handlers throw — the framework catches, classifies, and formats.
|
|
174
174
|
|
|
175
|
-
**Default for new tools: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` 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); to surface it on the wire, spread `...ctx.recoveryFor('reason')` into `data` or pass an explicit `{ recovery: { hint: '...' } }` when runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring. Live across the BrAPI surface today: `brapi_connect`, `brapi_describe_filters`, `brapi_find_genotype_calls`, `brapi_get_germplasm`, `brapi_get_image`, `brapi_get_study`, `brapi_manage_dataset`, `brapi_raw_get`, `brapi_submit_observations`, plus the `brapi://study/{studyDbId}`, `brapi://germplasm/{germplasmDbId}`, and `brapi://filters/{endpoint}` resources.
|
|
175
|
+
**Default for new tools: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` 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); to surface it on the wire, spread `...ctx.recoveryFor('reason')` into `data` or pass an explicit `{ recovery: { hint: '...' } }` when runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring. Live across the BrAPI surface today: `brapi_connect`, `brapi_describe_filters`, `brapi_find_genotype_calls`, `brapi_get_germplasm`, `brapi_get_image`, `brapi_get_study`, `brapi_manage_dataset`, `brapi_raw_get`, `brapi_raw_search`, `brapi_submit_observations`, plus the `brapi://study/{studyDbId}`, `brapi://germplasm/{germplasmDbId}`, and `brapi://filters/{endpoint}` resources.
|
|
176
176
|
|
|
177
177
|
```ts
|
|
178
178
|
errors: [
|
|
@@ -219,6 +219,7 @@ src/
|
|
|
219
219
|
alias-credentials.ts # Per-alias env-var resolution (BRAPI_<ALIAS>_*) for brapi_connect
|
|
220
220
|
services/
|
|
221
221
|
brapi-client/ # HTTP client — retry, concurrency cap, async-search poll, private-IP guard, binary fetch, POST/PUT
|
|
222
|
+
brapi-dialect/ # Per-server filter / payload adapters (spec, cassavabase) — translates plural→singular, drops searchText, declares known-dead POST /search routes; envelope surfaces id + source + disabled-search nouns
|
|
222
223
|
brapi-filters/ # Static v2.1 filter catalog
|
|
223
224
|
capability-registry/ # Per-connection /serverinfo cache + call guard
|
|
224
225
|
dataset-store/ # Tenant-scoped handles for spilled find_* results
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](https://www.npmjs.com/package/@cyanheads/brapi-mcp-server) [](https://www.npmjs.com/package/@cyanheads/brapi-mcp-server) [](./CHANGELOG.md) [](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [](https://modelcontextprotocol.io/)
|
|
11
11
|
|
|
12
12
|
[](./LICENSE) [](https://www.typescriptlang.org/) [](https://bun.sh/) [](./CHANGELOG.md)
|
|
13
13
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Per-server dialect adapters route around upstream filter quirks. CassavaBase and SGN-family deployments now receive the singular filter forms they actually honor; `searchText` (the fictional non-spec query param earlier versions sent) is dropped."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.4.0 — 2026-04-30
|
|
7
|
+
|
|
8
|
+
Live testing against `https://cassavabase.org/brapi/v2` revealed that every plural BrAPI v2.1 query-string filter the read tools sent (`commonCropNames`, `studyTypes`, `programDbIds`, `seasonDbIds`, etc.) was silently ignored — the upstream returned the unfiltered superset every time. CassavaBase and its SGN-family siblings (Sweetpotatobase, Yambase, Musabase, BananaBase) only honor the older singular forms (`commonCropName`, `studyType`, …). The fix is a new dialect-adapter service that translates the spec-shape filter map to whatever the upstream actually understands, with detection driven by `serverInfo.serverName` plus a `BRAPI_<ALIAS>_DIALECT` env override. The `searchText` parameter — invented by an earlier version of these tools and honored by no BrAPI v2 server — is dropped in the same pass.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- **`@/services/brapi-dialect/` service** — per-server adapter layer that translates outbound filter maps before serialization. The `BrapiDialect` interface starts with one capability (`adaptGetFilters(endpoint, filters) → { filters, warnings }`) and is extensible to non-filter quirks (search-body shape, output normalization) via optional methods. Two built-in dialects:
|
|
13
|
+
- **`spec`** — passthrough; used for any server that implements BrAPI v2.1 query-string filters as written (BrAPI Community Test Server, modern PIPPA / GnpIS deployments, BMS, GERMINATE).
|
|
14
|
+
- **`cassavabase`** — translates plurals to singulars per endpoint, downcasts multi-value arrays to the first element with a loud warning, drops the non-spec `searchText` filter. Selected automatically when `serverInfo.serverName` matches CassavaBase, Sweetpotatobase, Yambase, Musabase, or BananaBase (substring match, case-insensitive). The `organizationName` field also matches "Boyce Thompson" so generic-named deployments behind BTI hosting still resolve.
|
|
15
|
+
- **`BRAPI_<ALIAS>_DIALECT` env override** — pin the dialect for an alias when detection guesses wrong. Accepts any registered dialect id (`spec`, `cassavabase`); `auto` (or unset) defers to detection.
|
|
16
|
+
- **`resolveDialect(connection, ctx)`** — async helper that consults the env override first, then the cached `CapabilityProfile` (already fetched by `capabilities.ensure()`, so zero extra HTTP). Returns the resolved `BrapiDialect`.
|
|
17
|
+
- **Tests** — 42 new cases across `tests/services/brapi-dialect/` (spec passthrough, full CassavaBase translation table per endpoint, multi-value downcast warning, env-override precedence, registry fallback to spec on unknown ids, idempotent init). New cases in `brapi-find-studies.tool.test.ts` exercise the end-to-end CassavaBase wire path: `commonCropNames=Cassava` arriving as `commonCropName=Cassava` on the URL, multi-value array warnings.
|
|
18
|
+
|
|
19
|
+
## Changed
|
|
20
|
+
|
|
21
|
+
- **All seven `find_*` tools route through the dialect** — `brapi_find_studies`, `brapi_find_germplasm`, `brapi_find_observations`, `brapi_find_locations`, `brapi_find_variables`, `brapi_find_images`, `brapi_find_variants` resolve the dialect after `capabilities.ensure()` and call `dialect.adaptGetFilters(endpoint, filters)` before `loadInitialPage`. Helpers stay pure; the adapter concern is contained at the tool layer where the warning surface lives.
|
|
22
|
+
- **`brapi_find_germplasm` `text` parameter is now a client-side substring post-filter** rather than a server-side `searchText` query (which CassavaBase, the BrAPI Test Server, and every other v2 implementation silently ignore). Matches across `germplasmName`, `accessionNumber`, `defaultDisplayName`, and registered synonyms on the rows already returned by upstream filters. Surfaces a warning when the match drops rows from the in-context view (the dataset, when present, retains the full pre-filter set so a follow-up `brapi_manage_dataset` call can re-query). Description updated to make the client-side behavior explicit so callers combine `text` with `crops` / `genus` / `accessionNumbers` to narrow upstream first.
|
|
23
|
+
- **`SERVER_TO_USER` rendering maps in every find tool extended with singular forms** so `appliedFilters` rendering still maps wire keys back to the user-facing parameter after dialect translation. Both plural and singular keys point at the same user param.
|
|
24
|
+
|
|
25
|
+
## Fixed
|
|
26
|
+
|
|
27
|
+
- **CassavaBase compatibility** — `brapi_find_studies`, `brapi_find_germplasm`, `brapi_find_observations`, `brapi_find_locations`, `brapi_find_variables`, `brapi_find_images`, `brapi_find_variants` now actually filter when connected to a CassavaBase / SGN-family deployment. Empirically verified on the live CassavaBase server: `commonCropName`, `programDbId`, `trialDbId`, `seasonDbId` all narrow as expected; the unfiltered totalCount=8340 trap is gone.
|
|
28
|
+
- **`brapi_find_studies` removed the non-functional `text` input** — earlier versions sent `searchText` as a query parameter, which no BrAPI v2 server honors. The field appeared to work in `appliedFilters` output while the upstream returned the unfiltered superset. Removed entirely; combine `studyNames`, `crop`, and `programs` to narrow.
|
|
29
|
+
- **`brapi_find_germplasm` `searchText` query parameter dropped from the wire** — replaced by the client-side post-filter described above. Old behavior was misleading: `text` showed in `appliedFilters` while the upstream silently ignored it.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Dialects declare known-dead POST /search routes — raw_search and find_genotype_calls refuse with a typed error before hitting the upstream. Orientation envelope surfaces the active dialect so agents can plan around quirks."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.4.1 — 2026-04-30
|
|
7
|
+
|
|
8
|
+
Follow-on patch to 0.4.0 that closes two real workflow gaps the initial dialect adapter left open. CassavaBase advertises POST `/search/{noun}` for most read endpoints in `/calls`, but those routes are unresponsive in practice — agents calling them through `brapi_raw_search` or `brapi_find_genotype_calls` would hang or get malformed envelopes. And although the dialect was active under the hood, agents had no visibility into which dialect was selected or what quirks it was routing around — they only learned via after-the-fact warnings. Both are addressed; the orientation envelope now carries a `dialect` block, and the disabled-search nouns are refused before the upstream call.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- **`disabledSearchEndpoints?: ReadonlySet<string>` on `BrapiDialect`** — declarative list of POST `/search/{noun}` routes the dialect knows are dead. CassavaBase populates 11 entries (`germplasm`, `studies`, `observations`, `observationunits`, `locations`, `variables`, `images`, `variants`, `variantsets`, `samples`, `callsets`); `calls` is intentionally absent because async POST is the only realistic delivery for bulk genotype data and we have no contrary evidence that route is dead. Spec dialect omits the field entirely.
|
|
13
|
+
- **`brapi_raw_search` and `brapi_find_genotype_calls` consult the dialect's disabled-search set** — both throw a typed `search_endpoint_disabled` `ValidationError` before issuing the POST when the noun is declared dead. `raw_search` includes the curated-tool nudge in the recovery hint (e.g. "Consider `brapi_find_germplasm`"); `find_genotype_calls` directs the agent to bypass via `BRAPI_<ALIAS>_DIALECT=spec`. Avoids hangs and silent garbage from advertised-but-broken upstream routes.
|
|
14
|
+
- **`dialect` block on the orientation envelope** — `brapi_connect`, `brapi_server_info`, and the `brapi://server/info` resource now surface the active dialect: `{ id, source: 'env-override' | 'server-name' | 'organization-name' | 'fallback', envVar, disabledSearchEndpoints[] }`. The `source` field tells the agent how detection landed; the `envVar` field tells the operator which knob to pin if detection misfires. Rendered in the formatter under a new `## Dialect` block.
|
|
15
|
+
- **Tests** — 24 new cases. `tests/services/brapi-dialect/cassavabase-dialect.test.ts` covers the disabled-endpoint declaration. `tests/tools/brapi-raw-search.tool.test.ts` covers refusal on disabled nouns and pass-through on enabled ones. `tests/tools/brapi-find-genotype-calls.tool.test.ts` covers refusal via a custom test dialect that disables `calls`. `tests/tools/brapi-connect.tool.test.ts` covers the dialect block on the spec / cassavabase / env-override paths. `tests/services/brapi-dialect/detect.test.ts` covers the new `{ id, source }` return shape.
|
|
16
|
+
|
|
17
|
+
## Changed
|
|
18
|
+
|
|
19
|
+
- **`detectDialectId` and `detectDialectFromName` return `{ id, source }`** instead of a bare string — internal API change so the orientation envelope can report whether the dialect was env-pinned, name-matched, organization-matched, or a fallback. The single existing internal caller (`resolveDialect`) was updated; no public-API consequences.
|
|
20
|
+
- **`applyDialectFilters(dialect, endpoint, filters, warnings) → filters` helper added to `find-helpers`** — collapses the `adapted = dialect.adaptGetFilters(...); warnings.push(...adapted.warnings); const filters = adapted.filters;` 3-liner repeated across all seven `find_*` tools into a single line. Mirrors the existing `mergeFilters(named, extra, warnings)` shape; reduces the chance of forgetting the warnings spread in future tool additions.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Row schemas accept null fields from sparse upstreams. FK match-rate checks across find_studies / find_observations / find_images surface silently-ignored filters as warnings. CassavaBase locationDbIds dropped on /studies."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.4.2 — 2026-04-30
|
|
7
|
+
|
|
8
|
+
Field testing against `https://cassavabase.org/brapi/v2` after 0.4.1 surfaced two classes of correctness gaps: (1) several upstream record types return `null` for missing optional fields where row schemas required `string | undefined` — Zod parse failed before the agent ever saw the data; (2) the post-fetch `checkFilterMatchRates` heuristic was wired up unevenly across find tools, so when a CassavaBase-side filter was silently ignored (e.g. `locationDbId` on `/studies`), the result envelope arrived clean with no signal that the filter had been dropped. This release closes both gaps and removes the one mapping that field testing proved doesn't filter even after dialect translation.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- **`fkMatchCheck(paramName, requestedValues, rows, fieldName)` helper in `find-helpers`** — builds a `FilterMatchCheck` for an FK identifier filter inline. Replaces the 4-line `computeDistribution(...)` + `{ paramName, requestedValues, distribution }` construction repeated nine times across the three find tools that gained match-rate coverage. The DbId distribution is computed only for the check; not exposed in `result.distributions` (raw FK frequencies don't carry semantic meaning to agents).
|
|
13
|
+
- **FK filter match-rate checks** — `brapi_find_studies` now checks `locations` / `programs` / `trials`; `brapi_find_observations` adds `studies` / `germplasm` / `variables` / `observationUnits`; `brapi_find_images` adds `studies` / `observationUnits`. When the upstream silently ignores a filter and returns an unrelated row set, the user receives a `Filter 'X' requested […] but no returned row matches — the server may not honor this filter` warning instead of a clean envelope they'll trust.
|
|
14
|
+
- **Tests** — 9 new cases. `tests/tools/brapi-find-{observations,images}.tool.test.ts` cover explicit-null upstream rows (the CassavaBase shape that broke 0.4.1 in the wild). `tests/tools/brapi-find-studies.tool.test.ts` covers the new locations/programs/trials warnings. `tests/services/brapi-dialect/cassavabase-dialect.test.ts` covers the `locationDbIds` drop on `/studies` for both plural and singular forms.
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- **`ObservationRowSchema` (14 fields), `ImageRowSchema` (12 fields), `VariantRowSchema` (3 top-level identifier fields), `CallRowSchema` (5 fields + `genotype` block), and `callFormatting` echo block converted from `.optional()` to `.nullish()`** — accepts the explicit `null` values CassavaBase and other sparse-upstream servers return for missing optional fields. Pre-0.4.2, a row like `{ observationDbId: 'obs-1', observationTimeStamp: null, germplasmName: null, ... }` failed Zod parse on the entire envelope. Post-0.4.2, the agent receives the row with the nulls preserved on output. `StudyRowSchema`, `GermplasmRowSchema`, `VariableRowSchema`, and `LocationRowSchema` already used `.nullish()` from prior live-testing rounds — this release brings the remaining row schemas to parity.
|
|
19
|
+
- **`brapi_find_variables.text` description rewritten** to make the rank-not-subset behavior explicit and call out the divergence from `brapi_find_germplasm.text` (which subsets). Same parameter name, different semantics — the documentation now says so loudly. Use exact filters (`variables`, `variableNames`, `variablePUIs`, `traitClasses`, `ontologies`) to actually narrow the result set.
|
|
20
|
+
|
|
21
|
+
## Fixed
|
|
22
|
+
|
|
23
|
+
- **CassavaBase `locationDbIds` on `/studies` moved to `DROPPED_FILTERS`** — empirically verified that the singular `locationDbId` form is silently ignored too: requesting `locationDbId=3` against the live `/studies` endpoint returned studies for unrelated locations (Mokwa, Zaria). 0.4.0's plural→singular translation produced a wire shape that looked correct but didn't filter. The dialect now drops the filter from the wire entirely and surfaces a `dropped filter 'locationDbIds'` warning so the agent knows the request can't be served as-is. Until we have a working alternative, narrow location-wise post-fetch via `locationName` distribution or a follow-up `brapi_get_study` call. See [#5](https://github.com/cyanheads/brapi-mcp-server/issues/5) for the broader verified-flag-per-mapping work this is one step toward.
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
10
10
|
import { getServerConfig } from './config/server-config.js';
|
|
11
11
|
import { initBrapiClient } from './services/brapi-client/index.js';
|
|
12
|
+
import { initBrapiDialectRegistry } from './services/brapi-dialect/index.js';
|
|
12
13
|
import { initCapabilityRegistry } from './services/capability-registry/index.js';
|
|
13
14
|
import { initDatasetStore } from './services/dataset-store/index.js';
|
|
14
15
|
import { initOntologyResolver } from './services/ontology-resolver/index.js';
|
|
@@ -41,6 +42,7 @@ await createApp({
|
|
|
41
42
|
setup() {
|
|
42
43
|
initBrapiClient(serverConfig);
|
|
43
44
|
initCapabilityRegistry(serverConfig);
|
|
45
|
+
initBrapiDialectRegistry();
|
|
44
46
|
initReferenceDataCache(serverConfig);
|
|
45
47
|
initDatasetStore(serverConfig);
|
|
46
48
|
initServerRegistry(serverConfig);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4DAA4D,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAChG,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AAEjD,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;AAEv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E,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAChG,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AAEjD,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;AAEvC,MAAM,KAAK,GAAG,YAAY,CAAC,YAAY;IACrC,CAAC,CAAC,CAAC,GAAG,uBAAuB,EAAE,GAAG,oBAAoB,CAAC;IACvD,CAAC,CAAC,uBAAuB,CAAC;AAE5B,MAAM,SAAS,CAAC;IACd,KAAK;IACL,SAAS,EAAE;QACT,uBAAuB;QACvB,kBAAkB;QAClB,kBAAkB;QAClB,sBAAsB;QACtB,oBAAoB;QACpB,oBAAoB;KACrB;IACD,OAAO,EAAE,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC3C,KAAK;QACH,eAAe,CAAC,YAAY,CAAC,CAAC;QAC9B,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACrC,wBAAwB,EAAE,CAAC;QAC3B,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACrC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAC/B,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACjC,oBAAoB,EAAE,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -59,6 +59,17 @@ export declare const brapiConnect: import("@cyanheads/mcp-ts-core").ToolDefiniti
|
|
|
59
59
|
supported: z.ZodArray<z.ZodString>;
|
|
60
60
|
notableGaps: z.ZodArray<z.ZodString>;
|
|
61
61
|
}, z.core.$strip>;
|
|
62
|
+
dialect: z.ZodObject<{
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
source: z.ZodEnum<{
|
|
65
|
+
"env-override": "env-override";
|
|
66
|
+
"server-name": "server-name";
|
|
67
|
+
"organization-name": "organization-name";
|
|
68
|
+
fallback: "fallback";
|
|
69
|
+
}>;
|
|
70
|
+
envVar: z.ZodString;
|
|
71
|
+
disabledSearchEndpoints: z.ZodArray<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>;
|
|
62
73
|
content: z.ZodObject<{
|
|
63
74
|
crops: z.ZodArray<z.ZodString>;
|
|
64
75
|
studyCount: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brapi-connect.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-connect.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAqBjE,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"brapi-connect.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-connect.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAqBjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FvB,CAAC"}
|
|
@@ -27,25 +27,25 @@ export declare const brapiFindGenotypeCalls: import("@cyanheads/mcp-ts-core").To
|
|
|
27
27
|
}, z.core.$strip>, z.ZodObject<{
|
|
28
28
|
alias: z.ZodString;
|
|
29
29
|
results: z.ZodArray<z.ZodObject<{
|
|
30
|
-
callSetDbId: z.ZodOptional<z.ZodString
|
|
31
|
-
callSetName: z.ZodOptional<z.ZodString
|
|
32
|
-
variantDbId: z.ZodOptional<z.ZodString
|
|
33
|
-
variantName: z.ZodOptional<z.ZodString
|
|
34
|
-
variantSetDbId: z.ZodOptional<z.ZodString
|
|
35
|
-
genotype: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
values: z.ZodOptional<z.ZodArray<z.ZodString
|
|
37
|
-
}, z.core.$loose
|
|
38
|
-
genotypeValue: z.ZodOptional<z.ZodString
|
|
39
|
-
phaseSet: z.ZodOptional<z.ZodString
|
|
30
|
+
callSetDbId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
callSetName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
variantDbId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
variantName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
variantSetDbId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
genotype: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
36
|
+
values: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
37
|
+
}, z.core.$loose>>>;
|
|
38
|
+
genotypeValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
phaseSet: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
40
|
}, z.core.$loose>>;
|
|
41
41
|
returnedCount: z.ZodNumber;
|
|
42
42
|
totalCount: z.ZodNumber;
|
|
43
43
|
hasMore: z.ZodBoolean;
|
|
44
44
|
callFormatting: z.ZodObject<{
|
|
45
|
-
expandHomozygotes: z.ZodOptional<z.ZodBoolean
|
|
46
|
-
unknownString: z.ZodOptional<z.ZodString
|
|
47
|
-
sepPhased: z.ZodOptional<z.ZodString
|
|
48
|
-
sepUnphased: z.ZodOptional<z.ZodString
|
|
45
|
+
expandHomozygotes: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
46
|
+
unknownString: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
sepPhased: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
sepUnphased: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
49
|
}, z.core.$strip>;
|
|
50
50
|
distributions: z.ZodObject<{
|
|
51
51
|
callSetName: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
@@ -70,5 +70,10 @@ export declare const brapiFindGenotypeCalls: import("@cyanheads/mcp-ts-core").To
|
|
|
70
70
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
71
71
|
readonly when: "No variant set, germplasm, call set, or variant filter was provided";
|
|
72
72
|
readonly recovery: "Provide variantSetDbId or germplasmDbIds before retrying — unfiltered pulls are too expensive.";
|
|
73
|
+
}, {
|
|
74
|
+
readonly reason: "search_endpoint_disabled";
|
|
75
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
76
|
+
readonly when: "The active dialect declares POST /search/calls as known-dead on this server";
|
|
77
|
+
readonly recovery: "Pin BRAPI_<ALIAS>_DIALECT=spec to bypass the dialect, or query a different server that exposes a working /search/calls route.";
|
|
73
78
|
}]>;
|
|
74
79
|
//# sourceMappingURL=brapi-find-genotype-calls.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brapi-find-genotype-calls.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"brapi-find-genotype-calls.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0HjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+MjC,CAAC"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
11
11
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
12
12
|
import { getBrapiClient } from '../../../services/brapi-client/index.js';
|
|
13
|
+
import { resolveDialect } from '../../../services/brapi-dialect/index.js';
|
|
13
14
|
import { getCapabilityRegistry } from '../../../services/capability-registry/index.js';
|
|
14
15
|
import { getDatasetStore, } from '../../../services/dataset-store/index.js';
|
|
15
16
|
import { DEFAULT_ALIAS, getServerRegistry } from '../../../services/server-registry/index.js';
|
|
@@ -21,29 +22,29 @@ const CallRowSchema = z
|
|
|
21
22
|
.object({
|
|
22
23
|
callSetDbId: z
|
|
23
24
|
.string()
|
|
24
|
-
.
|
|
25
|
+
.nullish()
|
|
25
26
|
.describe('FK to the call set (one germplasm × one variant set = one call set).'),
|
|
26
|
-
callSetName: z.string().
|
|
27
|
-
variantDbId: z.string().
|
|
28
|
-
variantName: z.string().
|
|
29
|
-
variantSetDbId: z.string().
|
|
27
|
+
callSetName: z.string().nullish().describe('Display name of the call set.'),
|
|
28
|
+
variantDbId: z.string().nullish().describe('FK to the variant being called.'),
|
|
29
|
+
variantName: z.string().nullish().describe('Display name / alias of the variant.'),
|
|
30
|
+
variantSetDbId: z.string().nullish().describe('FK to the variant set the call belongs to.'),
|
|
30
31
|
genotype: z
|
|
31
32
|
.object({
|
|
32
33
|
values: z
|
|
33
34
|
.array(z.string().describe('Per-allele value string.'))
|
|
34
|
-
.
|
|
35
|
+
.nullish()
|
|
35
36
|
.describe('Encoded allele values — interpret using top-level `callFormatting`.'),
|
|
36
37
|
})
|
|
37
38
|
.passthrough()
|
|
38
|
-
.
|
|
39
|
+
.nullish()
|
|
39
40
|
.describe('Structured genotype payload (array of allele values plus server-specific fields).'),
|
|
40
41
|
genotypeValue: z
|
|
41
42
|
.string()
|
|
42
|
-
.
|
|
43
|
+
.nullish()
|
|
43
44
|
.describe('Legacy flat string form of the call (provided by some servers instead of `genotype`).'),
|
|
44
45
|
phaseSet: z
|
|
45
46
|
.string()
|
|
46
|
-
.
|
|
47
|
+
.nullish()
|
|
47
48
|
.describe('Phase-set identifier linking calls that share a haplotype phase.'),
|
|
48
49
|
})
|
|
49
50
|
.passthrough()
|
|
@@ -64,19 +65,19 @@ const OutputSchema = z.object({
|
|
|
64
65
|
.object({
|
|
65
66
|
expandHomozygotes: z
|
|
66
67
|
.boolean()
|
|
67
|
-
.
|
|
68
|
+
.nullish()
|
|
68
69
|
.describe('When true, homozygous calls are expanded to both alleles.'),
|
|
69
70
|
unknownString: z
|
|
70
71
|
.string()
|
|
71
|
-
.
|
|
72
|
+
.nullish()
|
|
72
73
|
.describe('String used for unknown / missing calls (often "." or "N").'),
|
|
73
74
|
sepPhased: z
|
|
74
75
|
.string()
|
|
75
|
-
.
|
|
76
|
+
.nullish()
|
|
76
77
|
.describe('Separator between phased allele values (typically "|").'),
|
|
77
78
|
sepUnphased: z
|
|
78
79
|
.string()
|
|
79
|
-
.
|
|
80
|
+
.nullish()
|
|
80
81
|
.describe('Separator between unphased allele values (typically "/").'),
|
|
81
82
|
})
|
|
82
83
|
.describe('Genotype-encoding hints echoed by the server.'),
|
|
@@ -112,6 +113,12 @@ export const brapiFindGenotypeCalls = tool('brapi_find_genotype_calls', {
|
|
|
112
113
|
when: 'No variant set, germplasm, call set, or variant filter was provided',
|
|
113
114
|
recovery: 'Provide variantSetDbId or germplasmDbIds before retrying — unfiltered pulls are too expensive.',
|
|
114
115
|
},
|
|
116
|
+
{
|
|
117
|
+
reason: 'search_endpoint_disabled',
|
|
118
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
119
|
+
when: 'The active dialect declares POST /search/calls as known-dead on this server',
|
|
120
|
+
recovery: 'Pin BRAPI_<ALIAS>_DIALECT=spec to bypass the dialect, or query a different server that exposes a working /search/calls route.',
|
|
121
|
+
},
|
|
115
122
|
],
|
|
116
123
|
input: z.object({
|
|
117
124
|
alias: AliasInput,
|
|
@@ -158,6 +165,10 @@ export const brapiFindGenotypeCalls = tool('brapi_find_genotype_calls', {
|
|
|
158
165
|
if (connection.resolvedAuth)
|
|
159
166
|
capabilityLookup.auth = connection.resolvedAuth;
|
|
160
167
|
await capabilities.ensure(connection.baseUrl, { service: 'search/calls', method: 'POST' }, ctx, capabilityLookup);
|
|
168
|
+
const dialect = await resolveDialect(connection, ctx, capabilityLookup);
|
|
169
|
+
if (dialect.disabledSearchEndpoints?.has('calls')) {
|
|
170
|
+
throw ctx.fail('search_endpoint_disabled', `Dialect '${dialect.id}' marks POST /search/calls as known-dead on this server. Genotype-call workflows are not viable here without bypassing the dialect.`, { dialectId: dialect.id, ...ctx.recoveryFor('search_endpoint_disabled') });
|
|
171
|
+
}
|
|
161
172
|
const maxCalls = Math.min(input.maxCalls ?? DEFAULT_MAX_CALLS, HARD_MAX_CALLS);
|
|
162
173
|
const loadLimit = input.loadLimit ?? 200;
|
|
163
174
|
const searchBody = buildSearchBody(input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brapi-find-genotype-calls.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAoB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,qBAAq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C,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAClE,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,cAAc,CAAC,IAA6B;IACnD,MAAM,eAAe,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACzE,OAAO,CACL,OAAO,IAAI,CAAC,cAAc,KAAK,QAAQ;QACvC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC;QACrC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC;QACpC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC;QAClC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CACnC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"brapi-find-genotype-calls.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-find-genotype-calls.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAoB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAGL,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAEvF,OAAO,EACL,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEn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AC,SAAS,EAAE,CAAC;QACpB,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC;QAC7B,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACtC,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAClE,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,cAAc,CAAC,IAA6B;IACnD,MAAM,eAAe,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACzE,OAAO,CACL,OAAO,IAAI,CAAC,cAAc,KAAK,QAAQ;QACvC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC;QACrC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC;QACpC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC;QAClC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brapi-find-germplasm.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-find-germplasm.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"brapi-find-germplasm.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-find-germplasm.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AA0IjD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA6P7B,CAAC"}
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
10
10
|
import { getServerConfig } from '../../../config/server-config.js';
|
|
11
11
|
import { getBrapiClient } from '../../../services/brapi-client/index.js';
|
|
12
|
+
import { resolveDialect } from '../../../services/brapi-dialect/index.js';
|
|
12
13
|
import { getCapabilityRegistry } from '../../../services/capability-registry/index.js';
|
|
13
14
|
import { getDatasetStore } from '../../../services/dataset-store/index.js';
|
|
14
15
|
import { DEFAULT_ALIAS, getServerRegistry } from '../../../services/server-registry/index.js';
|
|
15
|
-
import { AliasInput, asString, buildRefinementHint, checkFilterMatchRates, computeDistribution, DatasetHandleSchema, ExtraFiltersInput, LoadLimitInput, loadInitialPage, maybeSpill, mergeFilters, renderAppliedFilters, renderDatasetHandle, renderDistributions, renderFindHeader, } from '../shared/find-helpers.js';
|
|
16
|
+
import { AliasInput, applyDialectFilters, asString, buildRefinementHint, checkFilterMatchRates, computeDistribution, DatasetHandleSchema, ExtraFiltersInput, LoadLimitInput, loadInitialPage, maybeSpill, mergeFilters, renderAppliedFilters, renderDatasetHandle, renderDistributions, renderFindHeader, } from '../shared/find-helpers.js';
|
|
16
17
|
const GermplasmRowSchema = z
|
|
17
18
|
.object({
|
|
18
19
|
germplasmDbId: z.string().describe('Server-side identifier for the germplasm.'),
|
|
@@ -94,6 +95,7 @@ const OutputSchema = z.object({
|
|
|
94
95
|
.describe('The final filter map sent to the server (named + extraFilters).'),
|
|
95
96
|
});
|
|
96
97
|
const SERVER_TO_USER = {
|
|
98
|
+
// Plurals — BrAPI v2.1 spec, used by the `spec` dialect.
|
|
97
99
|
germplasmNames: 'names',
|
|
98
100
|
germplasmDbIds: 'germplasmDbIds',
|
|
99
101
|
germplasmPUIs: 'germplasmPUIs',
|
|
@@ -101,9 +103,17 @@ const SERVER_TO_USER = {
|
|
|
101
103
|
commonCropNames: 'crops',
|
|
102
104
|
synonyms: 'synonyms',
|
|
103
105
|
collections: 'collections',
|
|
106
|
+
// Singulars — emitted by SGN-family dialects (cassavabase, etc.).
|
|
107
|
+
germplasmName: 'names',
|
|
108
|
+
germplasmDbId: 'germplasmDbIds',
|
|
109
|
+
germplasmPUI: 'germplasmPUIs',
|
|
110
|
+
accessionNumber: 'accessionNumbers',
|
|
111
|
+
commonCropName: 'crops',
|
|
112
|
+
synonym: 'synonyms',
|
|
113
|
+
collection: 'collections',
|
|
114
|
+
// Scalars — same on the wire either way.
|
|
104
115
|
genus: 'genus',
|
|
105
116
|
species: 'species',
|
|
106
|
-
searchText: 'text',
|
|
107
117
|
};
|
|
108
118
|
export const brapiFindGermplasm = tool('brapi_find_germplasm', {
|
|
109
119
|
description: 'Find germplasm by name, synonym, accession number, PUI, crop, or free-text query. Matches across registered synonyms. Returns a dataset handle when the upstream total exceeds loadLimit.',
|
|
@@ -122,7 +132,10 @@ export const brapiFindGermplasm = tool('brapi_find_germplasm', {
|
|
|
122
132
|
collections: z.array(z.string()).optional().describe('Filter by germplasm collection names.'),
|
|
123
133
|
genus: z.string().optional().describe('Botanical genus.'),
|
|
124
134
|
species: z.string().optional().describe('Botanical species.'),
|
|
125
|
-
text: z
|
|
135
|
+
text: z
|
|
136
|
+
.string()
|
|
137
|
+
.optional()
|
|
138
|
+
.describe('Free-text query. Applied client-side as a substring match on returned rows (germplasmName, accessionNumber, defaultDisplayName, registered synonyms) — no BrAPI server reliably supports a server-side free-text filter, so combine with `crops` / `genus` / etc. to narrow the upstream pull first.'),
|
|
126
139
|
loadLimit: LoadLimitInput,
|
|
127
140
|
extraFilters: ExtraFiltersInput,
|
|
128
141
|
}),
|
|
@@ -138,8 +151,9 @@ export const brapiFindGermplasm = tool('brapi_find_germplasm', {
|
|
|
138
151
|
if (connection.resolvedAuth)
|
|
139
152
|
capabilityLookup.auth = connection.resolvedAuth;
|
|
140
153
|
await capabilities.ensure(connection.baseUrl, { service: 'germplasm', method: 'GET' }, ctx, capabilityLookup);
|
|
154
|
+
const dialect = await resolveDialect(connection, ctx, capabilityLookup);
|
|
141
155
|
const warnings = [];
|
|
142
|
-
const
|
|
156
|
+
const merged = mergeFilters({
|
|
143
157
|
germplasmNames: input.names,
|
|
144
158
|
germplasmDbIds: input.germplasmDbIds,
|
|
145
159
|
germplasmPUIs: input.germplasmPUIs,
|
|
@@ -149,8 +163,8 @@ export const brapiFindGermplasm = tool('brapi_find_germplasm', {
|
|
|
149
163
|
collections: input.collections,
|
|
150
164
|
genus: input.genus,
|
|
151
165
|
species: input.species,
|
|
152
|
-
searchText: input.text,
|
|
153
166
|
}, input.extraFilters, warnings);
|
|
167
|
+
const filters = applyDialectFilters(dialect, 'germplasm', merged, warnings);
|
|
154
168
|
const loadLimit = input.loadLimit ?? config.loadLimit;
|
|
155
169
|
const firstPage = await loadInitialPage(client, connection, '/germplasm', filters, loadLimit, ctx);
|
|
156
170
|
const { fullRows, dataset: datasetMeta } = await maybeSpill({
|
|
@@ -212,20 +226,30 @@ export const brapiFindGermplasm = tool('brapi_find_germplasm', {
|
|
|
212
226
|
'text',
|
|
213
227
|
],
|
|
214
228
|
});
|
|
215
|
-
//
|
|
216
|
-
//
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
229
|
+
// Free-text matching is client-side. No BrAPI server reliably honors a
|
|
230
|
+
// free-text query parameter on /germplasm — earlier versions of this tool
|
|
231
|
+
// sent `searchText`, which CassavaBase and the Test Server both silently
|
|
232
|
+
// ignore. Filter the in-context rows here so the agent gets a useful
|
|
233
|
+
// narrowing; the dataset (if any) still carries the full upstream set so
|
|
234
|
+
// a follow-up `brapi_manage_dataset` call can re-query without losing
|
|
235
|
+
// rows. Distributions come from the un-filtered fullRows so the agent can
|
|
236
|
+
// still see the real spread of crops / genus / etc.
|
|
237
|
+
let inContextRows = firstPage.rows;
|
|
238
|
+
const text = input.text;
|
|
239
|
+
if (text) {
|
|
240
|
+
const matched = firstPage.rows.filter((row) => rowMatchesText(row, text));
|
|
241
|
+
if (firstPage.rows.length > 0 && matched.length === 0) {
|
|
242
|
+
warnings.push(`Free-text '${text}' matched 0 of ${firstPage.rows.length} returned rows. Combine with \`crops\` / \`genus\` / \`accessionNumbers\` to narrow the upstream pull first, or check spelling.`);
|
|
243
|
+
}
|
|
244
|
+
else if (matched.length < firstPage.rows.length) {
|
|
245
|
+
warnings.push(`Free-text '${text}' narrowed in-context view to ${matched.length} of ${firstPage.rows.length} returned rows. ${datasetMeta ? 'Full set retained in the dataset for follow-up.' : 'No dataset spillover — un-matched rows are not retained.'}`);
|
|
246
|
+
}
|
|
247
|
+
inContextRows = matched;
|
|
224
248
|
}
|
|
225
249
|
const result = {
|
|
226
250
|
alias: connection.alias,
|
|
227
|
-
results:
|
|
228
|
-
returnedCount:
|
|
251
|
+
results: inContextRows,
|
|
252
|
+
returnedCount: inContextRows.length,
|
|
229
253
|
totalCount,
|
|
230
254
|
hasMore: firstPage.hasMore,
|
|
231
255
|
distributions,
|
|
@@ -322,23 +346,21 @@ export const brapiFindGermplasm = tool('brapi_find_germplasm', {
|
|
|
322
346
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
323
347
|
},
|
|
324
348
|
});
|
|
325
|
-
function
|
|
349
|
+
function rowMatchesText(row, text) {
|
|
326
350
|
const needle = text.toLowerCase();
|
|
327
351
|
const containsNeedle = (value) => typeof value === 'string' && value.toLowerCase().includes(needle);
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
return true;
|
|
341
|
-
}
|
|
352
|
+
if (containsNeedle(row.germplasmName) ||
|
|
353
|
+
containsNeedle(row.germplasmPUI) ||
|
|
354
|
+
containsNeedle(row.accessionNumber) ||
|
|
355
|
+
containsNeedle(row.defaultDisplayName)) {
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
if (Array.isArray(row.synonyms)) {
|
|
359
|
+
for (const entry of row.synonyms) {
|
|
360
|
+
if (entry &&
|
|
361
|
+
typeof entry === 'object' &&
|
|
362
|
+
containsNeedle(entry.synonym)) {
|
|
363
|
+
return true;
|
|
342
364
|
}
|
|
343
365
|
}
|
|
344
366
|
}
|