@cyanheads/gbif-biodiversity-mcp-server 0.5.5 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +29 -17
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/mcp-server/resources/definitions/gbif-dataset.resource.js +1 -1
  6. package/dist/mcp-server/resources/definitions/gbif-dataset.resource.js.map +1 -1
  7. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.d.ts +22 -1
  8. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.d.ts.map +1 -1
  9. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.js +57 -6
  10. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.js.map +1 -1
  11. package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.js +8 -2
  13. package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.d.ts +8 -0
  15. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.js +56 -8
  17. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.d.ts +21 -0
  19. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.js +50 -8
  21. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.js +12 -1
  24. package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.d.ts +24 -1
  26. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.js +92 -21
  28. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/utils.d.ts +78 -10
  30. package/dist/mcp-server/tools/utils.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/utils.js +97 -10
  32. package/dist/mcp-server/tools/utils.js.map +1 -1
  33. package/dist/services/gbif/gbif-service.d.ts +40 -1
  34. package/dist/services/gbif/gbif-service.d.ts.map +1 -1
  35. package/dist/services/gbif/gbif-service.js +57 -5
  36. package/dist/services/gbif/gbif-service.js.map +1 -1
  37. package/dist/services/gbif/types.d.ts +24 -1
  38. package/dist/services/gbif/types.d.ts.map +1 -1
  39. package/dist/services/gbif/types.js +27 -1
  40. package/dist/services/gbif/types.js.map +1 -1
  41. package/package.json +1 -1
  42. 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.5.5
4
+ **Version:** 0.6.1
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
- [![Version](https://img.shields.io/badge/Version-0.5.5-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/gbif-biodiversity-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.30.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/gbif-biodiversity-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/gbif-biodiversity-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.6.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/gbif-biodiversity-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.30.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/gbif-biodiversity-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/gbif-biodiversity-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](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, and more |
38
+ | `gbif_search_occurrences` | Search 3.9B+ GBIF occurrence records with Darwin Core filters — country, publishing country, state/province, 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 |
@@ -115,14 +115,19 @@ List direct children of a backbone taxon.
115
115
 
116
116
  ### `gbif_search_occurrences`
117
117
 
118
- Search 2.4B+ GBIF occurrence records with full Darwin Core filtering.
118
+ Search 3.9B+ GBIF occurrence records with full Darwin Core filtering.
119
119
 
120
120
  - Use `taxonKey` from `gbif_match_species` for reliable results — resolves synonyms automatically; `scientificName` filter does not
121
- - Geographic filters: `country` (ISO 3166-1 alpha-2), bounding box (`decimalLatitude`/`decimalLongitude` ranges as "min,max"), or WKT polygon (`geometry`)
121
+ - Geographic filters: `country` (ISO 3166-1 alpha-2), `stateProvince`, bounding box (`decimalLatitude`/`decimalLongitude` ranges as "min,max"), or WKT polygon (`geometry`)
122
+ - `publishingCountry` (ISO 3166-1 alpha-2, uppercase) is the country of the *publishing organization*, not of the observation — a different question from `country`, and the two disagree on most records: of 60,290,950 records observed in GB, 1,548,928 were published by US organizations
123
+ - `stateProvince` is matched verbatim — exact and case-sensitive, with no controlled vocabulary behind it. Take a value from a `STATE_PROVINCE` facet rather than guessing; an unmatched value returns zero records instead of an error, and the enrichment notice says so when it happens
122
124
  - Temporal filters: `year` as single year or range, `month` (1–12) for seasonal queries
123
125
  - `basisOfRecord` enum: `HUMAN_OBSERVATION`, `PRESERVED_SPECIMEN`, `MACHINE_OBSERVATION`, and more
124
126
  - `hasCoordinate` to require or exclude georeferenced records
125
- - Pagination capped at offset+limit = 100,001, the deepest page GBIF serves — use `gbif_occurrence_facets` for aggregate analysis beyond this
127
+ - `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
128
+ - `iucnRedListCategory` — `CR`, `EN`, `VU`, `NT`, `LC`, `DD`, `EX`, `EW`, `CD`
129
+ - Output per record adds `taxonomicStatus`, `eventTime` (with UTC offset), `occurrenceStatus`, and `iucnRedListCategory`
130
+ - Pagination capped at offset+limit = 100,001, the deepest page GBIF serves. The API has no cursor or scroll, so a larger result set is covered by partitioning it — facet by `DATASET_KEY` with `gbif_occurrence_facets`, then search each `datasetKey` on its own. Retrieving a set in one piece is not something this server can do: that needs GBIF's Download API with a GBIF.org account, or GBIF's monthly snapshot on AWS Open Data
126
131
 
127
132
  ---
128
133
 
@@ -130,9 +135,10 @@ Search 2.4B+ GBIF occurrence records with full Darwin Core filtering.
130
135
 
131
136
  Count occurrences matching a filter without fetching any records.
132
137
 
133
- - Backed by the lightweight `/occurrence/count` endpoint — fast single-number response
134
- - Supported filters: `taxonKey`, `country`, `isGeoreferenced`, `datasetKey`, `year`
135
- - Use to assess result set size before deciding whether to paginate a full search
138
+ - 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
139
+ - Supported filters: `taxonKey`, `country`, `publishingCountry`, `stateProvince`, `isGeoreferenced`, `datasetKey`, `year`, `occurrenceStatus`, `iucnRedListCategory`
140
+ - 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
141
+ - Use to assess result set size before deciding whether to paginate a full search. A count above 100,001 means paging cannot reach the end of it, and the enrichment notice says so and names the partition route
136
142
 
137
143
  ---
138
144
 
@@ -141,7 +147,9 @@ Count occurrences matching a filter without fetching any records.
141
147
  Fetch a single occurrence record by GBIF occurrence key.
142
148
 
143
149
  - Complete Darwin Core record — all coordinate fields, administrative geography (continent, country, state/province, locality), dates
144
- - `occurrenceID`, full classification (`class`/`classKey`), GADM administrative units (levels 0–2, each with a stable GID and name), and source `identifiers`
150
+ - `occurrenceID`, full classification (`class`/`classKey`), GADM administrative units (levels 0–3, each with a stable GID and name), and source `identifiers`
151
+ - `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
152
+ - `taxonomicStatus`, `eventTime` (with UTC offset), and `iucnRedListCategory`
145
153
  - Collections metadata: institution code, collection code, catalog number
146
154
  - Collector and identifier names, individual count, sex, life stage
147
155
  - Associated media (images, audio, video) with URLs and license
@@ -153,9 +161,12 @@ Fetch a single occurrence record by GBIF occurrence key.
153
161
 
154
162
  Aggregate occurrence counts across a dimension.
155
163
 
156
- - 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`
157
- - Scope with `taxonKey`, `country`, `year`, `geometry`, or `basisOfRecord` filters
164
+ - 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`
165
+ - Scope with `taxonKey`, `country`, `publishingCountry`, `stateProvince`, `year`, `geometry`, `basisOfRecord`, `datasetKey`, `occurrenceStatus`, or `iucnRedListCategory` filters — so a `PUBLISHING_COUNTRY` or `STATE_PROVINCE` bucket can be passed straight back to drill into it
166
+ - 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`
158
167
  - 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
168
+ - `DATASET_KEY` is the basis for splitting a result set too large for `gbif_search_occurrences` to page: every occurrence carries exactly one `datasetKey`, so its buckets sum to the scope's full total, and it has the cardinality to cut a large scope into pageable pieces. `BASIS_OF_RECORD` and `PUBLISHING_COUNTRY` are gap-free too and both have a matching filter on the occurrence tools, so either can drive a further split of a bucket still over the cap — but on that scope they return 9 and 41 buckets against `DATASET_KEY`'s 550, too coarse for the first cut. A dimension a record can lack drops that record: a 60,290,950-record scope faceted by `YEAR` sums to 59,407,400, leaving 883,550 undated records out, and `MONTH`, `STATE_PROVINCE`, and `SPECIES_KEY` behave the same way — `STATE_PROVINCE` included, even though the occurrence tools can filter on it
169
+ - The scope filters here are narrower than `gbif_search_occurrences` accepts — no `scientificName`, `month`, bounding box, `hasCoordinate`, `isInCluster`, or `coordinateUncertaintyInMeters`. Buckets sum to a search's total only when both calls carry the same filters; re-apply the rest on each per-`datasetKey` search
159
170
  - 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
160
171
  - Core tool for distribution analysis ("which countries have the most records?") and trend queries ("how has observation volume changed since 2010?")
161
172
 
@@ -166,7 +177,8 @@ Aggregate occurrence counts across a dimension.
166
177
  Search GBIF datasets by keyword, type, country, or publishing organization.
167
178
 
168
179
  - Filters: free-text query, dataset type (`OCCURRENCE`, `CHECKLIST`, `METADATA`, `SAMPLING_EVENT`), publishing country, hosting organization UUID
169
- - Returns title, type, description, license, DOI, and record count. The `description` is a 300-character preview — `descriptionTruncated` flags when it was shortened, and `gbif_get_dataset` returns the full text
180
+ - 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
181
+ - The `description` is a 300-character preview — `descriptionTruncated` flags when it was shortened, and `gbif_get_dataset` returns the full text
170
182
  - Use `hostingOrg` from `gbif_search_publishers` to scope to datasets from one organization
171
183
  - Paginated — limit up to 1000
172
184
 
@@ -179,7 +191,7 @@ Fetch full dataset metadata by UUID.
179
191
  - Full description, citation text (for academic reference), license, DOI
180
192
  - Contacts with role, name, organization, and email
181
193
  - Temporal and geographic coverage ranges when the publisher declares them
182
- - `recordCount` for `OCCURRENCE` datasets — the indexed occurrence total, matching what `gbif_search_datasets` reports; absent for other dataset types
194
+ - `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
183
195
  - `numConstituents` for aggregate datasets (e.g. iNaturalist, eBird)
184
196
  - Use after `gbif_search_datasets` or when an occurrence record's `datasetKey` needs provenance detail
185
197
 
@@ -215,7 +227,7 @@ GBIF-specific:
215
227
 
216
228
  - Full GBIF REST API v1 coverage: species taxonomy, occurrences, datasets, and publishers
217
229
  - `gbif_match_species` as the entry point — resolves synonyms to backbone taxon keys used throughout
218
- - Occurrence pagination guarded at GBIF's own offset+limit = 100,001 boundary — an over-cap request fails locally with a `notice` redirecting to facet aggregation, instead of spending the retry budget on a deterministic upstream rejection
230
+ - Occurrence pagination guarded at GBIF's own offset+limit = 100,001 boundary — an over-cap request fails locally with a recovery hint naming the `DATASET_KEY` partition technique, instead of spending the retry budget on a deterministic upstream rejection, and a match larger than the cap says so on the first page rather than after hundreds of them
219
231
  - WKT polygon geometry support for geographic occurrence queries
220
232
  - Darwin Core field mapping with explicit provenance on sparse upstream fields
221
233
 
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, 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. Occurrence paging caps at offset+limit=100,001 — switch to gbif_occurrence_facets for larger aggregate analysis.',
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. On the occurrence tools country is where the record was observed and publishingCountry is the country of the organization that published it — different questions that disagree on most records, so pick deliberately; stateProvince is matched verbatim, exactly and case-sensitively, and an unrecognized value returns zero records rather than an error, so take one from a STATE_PROVINCE facet instead of guessing a spelling. 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 and GBIF exposes no cursor or scroll, so a larger result set is reached only by partitioning it: gbif_occurrence_facets with facet DATASET_KEY splits a scope into buckets that sum to its full total, since every occurrence carries exactly one datasetKey, and each bucket is then searchable on its own; a facet on a dimension a record can lack — YEAR, MONTH, STATE_PROVINCE — leaves those records in no bucket, stateProvince included even though the occurrence tools can filter on it, while BASIS_OF_RECORD and PUBLISHING_COUNTRY are gap-free and both have a matching search filter, making either a sound second cut on a bucket still over the cap though too coarse for the first. Bucket sums reconcile only against the same occurrenceStatus, and only when the facet call repeats the search filters — gbif_occurrence_facets accepts a narrower set than gbif_search_occurrences and gbif_count_occurrences, so re-apply whatever it cannot take on each per-datasetKey search. This server cannot retrieve a result set in bulk — the GBIF Download API needs a GBIF.org account and returns an archive asynchronously, and the monthly GBIF Parquet snapshot on AWS Open Data is a bulk dataset; both are routes to take outside this server.',
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,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,YAAY;AACZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAC;AACtG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B,EAAE,MAAM,4DAA4D,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,8BAA8B;IACrC,YAAY,EACV,43FAA43F;IAC93F,KAAK,EAAE;QACL,gBAAgB;QAChB,oBAAoB;QACpB,cAAc;QACd,iBAAiB;QACjB,4BAA4B;QAC5B,sBAAsB;QACtB,qBAAqB;QACrB,oBAAoB;QACpB,iBAAiB;QACjB,oBAAoB;QACpB,kBAAkB;QAClB,cAAc;QACd,oBAAoB;KACrB;IACD,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. Fetched separately for OCCURRENCE datasets because the detail endpoint omits it; absent for other dataset types and when that lookup does not return in time.'),
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;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,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAA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,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"}
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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AAqB,EAAE;oBAC7E,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,WAAW,MAAM,CAAC,UAAU,qBAAqB,EAAE;gBAC7E,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;aAChC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,KAAK,EAAE,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"}
@@ -7,9 +7,27 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
7
  export declare const gbifCountOccurrences: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
8
  taxonKey: z.ZodOptional<z.ZodNumber>;
9
9
  country: z.ZodOptional<z.ZodString>;
10
+ publishingCountry: z.ZodOptional<z.ZodString>;
11
+ stateProvince: z.ZodOptional<z.ZodString>;
10
12
  isGeoreferenced: z.ZodOptional<z.ZodBoolean>;
11
13
  datasetKey: z.ZodOptional<z.ZodString>;
12
14
  year: z.ZodOptional<z.ZodString>;
15
+ occurrenceStatus: z.ZodDefault<z.ZodEnum<{
16
+ ABSENT: "ABSENT";
17
+ ANY: "ANY";
18
+ PRESENT: "PRESENT";
19
+ }>>;
20
+ iucnRedListCategory: z.ZodOptional<z.ZodEnum<{
21
+ CD: "CD";
22
+ CR: "CR";
23
+ DD: "DD";
24
+ EN: "EN";
25
+ EW: "EW";
26
+ EX: "EX";
27
+ LC: "LC";
28
+ NT: "NT";
29
+ VU: "VU";
30
+ }>>;
13
31
  }, z.core.$strip>, z.ZodObject<{
14
32
  count: z.ZodNumber;
15
33
  }, z.core.$strip>, readonly [{
@@ -17,5 +35,8 @@ export declare const gbifCountOccurrences: import("@cyanheads/mcp-ts-core").Tool
17
35
  readonly code: JsonRpcErrorCode.InvalidParams;
18
36
  readonly when: "datasetKey is not a UUID, or GBIF rejected another filter value as malformed.";
19
37
  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
- }], undefined>;
38
+ }], {
39
+ readonly occurrenceStatus: z.ZodString;
40
+ readonly notice: z.ZodOptional<z.ZodString>;
41
+ }>;
21
42
  //# 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;AAIjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;cA0E/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;AAUjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8I/B,CAAC"}
@@ -5,19 +5,38 @@
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 { isGbifUuid } from '../utils.js';
8
+ import { IUCN_RED_LIST_CATEGORY_VALUES, OCCURRENCE_STATUS_VALUES } from '../../../services/gbif/types.js';
9
+ import { isGbifUuid, occurrenceStatusNotice, overPaginationCapNotice, stateProvinceNoMatchNotice, } 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, and year.',
14
+ 'to paginate a full search. Accepts taxonKey, country, publishingCountry, stateProvince, ' +
15
+ 'isGeoreferenced, datasetKey, year, ' +
16
+ 'occurrenceStatus, and iucnRedListCategory. Counts sightings only by default, matching ' +
17
+ 'gbif_search_occurrences — GBIF also indexes absence records, and for some taxa they are ' +
18
+ 'the overwhelming majority. A count above 100,001 is the signal to partition rather than ' +
19
+ 'page: gbif_search_occurrences cannot reach past that offset, so split the query by ' +
20
+ 'DATASET_KEY via gbif_occurrence_facets and search each dataset separately.',
14
21
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
15
22
  input: z.object({
16
23
  taxonKey: z
17
24
  .number()
18
25
  .optional()
19
26
  .describe('GBIF backbone taxon key from gbif_match_species. Matches the given taxon and all descendant taxa (subspecies, varieties, etc.).'),
20
- country: z.string().optional().describe('ISO 3166-1 alpha-2 country code (e.g., "GB", "US").'),
27
+ country: z
28
+ .string()
29
+ .optional()
30
+ .describe('ISO 3166-1 alpha-2 code of where the occurrence was recorded (e.g., "GB", "US"). Not the publisher\'s country — that is publishingCountry, and the two disagree on most records.'),
31
+ publishingCountry: z
32
+ .string()
33
+ .regex(/^[A-Z]{2}$/)
34
+ .optional()
35
+ .describe('ISO 3166-1 alpha-2 code, uppercase, of the organization that published the record — not where the occurrence was observed, which is country. The two differ constantly: of 60,290,950 records observed in GB, 1,548,928 were published by US organizations. Take a value from a PUBLISHING_COUNTRY facet on gbif_occurrence_facets. Lowercase and alpha-3 forms ("us", "USA") match nothing upstream, which is why only the uppercase two-letter form is accepted here.'),
36
+ stateProvince: z
37
+ .string()
38
+ .optional()
39
+ .describe('State, province, or first-level administrative division, matched as a verbatim string — exact and case-sensitive. GBIF stores what each dataset recorded without normalizing it, so there is no vocabulary to guess from: "England", "England - Greater London", and "Greater London" are three distinct values, and "england" is none of them. Take one from a STATE_PROVINCE facet on gbif_occurrence_facets scoped the same way and pass it back unchanged — an unmatched value counts zero rather than erroring.'),
21
40
  isGeoreferenced: z
22
41
  .boolean()
23
42
  .optional()
@@ -25,15 +44,33 @@ export const gbifCountOccurrences = tool('gbif_count_occurrences', {
25
44
  datasetKey: z
26
45
  .string()
27
46
  .optional()
28
- .describe('Filter to a specific dataset UUID (8-4-4-4-12 hex) from gbif_search_datasets.'),
47
+ .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
48
  year: z
30
49
  .string()
31
50
  .optional()
32
51
  .describe('Year or year range (e.g., "2024" or "2020,2024"). Both endpoints inclusive.'),
52
+ occurrenceStatus: z
53
+ .enum(OCCURRENCE_STATUS_VALUES)
54
+ .default('PRESENT')
55
+ .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."),
56
+ iucnRedListCategory: z
57
+ .enum(IUCN_RED_LIST_CATEGORY_VALUES)
58
+ .optional()
59
+ .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
60
  }),
34
61
  output: z.object({
35
62
  count: z.number().describe('Total occurrences matching the supplied filters.'),
36
63
  }),
64
+ // States which presence/absence filter produced the count — reaches both surfaces.
65
+ enrichment: {
66
+ occurrenceStatus: z
67
+ .string()
68
+ .describe('The presence/absence filter applied upstream — PRESENT, ABSENT, or ANY when no filter was sent. Says what the count covers.'),
69
+ notice: z
70
+ .string()
71
+ .optional()
72
+ .describe('Guidance when the count is zero under a verbatim stateProvince filter, larger than gbif_search_occurrences can page to, or narrowed by a presence/absence filter. Absent when none applies.'),
73
+ },
37
74
  errors: [
38
75
  {
39
76
  reason: 'invalid_filter',
@@ -47,18 +84,32 @@ export const gbifCountOccurrences = tool('gbif_count_occurrences', {
47
84
  taxonKey: input.taxonKey,
48
85
  country: input.country,
49
86
  });
50
- // GBIF's count endpoint answers 200 with a count of 0 for a malformed dataset
51
- // key, so an unchecked typo returns a confident wrong number rather than an error.
87
+ // Rejected locally so a typo fails with this tool's recovery hint instead of a
88
+ // bare upstream 400 that costs a round trip and the retry budget.
52
89
  if (input.datasetKey?.trim() && !isGbifUuid(input.datasetKey)) {
53
90
  throw ctx.fail('invalid_filter', `datasetKey "${input.datasetKey}" is not a GBIF dataset UUID.`, { ...ctx.recoveryFor('invalid_filter') });
54
91
  }
55
92
  const count = await getGbifService().countOccurrences({
56
93
  ...(input.taxonKey !== undefined && { taxonKey: input.taxonKey }),
57
94
  ...(input.country?.trim() && { country: input.country }),
95
+ ...(input.publishingCountry && { publishingCountry: input.publishingCountry }),
96
+ ...(input.stateProvince?.trim() && { stateProvince: input.stateProvince }),
58
97
  ...(input.isGeoreferenced !== undefined && { isGeoreferenced: input.isGeoreferenced }),
59
98
  ...(input.datasetKey?.trim() && { datasetKey: input.datasetKey }),
60
99
  ...(input.year?.trim() && { year: input.year }),
100
+ ...(input.occurrenceStatus !== 'ANY' && { occurrenceStatus: input.occurrenceStatus }),
101
+ ...(input.iucnRedListCategory && { iucnRedListCategory: input.iucnRedListCategory }),
61
102
  }, ctx);
103
+ ctx.enrich({ occurrenceStatus: input.occurrenceStatus });
104
+ const notice = [
105
+ stateProvinceNoMatchNotice(input.stateProvince, count),
106
+ overPaginationCapNotice(count),
107
+ occurrenceStatusNotice(input.occurrenceStatus),
108
+ ]
109
+ .filter(Boolean)
110
+ .join(' ');
111
+ if (notice)
112
+ ctx.enrich.notice(notice);
62
113
  return { count };
63
114
  },
64
115
  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;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,wBAAwB,EAAE;IACjE,KAAK,EAAE,mBAAmB;IAC1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AU,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9D,MAAM,GAAG,CAAC,IAAI,CACZ,gBAAgB,EAChB,eAAe,KAAK,CAAC,UAAU,+BAA+B,EAC9D,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,CACzC,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,cAAc,EAAE,CAAC,gBAAgB,CACnD;YACE,GAAG,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;YACjE,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YACxD,GAAG,CAAC,KAAK,CAAC,eAAe,KAAK,SAAS,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE,CAAC;YACtF,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;YACjE,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;SAChD,EACD,GAAG,CACJ,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;CACtF,CAAC,CAAC"}
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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AA0B,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;YACtD,uBAAuB,CAAC,KAAK,CAAC;YAC9B,sBAAsB,CAAC,KAAK,CAAC,gBAAgB,CAAC;SAC/C;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,IAAI,MAAM;YAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEtC,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;CACtF,CAAC,CAAC"}
@@ -1 +1 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmNzB,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. Fetched separately for OCCURRENCE datasets because the detail endpoint omits it; absent for other dataset types and when that lookup does not return in time.'),
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,OAA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C,CAAC,EAAE,CAAC;gBAC/C,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,WAAW,GAAG,SAAS,EAAE,CAAC,CAAC;gBACnD,IAAI,CAAC,CAAC,YAAY;oBAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;gBACpE,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM;oBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -22,6 +22,7 @@ export declare const gbifGetOccurrence: import("@cyanheads/mcp-ts-core").ToolDef
22
22
  genus: z.ZodOptional<z.ZodString>;
23
23
  species: z.ZodOptional<z.ZodString>;
24
24
  taxonRank: z.ZodOptional<z.ZodString>;
25
+ taxonomicStatus: z.ZodOptional<z.ZodString>;
25
26
  decimalLatitude: z.ZodOptional<z.ZodNumber>;
26
27
  decimalLongitude: z.ZodOptional<z.ZodNumber>;
27
28
  coordinateUncertaintyInMeters: z.ZodOptional<z.ZodNumber>;
@@ -43,13 +44,20 @@ export declare const gbifGetOccurrence: import("@cyanheads/mcp-ts-core").ToolDef
43
44
  gid: z.ZodOptional<z.ZodString>;
44
45
  name: z.ZodOptional<z.ZodString>;
45
46
  }, z.core.$strip>>;
47
+ level3: z.ZodOptional<z.ZodObject<{
48
+ gid: z.ZodOptional<z.ZodString>;
49
+ name: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>>;
46
51
  }, z.core.$strip>>;
47
52
  publishingCountry: z.ZodOptional<z.ZodString>;
48
53
  eventDate: z.ZodOptional<z.ZodString>;
54
+ eventTime: z.ZodOptional<z.ZodString>;
49
55
  year: z.ZodOptional<z.ZodNumber>;
50
56
  month: z.ZodOptional<z.ZodNumber>;
51
57
  day: z.ZodOptional<z.ZodNumber>;
52
58
  basisOfRecord: z.ZodOptional<z.ZodString>;
59
+ occurrenceStatus: z.ZodOptional<z.ZodString>;
60
+ iucnRedListCategory: z.ZodOptional<z.ZodString>;
53
61
  institutionCode: z.ZodOptional<z.ZodString>;
54
62
  collectionCode: z.ZodOptional<z.ZodString>;
55
63
  catalogNumber: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"gbif-get-occurrence.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-get-occurrence.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AA8B3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkT5B,CAAC"}
1
+ {"version":3,"file":"gbif-get-occurrence.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-get-occurrence.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAoC3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmW5B,CAAC"}