@cyanheads/gbif-biodiversity-mcp-server 0.5.4 → 0.6.0
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 +1 -1
- package/README.md +24 -15
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/gbif-dataset.resource.js +1 -1
- package/dist/mcp-server/resources/definitions/gbif-dataset.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/gbif-species.resource.d.ts +5 -0
- package/dist/mcp-server/resources/definitions/gbif-species.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/gbif-species.resource.js +6 -0
- package/dist/mcp-server/resources/definitions/gbif-species.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-bulk-match-species.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/gbif-bulk-match-species.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-bulk-match-species.tool.js +33 -6
- package/dist/mcp-server/tools/definitions/gbif-bulk-match-species.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.d.ts +20 -1
- package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.js +33 -5
- package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.js +8 -2
- package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.d.ts +13 -0
- package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.js +62 -8
- package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.js +21 -4
- package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.js +17 -0
- package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-species.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/gbif-get-species.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-get-species.tool.js +6 -0
- package/dist/mcp-server/tools/definitions/gbif-get-species.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-match-species.tool.d.ts +4 -1
- package/dist/mcp-server/tools/definitions/gbif-match-species.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-match-species.tool.js +40 -5
- package/dist/mcp-server/tools/definitions/gbif-match-species.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.d.ts +19 -0
- package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.js +46 -10
- package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.js +12 -1
- package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.d.ts +21 -0
- package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.js +66 -6
- package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.js +9 -0
- package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-species.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/gbif-search-species.tool.js +4 -1
- package/dist/mcp-server/tools/definitions/gbif-search-species.tool.js.map +1 -1
- package/dist/mcp-server/tools/utils.d.ts +28 -10
- package/dist/mcp-server/tools/utils.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils.js +34 -10
- package/dist/mcp-server/tools/utils.js.map +1 -1
- package/dist/services/gbif/gbif-service.d.ts +34 -1
- package/dist/services/gbif/gbif-service.d.ts.map +1 -1
- package/dist/services/gbif/gbif-service.js +45 -5
- package/dist/services/gbif/gbif-service.js.map +1 -1
- package/dist/services/gbif/types.d.ts +31 -2
- package/dist/services/gbif/types.d.ts.map +1 -1
- package/dist/services/gbif/types.js +27 -1
- package/dist/services/gbif/types.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** @cyanheads/gbif-biodiversity-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
4
|
+
**Version:** 0.6.0
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/gbif-biodiversity-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/gbif-biodiversity-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
| `gbif_search_species` | Search or browse the GBIF backbone taxonomy by name fragment, rank, kingdom, family, or genus |
|
|
36
36
|
| `gbif_get_species_classification` | Return the root-to-parent classification chain for a taxon — root-first ordered array from kingdom to the queried taxon's immediate parent (the taxon itself is not included) |
|
|
37
37
|
| `gbif_get_species_children` | List direct children of a backbone taxon — genera within a family, species within a genus |
|
|
38
|
-
| `gbif_search_occurrences` | Search 2.4B+ GBIF occurrence records with Darwin Core filters — country, bounding box, WKT geometry, year, month, basis of record |
|
|
39
|
-
| `gbif_count_occurrences` | Count occurrences matching a filter without fetching records — fast single-number response |
|
|
40
|
-
| `gbif_get_occurrence` | Fetch a single occurrence record by key — full Darwin Core record with GADM geography, media, and quality flags |
|
|
41
|
-
| `gbif_occurrence_facets` | Aggregate occurrence counts by a dimension — country, year, basis of record, dataset, kingdom,
|
|
38
|
+
| `gbif_search_occurrences` | Search 2.4B+ GBIF occurrence records with Darwin Core filters — country, bounding box, WKT geometry, year, month, basis of record, presence/absence, IUCN Red List category |
|
|
39
|
+
| `gbif_count_occurrences` | Count occurrences matching a filter without fetching records — fast single-number response, filtered to sightings by default |
|
|
40
|
+
| `gbif_get_occurrence` | Fetch a single occurrence record by key — full Darwin Core record with GADM geography, presence/absence status, conservation status, media, and quality flags |
|
|
41
|
+
| `gbif_occurrence_facets` | Aggregate occurrence counts by a dimension — country, year, basis of record, dataset, kingdom, presence/absence, IUCN Red List category |
|
|
42
42
|
| `gbif_search_datasets` | Search GBIF datasets by keyword, type, country, or publishing organization |
|
|
43
43
|
| `gbif_get_dataset` | Fetch full dataset metadata by UUID — title, description, citation, contacts, license, DOI, coverage |
|
|
44
44
|
| `gbif_search_publishers` | Search GBIF-registered publishing organizations by name fragment or country |
|
|
@@ -52,7 +52,7 @@ Match a scientific or common name against the GBIF backbone taxonomy.
|
|
|
52
52
|
- Confidence score 0–100; below 80 warrants review
|
|
53
53
|
- Full classification hierarchy with keys at each rank: kingdom, phylum, class, order, family, genus, species
|
|
54
54
|
- `matchType NONE` indicates no usable match — try removing strict mode or broadening the name
|
|
55
|
-
- Resolves synonyms: always returns the accepted backbone key regardless of which name form was queried
|
|
55
|
+
- Resolves synonyms: always returns the accepted backbone key regardless of which name form was queried; `matchedTaxonKey` carries the synonym's own key when the two differ
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
@@ -62,7 +62,8 @@ Match up to 50 scientific names against the GBIF backbone taxonomy in a single c
|
|
|
62
62
|
|
|
63
63
|
- The batch counterpart to `gbif_match_species` — built for checklist, inventory, and species-list workflows that would otherwise need one round trip per name
|
|
64
64
|
- Returns one result per input name, in input order; each carries `taxonKey`, `matchType`, and confidence
|
|
65
|
-
- Per-name isolation: an unmatched name yields `matchType NONE` and a per-name lookup failure yields `matchType ERROR` — neither sinks the rest of the batch
|
|
65
|
+
- Per-name isolation: an unmatched name yields `matchType NONE` and a per-name lookup failure yields `matchType ERROR` with the message and, when the failure was classified, a `reason` — neither sinks the rest of the batch
|
|
66
|
+
- Same synonym resolution as `gbif_match_species`: `taxonKey` is the accepted taxon, `matchedTaxonKey` the synonym it was queried under
|
|
66
67
|
- `strict: true` requires an exact match for every name; common names are not supported (use `gbif_search_species`)
|
|
67
68
|
|
|
68
69
|
---
|
|
@@ -121,6 +122,9 @@ Search 2.4B+ GBIF occurrence records with full Darwin Core filtering.
|
|
|
121
122
|
- Temporal filters: `year` as single year or range, `month` (1–12) for seasonal queries
|
|
122
123
|
- `basisOfRecord` enum: `HUMAN_OBSERVATION`, `PRESERVED_SPECIMEN`, `MACHINE_OBSERVATION`, and more
|
|
123
124
|
- `hasCoordinate` to require or exclude georeferenced records
|
|
125
|
+
- `occurrenceStatus` — `PRESENT` (default), `ABSENT`, or `ANY`. GBIF indexes absence records (a survey that looked for the taxon and did not find it) alongside sightings; the default excludes them and the enrichment says so on every call
|
|
126
|
+
- `iucnRedListCategory` — `CR`, `EN`, `VU`, `NT`, `LC`, `DD`, `EX`, `EW`, `CD`
|
|
127
|
+
- Output per record adds `taxonomicStatus`, `eventTime` (with UTC offset), `occurrenceStatus`, and `iucnRedListCategory`
|
|
124
128
|
- Pagination capped at offset+limit = 100,001, the deepest page GBIF serves — use `gbif_occurrence_facets` for aggregate analysis beyond this
|
|
125
129
|
|
|
126
130
|
---
|
|
@@ -129,8 +133,9 @@ Search 2.4B+ GBIF occurrence records with full Darwin Core filtering.
|
|
|
129
133
|
|
|
130
134
|
Count occurrences matching a filter without fetching any records.
|
|
131
135
|
|
|
132
|
-
- Backed by the
|
|
133
|
-
- Supported filters: `taxonKey`, `country`, `isGeoreferenced`, `datasetKey`, `year`
|
|
136
|
+
- Backed by `/occurrence/search` at `limit=0` — no record payload, and the same endpoint `gbif_search_occurrences` queries, so the two agree on the same question. GBIF's dedicated `/occurrence/count` endpoint takes a closed parameter set that rejects `occurrenceStatus` and `iucnRedListCategory` outright
|
|
137
|
+
- Supported filters: `taxonKey`, `country`, `isGeoreferenced`, `datasetKey`, `year`, `occurrenceStatus`, `iucnRedListCategory`
|
|
138
|
+
- Counts sightings only by default, matching `gbif_search_occurrences`. For absence-heavy taxa the unfiltered figure is a different question entirely — *Radicipes gracilis* has 2,351,582 indexed records of which 79 are presences
|
|
134
139
|
- Use to assess result set size before deciding whether to paginate a full search
|
|
135
140
|
|
|
136
141
|
---
|
|
@@ -140,7 +145,9 @@ Count occurrences matching a filter without fetching any records.
|
|
|
140
145
|
Fetch a single occurrence record by GBIF occurrence key.
|
|
141
146
|
|
|
142
147
|
- Complete Darwin Core record — all coordinate fields, administrative geography (continent, country, state/province, locality), dates
|
|
143
|
-
- `occurrenceID`, full classification (`class`/`classKey`), GADM administrative units (levels 0–
|
|
148
|
+
- `occurrenceID`, full classification (`class`/`classKey`), GADM administrative units (levels 0–3, each with a stable GID and name), and source `identifiers`
|
|
149
|
+
- `occurrenceStatus` — check it before reading the record as a sighting; `ABSENT` means a survey looked and found nothing, and the record still carries coordinates, a date, and a recorder
|
|
150
|
+
- `taxonomicStatus`, `eventTime` (with UTC offset), and `iucnRedListCategory`
|
|
144
151
|
- Collections metadata: institution code, collection code, catalog number
|
|
145
152
|
- Collector and identifier names, individual count, sex, life stage
|
|
146
153
|
- Associated media (images, audio, video) with URLs and license
|
|
@@ -152,9 +159,10 @@ Fetch a single occurrence record by GBIF occurrence key.
|
|
|
152
159
|
|
|
153
160
|
Aggregate occurrence counts across a dimension.
|
|
154
161
|
|
|
155
|
-
- Facets: `COUNTRY`, `YEAR`, `BASIS_OF_RECORD`, `DATASET_KEY`, `KINGDOM_KEY`, `PHYLUM_KEY`, `CLASS_KEY`, `ORDER_KEY`, `FAMILY_KEY`, `GENUS_KEY`, `SPECIES_KEY`, `PUBLISHING_COUNTRY`, `MONTH`
|
|
156
|
-
- Scope with `taxonKey`, `country`, `year`, `geometry`, or `
|
|
157
|
-
-
|
|
162
|
+
- Facets: `COUNTRY`, `STATE_PROVINCE`, `YEAR`, `BASIS_OF_RECORD`, `DATASET_KEY`, `KINGDOM_KEY`, `PHYLUM_KEY`, `CLASS_KEY`, `ORDER_KEY`, `FAMILY_KEY`, `GENUS_KEY`, `SPECIES_KEY`, `PUBLISHING_COUNTRY`, `MONTH`, `OCCURRENCE_STATUS`, `IUCN_RED_LIST_CATEGORY`
|
|
163
|
+
- Scope with `taxonKey`, `country`, `year`, `geometry`, `basisOfRecord`, `datasetKey`, `occurrenceStatus`, or `iucnRedListCategory` filters
|
|
164
|
+
- Aggregates sightings only by default, matching the search and count tools. To measure the presence/absence split itself, pass `facet: OCCURRENCE_STATUS` with `occurrenceStatus: ANY`
|
|
165
|
+
- Returns one page of values ranked by count descending — up to `facetLimit` (max 100), the top ones only while `facetOffset` is 0 — with no record payloads
|
|
158
166
|
- Page past the first `facetLimit` with `facetOffset` (advance by `facetLimit` per page) to walk high-cardinality facets like `DATASET_KEY`; enrichment echoes the applied `facetOffset` and sets `moreValuesLikely` when a full page suggests more values remain
|
|
159
167
|
- Core tool for distribution analysis ("which countries have the most records?") and trend queries ("how has observation volume changed since 2010?")
|
|
160
168
|
|
|
@@ -165,7 +173,8 @@ Aggregate occurrence counts across a dimension.
|
|
|
165
173
|
Search GBIF datasets by keyword, type, country, or publishing organization.
|
|
166
174
|
|
|
167
175
|
- Filters: free-text query, dataset type (`OCCURRENCE`, `CHECKLIST`, `METADATA`, `SAMPLING_EVENT`), publishing country, hosting organization UUID
|
|
168
|
-
- Returns title, type, description, license, DOI, and record count.
|
|
176
|
+
- Returns title, type, description, license, DOI, and record count. `recordCount` spans every `occurrenceStatus`, absences included — `gbif_count_occurrences` with the same key counts sightings only by default, so the two figures differ by design
|
|
177
|
+
- The `description` is a 300-character preview — `descriptionTruncated` flags when it was shortened, and `gbif_get_dataset` returns the full text
|
|
169
178
|
- Use `hostingOrg` from `gbif_search_publishers` to scope to datasets from one organization
|
|
170
179
|
- Paginated — limit up to 1000
|
|
171
180
|
|
|
@@ -178,7 +187,7 @@ Fetch full dataset metadata by UUID.
|
|
|
178
187
|
- Full description, citation text (for academic reference), license, DOI
|
|
179
188
|
- Contacts with role, name, organization, and email
|
|
180
189
|
- Temporal and geographic coverage ranges when the publisher declares them
|
|
181
|
-
- `recordCount`
|
|
190
|
+
- `recordCount` — the indexed occurrence total, matching what `gbif_search_datasets` reports, for every dataset type (a `CHECKLIST` reports 0). It spans every `occurrenceStatus`, absences included; `gbif_count_occurrences` with the same key counts sightings only by default, so the two figures differ by design
|
|
182
191
|
- `numConstituents` for aggregate datasets (e.g. iNaturalist, eBird)
|
|
183
192
|
- Use after `gbif_search_datasets` or when an occurrence record's `datasetKey` needs provenance detail
|
|
184
193
|
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import { initGbifService } from './services/gbif/gbif-service.js';
|
|
|
28
28
|
await createApp({
|
|
29
29
|
name: 'gbif-biodiversity-mcp-server',
|
|
30
30
|
title: 'gbif-biodiversity-mcp-server',
|
|
31
|
-
instructions: 'Use the gbif_* tools to query species taxonomy, occurrences, datasets, and publishers via the GBIF API. Keyless — these endpoints need no credentials. Resolve any name with gbif_match_species first — it returns the backbone taxonKey the occurrence tools expect and
|
|
31
|
+
instructions: 'Use the gbif_* tools to query species taxonomy, occurrences, datasets, and publishers via the GBIF API. Keyless — these endpoints need no credentials. Resolve any name with gbif_match_species first — it returns the backbone taxonKey the occurrence tools expect, resolving a synonym to its accepted taxon and reporting the matched synonym key alongside as matchedTaxonKey, unlike the raw scientificName filter. Countries use ISO 3166-1 alpha-2; datasets and publishers are keyed by UUID, occurrences by integer key. GBIF indexes absence records — a documented survey that looked for a taxon and did not find it — alongside sightings, so gbif_search_occurrences, gbif_count_occurrences, and gbif_occurrence_facets all default occurrenceStatus to PRESENT and report the applied filter in their enrichment; pass ANY to include absences, or ABSENT for absences alone. For some taxa absences dominate: an unfiltered count can run five orders of magnitude above the sightings it appears to report. The dataset recordCount on gbif_search_datasets, gbif_get_dataset, and the gbif://dataset/{datasetKey} resource is not filtered that way — it spans every occurrenceStatus, so it will exceed a gbif_count_occurrences total for the same datasetKey by design. Occurrence paging caps at offset+limit=100,001 — switch to gbif_occurrence_facets for larger aggregate analysis.',
|
|
32
32
|
tools: [
|
|
33
33
|
gbifMatchSpecies,
|
|
34
34
|
gbifBulkMatchSpecies,
|
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,MA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SAAS,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IACrD,OAAO,EAAE,EAAE;IACX,6EAA6E;IAC7E,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B,KAAK,CAAC,IAAI;QACR,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;QAC9B,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;YACzC,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,SAAS,EAAE,GAAG,CAAC,gBAAgB;YAC/B,SAAS,EAAE,GAAG,CAAC,SAAS;SACzB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -33,7 +33,7 @@ export const gbifDatasetResource = resource('gbif://dataset/{datasetKey}', {
|
|
|
33
33
|
recordCount: z
|
|
34
34
|
.number()
|
|
35
35
|
.optional()
|
|
36
|
-
.describe('Occurrence records GBIF has indexed for this dataset, matching the figure gbif_search_datasets reports.
|
|
36
|
+
.describe('Occurrence records GBIF has indexed for this dataset, matching the figure gbif_search_datasets reports. Spans every occurrenceStatus: absence records — surveys that looked for a taxon and did not find it — are counted alongside sightings, and on some datasets they are the overwhelming majority. gbif_count_occurrences with this datasetKey answers the other question, defaulting to occurrenceStatus PRESENT, so the two figures are expected to differ rather than one being wrong. Fetched separately because the detail endpoint omits it; absent when that lookup does not return in time.'),
|
|
37
37
|
numConstituents: z.number().optional().describe('Number of sub-datasets. May be absent.'),
|
|
38
38
|
contacts: z
|
|
39
39
|
.array(z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-dataset.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gbif-dataset.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3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oC,CAAC;QAClF,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QACrF,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"gbif-dataset.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gbif-dataset.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,UAAU,EACV,eAAe,EACf,yBAAyB,EACzB,SAAS,GACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE;;;GAGG;AACH,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,6BAA6B,EAAE;IACzE,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,gFAAgF;QAChF,uFAAuF;QACvF,0CAA0C;IAC5C,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAClE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACvD,IAAI,EAAE,CAA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,GAAG,CAAC,KAAK;YAChB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;YACrE,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,YAAY,EAAE,GAAG,CAAC,QAAQ,EAAE,IAAI;YAChC,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;YACxC,WAAW,EAAE,MAAM,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC;YACtD,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC;YAC7C,iBAAiB,EAAE,wBAAwB,CAAC,GAAG,CAAC,iBAAiB,CAAC;YAClE,mBAAmB,EAAE,0BAA0B,CAAC,GAAG,CAAC,mBAAmB,CAAC;SACzE,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -29,5 +29,10 @@ export declare const gbifSpeciesResource: import("@cyanheads/mcp-ts-core").Resou
|
|
|
29
29
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
30
30
|
readonly when: "The taxonKey does not exist in the GBIF backbone.";
|
|
31
31
|
readonly recovery: "Use gbif_match_species to resolve a name to a valid backbone key, or gbif_search_species to browse.";
|
|
32
|
+
}, {
|
|
33
|
+
readonly reason: "invalid_filter";
|
|
34
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
35
|
+
readonly when: "GBIF rejected the taxonKey segment as unparseable — a value outside the 32-bit signed integer range.";
|
|
36
|
+
readonly recovery: "Address the resource with a whole backbone taxon key as gbif_match_species or gbif_search_species returns it, rather than a constructed number.";
|
|
32
37
|
}]>;
|
|
33
38
|
//# sourceMappingURL=gbif-species.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-species.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gbif-species.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAA6B,MAAM,+BAA+B,CAAC;AAI5F,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"gbif-species.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gbif-species.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAA6B,MAAM,+BAA+B,CAAC;AAI5F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+F9B,CAAC"}
|
|
@@ -40,6 +40,12 @@ export const gbifSpeciesResource = resource('gbif://species/{taxonKey}', {
|
|
|
40
40
|
when: 'The taxonKey does not exist in the GBIF backbone.',
|
|
41
41
|
recovery: 'Use gbif_match_species to resolve a name to a valid backbone key, or gbif_search_species to browse.',
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
reason: 'invalid_filter',
|
|
45
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
46
|
+
when: 'GBIF rejected the taxonKey segment as unparseable — a value outside the 32-bit signed integer range.',
|
|
47
|
+
recovery: 'Address the resource with a whole backbone taxon key as gbif_match_species or gbif_search_species returns it, rather than a constructed number.',
|
|
48
|
+
},
|
|
43
49
|
],
|
|
44
50
|
async handler(params, ctx) {
|
|
45
51
|
const taxonKey = parseInt(params.taxonKey, 10);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-species.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gbif-species.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,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AAK;YAChB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,GAAG,CAAC,OAAO,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;SAClE,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"gbif-species.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/gbif-species.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,2BAA2B,EAAE;IACvE,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,qFAAqF;QACrF,mEAAmE;IACrE,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;KACtE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAC/D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,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AAE;oBACnF,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;iBAChC,CAAC,CAAC;YACL,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,QAAQ,kCAAkC,EAAE;gBACnF,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;aAChC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,aAAa,EAAE,GAAG,CAAC,aAAa;YAChC,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,GAAG,CAAC,OAAO,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;SAClE,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -10,6 +10,7 @@ export declare const gbifBulkMatchSpecies: import("@cyanheads/mcp-ts-core").Tool
|
|
|
10
10
|
results: z.ZodArray<z.ZodObject<{
|
|
11
11
|
name: z.ZodString;
|
|
12
12
|
taxonKey: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
matchedTaxonKey: z.ZodOptional<z.ZodNumber>;
|
|
13
14
|
scientificName: z.ZodOptional<z.ZodString>;
|
|
14
15
|
canonicalName: z.ZodOptional<z.ZodString>;
|
|
15
16
|
rank: z.ZodOptional<z.ZodString>;
|
|
@@ -17,6 +18,7 @@ export declare const gbifBulkMatchSpecies: import("@cyanheads/mcp-ts-core").Tool
|
|
|
17
18
|
confidence: z.ZodOptional<z.ZodNumber>;
|
|
18
19
|
matchType: z.ZodString;
|
|
19
20
|
error: z.ZodOptional<z.ZodString>;
|
|
21
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
20
22
|
}, z.core.$strip>>;
|
|
21
23
|
}, z.core.$strip>, undefined, undefined>;
|
|
22
24
|
//# sourceMappingURL=gbif-bulk-match-species.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-bulk-match-species.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-bulk-match-species.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"gbif-bulk-match-species.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-bulk-match-species.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAIjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;wCA+J/B,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/gbif-bulk-match-species
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
6
7
|
import { getGbifService } from '../../../services/gbif/gbif-service.js';
|
|
7
8
|
export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
8
9
|
title: 'Bulk Match Species Names',
|
|
@@ -11,9 +12,11 @@ export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
|
11
12
|
'would otherwise need one round trip per name. Each name is matched independently and results ' +
|
|
12
13
|
'are returned in input order, one entry per name. A name with no backbone match yields ' +
|
|
13
14
|
'matchType NONE (no taxonKey) instead of failing the batch; a per-name lookup failure yields ' +
|
|
14
|
-
|
|
15
|
-
'the
|
|
16
|
-
'
|
|
15
|
+
"matchType ERROR carrying that name's error message and, when the failure was classified, " +
|
|
16
|
+
'a machine-readable reason — the rest of the batch is unaffected, and the call as a whole ' +
|
|
17
|
+
'still succeeds. When a queried name is a synonym, taxonKey is the accepted taxon it resolves ' +
|
|
18
|
+
"to and matchedTaxonKey carries the synonym's own key. Common names are not supported — use " +
|
|
19
|
+
'gbif_search_species for vernacular searches. Below confidence 80, review the match.',
|
|
17
20
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
18
21
|
input: z.object({
|
|
19
22
|
names: z
|
|
@@ -34,7 +37,11 @@ export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
|
34
37
|
taxonKey: z
|
|
35
38
|
.number()
|
|
36
39
|
.optional()
|
|
37
|
-
.describe(
|
|
40
|
+
.describe("GBIF backbone taxon key to pass to gbif_search_occurrences, gbif_count_occurrences, and gbif_occurrence_facets — the accepted taxon's key when this name is a synonym, otherwise the matched taxon's own key. Absent when matchType is NONE or ERROR."),
|
|
41
|
+
matchedTaxonKey: z
|
|
42
|
+
.number()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Backbone key of the name that actually matched. Present only when it differs from taxonKey — that is, when a synonym was resolved to its accepted taxon.'),
|
|
38
45
|
scientificName: z
|
|
39
46
|
.string()
|
|
40
47
|
.optional()
|
|
@@ -58,7 +65,11 @@ export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
|
58
65
|
error: z
|
|
59
66
|
.string()
|
|
60
67
|
.optional()
|
|
61
|
-
.describe('Failure
|
|
68
|
+
.describe('Failure message when matchType is ERROR. Absent otherwise.'),
|
|
69
|
+
reason: z
|
|
70
|
+
.string()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe('Machine-readable failure identifier when matchType is ERROR — e.g. invalid_filter when GBIF rejected a supplied value. Absent when the failure carried no classification, and absent on every non-ERROR entry.'),
|
|
62
73
|
})
|
|
63
74
|
.describe('Match outcome for one input name.'))
|
|
64
75
|
.describe('One result per input name, in input order.'),
|
|
@@ -79,9 +90,14 @@ export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
|
79
90
|
if (raw.usageKey == null || raw.matchType == null || raw.matchType === 'NONE') {
|
|
80
91
|
return { name, matchType: 'NONE' };
|
|
81
92
|
}
|
|
93
|
+
// `/species/match` names the accepted taxon only as acceptedUsageKey; resolve
|
|
94
|
+
// so taxonKey is safe to hand to the occurrence tools (see gbif_match_species).
|
|
95
|
+
const matchedTaxonKey = raw.usageKey;
|
|
96
|
+
const taxonKey = raw.acceptedUsageKey ?? matchedTaxonKey;
|
|
82
97
|
return {
|
|
83
98
|
name,
|
|
84
|
-
taxonKey
|
|
99
|
+
taxonKey,
|
|
100
|
+
...(taxonKey !== matchedTaxonKey && { matchedTaxonKey }),
|
|
85
101
|
scientificName: raw.scientificName ?? undefined,
|
|
86
102
|
canonicalName: raw.canonicalName ?? undefined,
|
|
87
103
|
rank: raw.rank ?? undefined,
|
|
@@ -91,10 +107,16 @@ export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
|
91
107
|
};
|
|
92
108
|
}
|
|
93
109
|
catch (err) {
|
|
110
|
+
// The per-name catch is the only place a classified failure can surface for this
|
|
111
|
+
// tool, so carry the thrown reason through rather than flattening to a message.
|
|
112
|
+
const reason = err instanceof McpError && typeof err.data?.reason === 'string'
|
|
113
|
+
? err.data.reason
|
|
114
|
+
: undefined;
|
|
94
115
|
return {
|
|
95
116
|
name,
|
|
96
117
|
matchType: 'ERROR',
|
|
97
118
|
error: err instanceof Error ? err.message : String(err),
|
|
119
|
+
...(reason && { reason }),
|
|
98
120
|
};
|
|
99
121
|
}
|
|
100
122
|
}));
|
|
@@ -110,6 +132,9 @@ export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
|
110
132
|
lines.push(`**Scientific name:** ${r.scientificName}`);
|
|
111
133
|
if (r.taxonKey != null)
|
|
112
134
|
lines.push(`**Taxon key:** ${r.taxonKey}`);
|
|
135
|
+
if (r.matchedTaxonKey != null) {
|
|
136
|
+
lines.push(`**Matched taxon key:** ${r.matchedTaxonKey} — this name is a synonym; the taxon key above is the accepted taxon it resolves to.`);
|
|
137
|
+
}
|
|
113
138
|
if (r.rank)
|
|
114
139
|
lines.push(`**Rank:** ${r.rank}`);
|
|
115
140
|
if (r.status)
|
|
@@ -119,6 +144,8 @@ export const gbifBulkMatchSpecies = tool('gbif_bulk_match_species', {
|
|
|
119
144
|
lines.push(`**Confidence:** ${r.confidence}/100`);
|
|
120
145
|
if (r.error)
|
|
121
146
|
lines.push(`**Error:** ${r.error}`);
|
|
147
|
+
if (r.reason)
|
|
148
|
+
lines.push(`**Reason:** ${r.reason}`);
|
|
122
149
|
}
|
|
123
150
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
124
151
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-bulk-match-species.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-bulk-match-species.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAClE,KAAK,EAAE,0BAA0B;IACjC,WAAW,EACT,wFAAwF;QACxF,8FAA8F;QAC9F,+FAA+F;QAC/F,wFAAwF;QACxF,8FAA8F;QAC9F,
|
|
1
|
+
{"version":3,"file":"gbif-bulk-match-species.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-bulk-match-species.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAClE,KAAK,EAAE,0BAA0B;IACjC,WAAW,EACT,wFAAwF;QACxF,8FAA8F;QAC9F,+FAA+F;QAC/F,wFAAwF;QACxF,8FAA8F;QAC9F,2FAA2F;QAC3F,2FAA2F;QAC3F,+FAA+F;QAC/F,6FAA6F;QAC7F,qFAAqF;IACvF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC,CAAC;aACrF,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,EAAE,CAAC;aACP,QAAQ,CACP,0FAA0F,CAC3F;QACH,MAAM,EAAE,CAAC;aACN,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CACP,yJAAyJ,CAC1J;KACJ,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC;aACP,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,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IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9C,IAAI,CAAC,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;YAC7C,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC;YAC5E,IAAI,CAAC,CAAC,KAAK;gBAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;YACjD,IAAI,CAAC,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -10,6 +10,22 @@ export declare const gbifCountOccurrences: import("@cyanheads/mcp-ts-core").Tool
|
|
|
10
10
|
isGeoreferenced: z.ZodOptional<z.ZodBoolean>;
|
|
11
11
|
datasetKey: z.ZodOptional<z.ZodString>;
|
|
12
12
|
year: z.ZodOptional<z.ZodString>;
|
|
13
|
+
occurrenceStatus: z.ZodDefault<z.ZodEnum<{
|
|
14
|
+
ABSENT: "ABSENT";
|
|
15
|
+
ANY: "ANY";
|
|
16
|
+
PRESENT: "PRESENT";
|
|
17
|
+
}>>;
|
|
18
|
+
iucnRedListCategory: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
CD: "CD";
|
|
20
|
+
CR: "CR";
|
|
21
|
+
DD: "DD";
|
|
22
|
+
EN: "EN";
|
|
23
|
+
EW: "EW";
|
|
24
|
+
EX: "EX";
|
|
25
|
+
LC: "LC";
|
|
26
|
+
NT: "NT";
|
|
27
|
+
VU: "VU";
|
|
28
|
+
}>>;
|
|
13
29
|
}, z.core.$strip>, z.ZodObject<{
|
|
14
30
|
count: z.ZodNumber;
|
|
15
31
|
}, z.core.$strip>, readonly [{
|
|
@@ -17,5 +33,8 @@ export declare const gbifCountOccurrences: import("@cyanheads/mcp-ts-core").Tool
|
|
|
17
33
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
18
34
|
readonly when: "datasetKey is not a UUID, or GBIF rejected another filter value as malformed.";
|
|
19
35
|
readonly recovery: "Supply datasetKey as the 8-4-4-4-12 hex UUID gbif_search_datasets returns; year is a single year or a \"min,max\" range.";
|
|
20
|
-
}],
|
|
36
|
+
}], {
|
|
37
|
+
readonly occurrenceStatus: z.ZodString;
|
|
38
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}>;
|
|
21
40
|
//# sourceMappingURL=gbif-count-occurrences.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-count-occurrences.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-count-occurrences.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"gbif-count-occurrences.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-count-occurrences.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiH/B,CAAC"}
|
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { getGbifService } from '../../../services/gbif/gbif-service.js';
|
|
8
|
-
import {
|
|
8
|
+
import { IUCN_RED_LIST_CATEGORY_VALUES, OCCURRENCE_STATUS_VALUES } from '../../../services/gbif/types.js';
|
|
9
|
+
import { isGbifUuid, occurrenceStatusNotice } from '../utils.js';
|
|
9
10
|
export const gbifCountOccurrences = tool('gbif_count_occurrences', {
|
|
10
11
|
title: 'Count Occurrences',
|
|
11
12
|
description: 'Count occurrences matching a taxon + location filter without fetching records. ' +
|
|
12
13
|
'Use for quick totals ("how many Aves records in Sweden?") or before deciding whether ' +
|
|
13
|
-
'to paginate a full search. Accepts taxonKey, country, isGeoreferenced, datasetKey,
|
|
14
|
+
'to paginate a full search. Accepts taxonKey, country, isGeoreferenced, datasetKey, year, ' +
|
|
15
|
+
'occurrenceStatus, and iucnRedListCategory. Counts sightings only by default, matching ' +
|
|
16
|
+
'gbif_search_occurrences — GBIF also indexes absence records, and for some taxa they are ' +
|
|
17
|
+
'the overwhelming majority.',
|
|
14
18
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
15
19
|
input: z.object({
|
|
16
20
|
taxonKey: z
|
|
@@ -25,15 +29,33 @@ export const gbifCountOccurrences = tool('gbif_count_occurrences', {
|
|
|
25
29
|
datasetKey: z
|
|
26
30
|
.string()
|
|
27
31
|
.optional()
|
|
28
|
-
.describe('Filter to a specific dataset UUID (8-4-4-4-12 hex) from gbif_search_datasets.'),
|
|
32
|
+
.describe('Filter to a specific dataset UUID (8-4-4-4-12 hex) from gbif_search_datasets. The result is not the recordCount the dataset tools and the gbif://dataset/{datasetKey} resource report for the same key: that figure spans every occurrenceStatus, while this count applies occurrenceStatus below, PRESENT by default.'),
|
|
29
33
|
year: z
|
|
30
34
|
.string()
|
|
31
35
|
.optional()
|
|
32
36
|
.describe('Year or year range (e.g., "2024" or "2020,2024"). Both endpoints inclusive.'),
|
|
37
|
+
occurrenceStatus: z
|
|
38
|
+
.enum(OCCURRENCE_STATUS_VALUES)
|
|
39
|
+
.default('PRESENT')
|
|
40
|
+
.describe("Presence/absence filter. Defaults to PRESENT: an ABSENT record documents a survey that looked for the taxon and did not find it, so counting one inflates the total with the opposite of a sighting. Use ANY for both (GBIF's own default), or ABSENT for non-observations alone. Matches the gbif_search_occurrences default, so the two tools agree."),
|
|
41
|
+
iucnRedListCategory: z
|
|
42
|
+
.enum(IUCN_RED_LIST_CATEGORY_VALUES)
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Count only records whose taxon carries this IUCN Red List category: CR Critically Endangered, EN Endangered, VU Vulnerable, NT Near Threatened, LC Least Concern, DD Data Deficient, EX Extinct, EW Extinct in the Wild, CD Conservation Dependent. Records with no category are excluded when this is set.'),
|
|
33
45
|
}),
|
|
34
46
|
output: z.object({
|
|
35
47
|
count: z.number().describe('Total occurrences matching the supplied filters.'),
|
|
36
48
|
}),
|
|
49
|
+
// States which presence/absence filter produced the count — reaches both surfaces.
|
|
50
|
+
enrichment: {
|
|
51
|
+
occurrenceStatus: z
|
|
52
|
+
.string()
|
|
53
|
+
.describe('The presence/absence filter applied upstream — PRESENT, ABSENT, or ANY when no filter was sent. Says what the count covers.'),
|
|
54
|
+
notice: z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Guidance when a presence/absence filter narrowed the count. Absent when occurrenceStatus is ANY.'),
|
|
58
|
+
},
|
|
37
59
|
errors: [
|
|
38
60
|
{
|
|
39
61
|
reason: 'invalid_filter',
|
|
@@ -47,8 +69,8 @@ export const gbifCountOccurrences = tool('gbif_count_occurrences', {
|
|
|
47
69
|
taxonKey: input.taxonKey,
|
|
48
70
|
country: input.country,
|
|
49
71
|
});
|
|
50
|
-
//
|
|
51
|
-
//
|
|
72
|
+
// Rejected locally so a typo fails with this tool's recovery hint instead of a
|
|
73
|
+
// bare upstream 400 that costs a round trip and the retry budget.
|
|
52
74
|
if (input.datasetKey?.trim() && !isGbifUuid(input.datasetKey)) {
|
|
53
75
|
throw ctx.fail('invalid_filter', `datasetKey "${input.datasetKey}" is not a GBIF dataset UUID.`, { ...ctx.recoveryFor('invalid_filter') });
|
|
54
76
|
}
|
|
@@ -58,7 +80,13 @@ export const gbifCountOccurrences = tool('gbif_count_occurrences', {
|
|
|
58
80
|
...(input.isGeoreferenced !== undefined && { isGeoreferenced: input.isGeoreferenced }),
|
|
59
81
|
...(input.datasetKey?.trim() && { datasetKey: input.datasetKey }),
|
|
60
82
|
...(input.year?.trim() && { year: input.year }),
|
|
83
|
+
...(input.occurrenceStatus !== 'ANY' && { occurrenceStatus: input.occurrenceStatus }),
|
|
84
|
+
...(input.iucnRedListCategory && { iucnRedListCategory: input.iucnRedListCategory }),
|
|
61
85
|
}, ctx);
|
|
86
|
+
ctx.enrich({ occurrenceStatus: input.occurrenceStatus });
|
|
87
|
+
const notice = occurrenceStatusNotice(input.occurrenceStatus);
|
|
88
|
+
if (notice)
|
|
89
|
+
ctx.enrich.notice(notice);
|
|
62
90
|
return { count };
|
|
63
91
|
},
|
|
64
92
|
format: (result) => [{ type: 'text', text: `**Occurrence count:** ${result.count}` }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-count-occurrences.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-count-occurrences.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,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"gbif-count-occurrences.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/defin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":"gbif-get-dataset.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-get-dataset.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAY3E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"gbif-get-dataset.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-get-dataset.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAY3E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2NzB,CAAC"}
|
|
@@ -43,7 +43,7 @@ export const gbifGetDataset = tool('gbif_get_dataset', {
|
|
|
43
43
|
recordCount: z
|
|
44
44
|
.number()
|
|
45
45
|
.optional()
|
|
46
|
-
.describe('Occurrence records GBIF has indexed for this dataset, matching the figure gbif_search_datasets reports.
|
|
46
|
+
.describe('Occurrence records GBIF has indexed for this dataset, matching the figure gbif_search_datasets reports. Spans every occurrenceStatus: absence records — surveys that looked for a taxon and did not find it — are counted alongside sightings, and on some datasets they are the overwhelming majority. gbif_count_occurrences with this datasetKey answers the other question, defaulting to occurrenceStatus PRESENT, so the two figures are expected to differ rather than one being wrong. Fetched separately because the detail endpoint omits it; absent when that lookup does not return in time.'),
|
|
47
47
|
numConstituents: z
|
|
48
48
|
.number()
|
|
49
49
|
.optional()
|
|
@@ -168,8 +168,14 @@ export const gbifGetDataset = tool('gbif_get_dataset', {
|
|
|
168
168
|
lines.push(`**DOI:** ${result.doi}`);
|
|
169
169
|
if (result.publishingCountry)
|
|
170
170
|
lines.push(`**Publishing country:** ${result.publishingCountry}`);
|
|
171
|
+
/**
|
|
172
|
+
* The scope qualifier is rendered inline rather than left to the output
|
|
173
|
+
* schema: a `content[]`-only client never reads the field's description, and
|
|
174
|
+
* a bare figure five orders of magnitude above the sightings for the same key
|
|
175
|
+
* is exactly what reads as a data error.
|
|
176
|
+
*/
|
|
171
177
|
if (result.recordCount != null)
|
|
172
|
-
lines.push(`**Records:** ${result.recordCount.toLocaleString()}
|
|
178
|
+
lines.push(`**Records:** ${result.recordCount.toLocaleString()} — every indexed occurrence record, absences included. gbif_count_occurrences with this key counts sightings only by default.`);
|
|
173
179
|
if (result.numConstituents != null)
|
|
174
180
|
lines.push(`**Constituent datasets:** ${result.numConstituents}`);
|
|
175
181
|
if (result.temporalCoverages?.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbif-get-dataset.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-get-dataset.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,UAAU,EACV,eAAe,EACf,yBAAyB,EACzB,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,EAAE;IACrD,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,kGAAkG;QAClG,sHAAsH;QACtH,qEAAqE;QACrE,6GAA6G;IAC/G,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,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