@cyanheads/gbif-biodiversity-mcp-server 0.2.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.
Files changed (82) hide show
  1. package/CLAUDE.md +393 -0
  2. package/Dockerfile +99 -0
  3. package/LICENSE +201 -0
  4. package/README.md +367 -0
  5. package/dist/config/server-config.d.ts +14 -0
  6. package/dist/config/server-config.d.ts.map +1 -0
  7. package/dist/config/server-config.js +27 -0
  8. package/dist/config/server-config.js.map +1 -0
  9. package/dist/index.d.ts +7 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +53 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/mcp-server/resources/definitions/gbif-dataset.resource.d.ts +20 -0
  14. package/dist/mcp-server/resources/definitions/gbif-dataset.resource.d.ts.map +1 -0
  15. package/dist/mcp-server/resources/definitions/gbif-dataset.resource.js +50 -0
  16. package/dist/mcp-server/resources/definitions/gbif-dataset.resource.js.map +1 -0
  17. package/dist/mcp-server/resources/definitions/gbif-species.resource.d.ts +27 -0
  18. package/dist/mcp-server/resources/definitions/gbif-species.resource.d.ts.map +1 -0
  19. package/dist/mcp-server/resources/definitions/gbif-species.resource.js +67 -0
  20. package/dist/mcp-server/resources/definitions/gbif-species.resource.js.map +1 -0
  21. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.d.ts +15 -0
  22. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.d.ts.map +1 -0
  23. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.js +42 -0
  24. package/dist/mcp-server/tools/definitions/gbif-count-occurrences.tool.js.map +1 -0
  25. package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.d.ts +33 -0
  26. package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.d.ts.map +1 -0
  27. package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.js +143 -0
  28. package/dist/mcp-server/tools/definitions/gbif-get-dataset.tool.js.map +1 -0
  29. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.d.ts +58 -0
  30. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.d.ts.map +1 -0
  31. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.js +264 -0
  32. package/dist/mcp-server/tools/definitions/gbif-get-occurrence.tool.js.map +1 -0
  33. package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.d.ts +25 -0
  34. package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.d.ts.map +1 -0
  35. package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.js +91 -0
  36. package/dist/mcp-server/tools/definitions/gbif-get-species-children.tool.js.map +1 -0
  37. package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.d.ts +22 -0
  38. package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.d.ts.map +1 -0
  39. package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.js +82 -0
  40. package/dist/mcp-server/tools/definitions/gbif-get-species-classification.tool.js.map +1 -0
  41. package/dist/mcp-server/tools/definitions/gbif-get-species.tool.d.ts +45 -0
  42. package/dist/mcp-server/tools/definitions/gbif-get-species.tool.d.ts.map +1 -0
  43. package/dist/mcp-server/tools/definitions/gbif-get-species.tool.js +182 -0
  44. package/dist/mcp-server/tools/definitions/gbif-get-species.tool.js.map +1 -0
  45. package/dist/mcp-server/tools/definitions/gbif-match-species.tool.d.ts +49 -0
  46. package/dist/mcp-server/tools/definitions/gbif-match-species.tool.d.ts.map +1 -0
  47. package/dist/mcp-server/tools/definitions/gbif-match-species.tool.js +148 -0
  48. package/dist/mcp-server/tools/definitions/gbif-match-species.tool.js.map +1 -0
  49. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.d.ts +45 -0
  50. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.d.ts.map +1 -0
  51. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.js +116 -0
  52. package/dist/mcp-server/tools/definitions/gbif-occurrence-facets.tool.js.map +1 -0
  53. package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.d.ts +34 -0
  54. package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.d.ts.map +1 -0
  55. package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.js +112 -0
  56. package/dist/mcp-server/tools/definitions/gbif-search-datasets.tool.js.map +1 -0
  57. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.d.ts +66 -0
  58. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.d.ts.map +1 -0
  59. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.js +278 -0
  60. package/dist/mcp-server/tools/definitions/gbif-search-occurrences.tool.js.map +1 -0
  61. package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.d.ts +23 -0
  62. package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.d.ts.map +1 -0
  63. package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.js +90 -0
  64. package/dist/mcp-server/tools/definitions/gbif-search-publishers.tool.js.map +1 -0
  65. package/dist/mcp-server/tools/definitions/gbif-search-species.tool.d.ts +48 -0
  66. package/dist/mcp-server/tools/definitions/gbif-search-species.tool.d.ts.map +1 -0
  67. package/dist/mcp-server/tools/definitions/gbif-search-species.tool.js +151 -0
  68. package/dist/mcp-server/tools/definitions/gbif-search-species.tool.js.map +1 -0
  69. package/dist/mcp-server/tools/utils.d.ts +7 -0
  70. package/dist/mcp-server/tools/utils.d.ts.map +1 -0
  71. package/dist/mcp-server/tools/utils.js +20 -0
  72. package/dist/mcp-server/tools/utils.js.map +1 -0
  73. package/dist/services/gbif/gbif-service.d.ts +99 -0
  74. package/dist/services/gbif/gbif-service.d.ts.map +1 -0
  75. package/dist/services/gbif/gbif-service.js +255 -0
  76. package/dist/services/gbif/gbif-service.js.map +1 -0
  77. package/dist/services/gbif/types.d.ts +254 -0
  78. package/dist/services/gbif/types.d.ts.map +1 -0
  79. package/dist/services/gbif/types.js +6 -0
  80. package/dist/services/gbif/types.js.map +1 -0
  81. package/package.json +91 -0
  82. package/server.json +117 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * @fileoverview Search GBIF datasets by keyword, type, or country.
3
+ * @module mcp-server/tools/definitions/gbif-search-datasets
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { getGbifService } from '../../../services/gbif/gbif-service.js';
7
+ import { stripHtml } from '../utils.js';
8
+ export const gbifSearchDatasets = tool('gbif_search_datasets', {
9
+ title: 'Search Datasets',
10
+ description: 'Search GBIF datasets by keyword, type, country, or publishing organization. ' +
11
+ 'Returns dataset title, description, license, record count, and DOI. ' +
12
+ 'Use to find the source dataset behind a set of records, or to explore what data collections ' +
13
+ 'are available for a taxon, country, or organization.',
14
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
15
+ input: z.object({
16
+ q: z.string().optional().describe('Free-text search across dataset title and description.'),
17
+ type: z
18
+ .enum(['OCCURRENCE', 'CHECKLIST', 'METADATA', 'SAMPLING_EVENT'])
19
+ .optional()
20
+ .describe('Filter by dataset type. OCCURRENCE for observation records, CHECKLIST for species lists.'),
21
+ publishingCountry: z
22
+ .string()
23
+ .optional()
24
+ .describe('ISO 3166-1 alpha-2 country code of the publishing organization.'),
25
+ hostingOrg: z
26
+ .string()
27
+ .optional()
28
+ .describe('UUID of the hosting organization. From gbif_search_publishers results.'),
29
+ limit: z
30
+ .number()
31
+ .min(1)
32
+ .max(1000)
33
+ .default(20)
34
+ .describe('Number of datasets to return (default 20, max 1000).'),
35
+ offset: z.number().min(0).default(0).describe('Pagination offset.'),
36
+ }),
37
+ output: z.object({
38
+ datasets: z
39
+ .array(z
40
+ .object({
41
+ key: z.string().optional().describe('Dataset UUID for gbif_get_dataset chaining.'),
42
+ title: z.string().optional().describe('Dataset title.'),
43
+ type: z.string().optional().describe('Dataset type (OCCURRENCE, CHECKLIST, etc.).'),
44
+ description: z.string().optional().describe('Brief description. May be absent.'),
45
+ license: z.string().optional().describe('License identifier. May be absent.'),
46
+ doi: z.string().optional().describe('DOI for citation. May be absent.'),
47
+ publishingCountry: z.string().optional().describe('Country code of the publisher.'),
48
+ recordCount: z.number().optional().describe('Number of records in the dataset.'),
49
+ })
50
+ .describe('A GBIF dataset with key, title, type, license, and record count.'))
51
+ .describe('Matching datasets.'),
52
+ totalCount: z.number().describe('Total matching datasets before pagination.'),
53
+ offset: z.number().describe('Current pagination offset.'),
54
+ limit: z.number().describe('Datasets returned in this page.'),
55
+ endOfRecords: z.boolean().describe('True when there are no more results after this page.'),
56
+ }),
57
+ async handler(input, ctx) {
58
+ ctx.log.info('Searching datasets', { q: input.q, type: input.type });
59
+ const raw = await getGbifService().searchDatasets({
60
+ ...(input.q?.trim() && { q: input.q }),
61
+ ...(input.type && { type: input.type }),
62
+ ...(input.publishingCountry?.trim() && { publishingCountry: input.publishingCountry }),
63
+ ...(input.hostingOrg?.trim() && { hostingOrg: input.hostingOrg }),
64
+ limit: input.limit,
65
+ offset: input.offset,
66
+ }, ctx);
67
+ const datasets = (raw.results ?? []).map((r) => ({
68
+ key: r.key,
69
+ title: r.title,
70
+ type: r.type,
71
+ description: r.description ? stripHtml(r.description).slice(0, 300) : undefined,
72
+ license: r.license,
73
+ doi: r.doi,
74
+ publishingCountry: r.publishingCountry,
75
+ recordCount: r.numRecords ?? r.recordCount,
76
+ }));
77
+ return {
78
+ datasets,
79
+ totalCount: raw.count ?? 0,
80
+ offset: raw.offset ?? input.offset,
81
+ limit: raw.limit ?? input.limit,
82
+ endOfRecords: raw.endOfRecords ?? true,
83
+ };
84
+ },
85
+ format: (result) => {
86
+ const lines = [
87
+ `**Total matches:** ${result.totalCount} | **Showing:** ${result.datasets.length} | **Limit:** ${result.limit} | **End of records:** ${result.endOfRecords} (offset ${result.offset})`,
88
+ ];
89
+ for (const ds of result.datasets) {
90
+ lines.push(`\n## ${ds.title ?? 'Untitled dataset'}`);
91
+ if (ds.key)
92
+ lines.push(`**Key:** ${ds.key}`);
93
+ if (ds.type)
94
+ lines.push(`**Type:** ${ds.type}`);
95
+ if (ds.license)
96
+ lines.push(`**License:** ${ds.license}`);
97
+ if (ds.doi)
98
+ lines.push(`**DOI:** ${ds.doi}`);
99
+ if (ds.publishingCountry)
100
+ lines.push(`**Publishing country:** ${ds.publishingCountry}`);
101
+ if (ds.recordCount != null)
102
+ lines.push(`**Records:** ${ds.recordCount.toLocaleString()}`);
103
+ if (ds.description)
104
+ lines.push(`${ds.description}${ds.description.length >= 300 ? '…' : ''}`);
105
+ }
106
+ if (!result.endOfRecords) {
107
+ lines.push(`\n*More results — use offset ${result.offset + result.limit} to continue.*`);
108
+ }
109
+ return [{ type: 'text', text: lines.join('\n') }];
110
+ },
111
+ });
112
+ //# sourceMappingURL=gbif-search-datasets.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gbif-search-datasets.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-search-datasets.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE;IAC7D,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,8EAA8E;QAC9E,sEAAsE;QACtE,8FAA8F;QAC9F,sDAAsD;IACxD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAC/E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;QAC3F,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CA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D,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @fileoverview Search GBIF occurrence records with Darwin Core filters.
3
+ * @module mcp-server/tools/definitions/gbif-search-occurrences
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ export declare const gbifSearchOccurrences: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
+ taxonKey: z.ZodOptional<z.ZodNumber>;
9
+ scientificName: z.ZodOptional<z.ZodString>;
10
+ country: z.ZodOptional<z.ZodString>;
11
+ decimalLatitude: z.ZodOptional<z.ZodString>;
12
+ decimalLongitude: z.ZodOptional<z.ZodString>;
13
+ geometry: z.ZodOptional<z.ZodString>;
14
+ year: z.ZodOptional<z.ZodString>;
15
+ month: z.ZodOptional<z.ZodNumber>;
16
+ basisOfRecord: z.ZodOptional<z.ZodEnum<{
17
+ HUMAN_OBSERVATION: "HUMAN_OBSERVATION";
18
+ MACHINE_OBSERVATION: "MACHINE_OBSERVATION";
19
+ PRESERVED_SPECIMEN: "PRESERVED_SPECIMEN";
20
+ LIVING_SPECIMEN: "LIVING_SPECIMEN";
21
+ MATERIAL_SAMPLE: "MATERIAL_SAMPLE";
22
+ MATERIAL_CITATION: "MATERIAL_CITATION";
23
+ OCCURRENCE: "OCCURRENCE";
24
+ LITERATURE: "LITERATURE";
25
+ }>>;
26
+ hasCoordinate: z.ZodOptional<z.ZodBoolean>;
27
+ isInCluster: z.ZodOptional<z.ZodBoolean>;
28
+ limit: z.ZodDefault<z.ZodNumber>;
29
+ offset: z.ZodDefault<z.ZodNumber>;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ occurrences: z.ZodArray<z.ZodObject<{
32
+ key: z.ZodOptional<z.ZodNumber>;
33
+ taxonKey: z.ZodOptional<z.ZodNumber>;
34
+ scientificName: z.ZodOptional<z.ZodString>;
35
+ canonicalName: z.ZodOptional<z.ZodString>;
36
+ rank: z.ZodOptional<z.ZodString>;
37
+ decimalLatitude: z.ZodOptional<z.ZodNumber>;
38
+ decimalLongitude: z.ZodOptional<z.ZodNumber>;
39
+ coordinateUncertaintyInMeters: z.ZodOptional<z.ZodNumber>;
40
+ country: z.ZodOptional<z.ZodString>;
41
+ countryCode: z.ZodOptional<z.ZodString>;
42
+ stateProvince: z.ZodOptional<z.ZodString>;
43
+ locality: z.ZodOptional<z.ZodString>;
44
+ eventDate: z.ZodOptional<z.ZodString>;
45
+ year: z.ZodOptional<z.ZodNumber>;
46
+ month: z.ZodOptional<z.ZodNumber>;
47
+ day: z.ZodOptional<z.ZodNumber>;
48
+ basisOfRecord: z.ZodOptional<z.ZodString>;
49
+ individualCount: z.ZodOptional<z.ZodNumber>;
50
+ datasetKey: z.ZodOptional<z.ZodString>;
51
+ datasetName: z.ZodOptional<z.ZodString>;
52
+ publishingCountry: z.ZodOptional<z.ZodString>;
53
+ recordedBy: z.ZodOptional<z.ZodString>;
54
+ issues: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ }, z.core.$strip>>;
56
+ totalCount: z.ZodNumber;
57
+ offset: z.ZodNumber;
58
+ limit: z.ZodNumber;
59
+ endOfRecords: z.ZodBoolean;
60
+ }, z.core.$strip>, readonly [{
61
+ readonly reason: "upstream_error";
62
+ readonly code: JsonRpcErrorCode.InternalError;
63
+ readonly when: "The GBIF occurrence search API returned an unexpected error.";
64
+ readonly recovery: "Retry the request or narrow the filters. Check that geometry WKT is valid if supplied.";
65
+ }]>;
66
+ //# sourceMappingURL=gbif-search-occurrences.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gbif-search-occurrences.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-search-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,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyShC,CAAC"}
@@ -0,0 +1,278 @@
1
+ /**
2
+ * @fileoverview Search GBIF occurrence records with Darwin Core filters.
3
+ * @module mcp-server/tools/definitions/gbif-search-occurrences
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ import { getGbifService } from '../../../services/gbif/gbif-service.js';
8
+ const PAGINATION_CAP = 99_000;
9
+ export const gbifSearchOccurrences = tool('gbif_search_occurrences', {
10
+ title: 'Search Occurrences',
11
+ description: 'Search 2.4B+ GBIF occurrence records with Darwin Core filters. Use taxonKey from gbif_match_species ' +
12
+ 'for reliable results — it resolves synonyms automatically. Accepts country (ISO 3166-1 alpha-2), ' +
13
+ 'bounding box (decimalLatitude/decimalLongitude ranges), WKT polygon geometry, year range, month, ' +
14
+ 'basis of record, and coordinate filter. Pagination is capped at approximately offset+limit=100,000 — ' +
15
+ 'use gbif_occurrence_facets for aggregate counts across large result sets.',
16
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
17
+ input: z.object({
18
+ taxonKey: z
19
+ .number()
20
+ .optional()
21
+ .describe('GBIF backbone taxon key from gbif_match_species. Preferred over scientificName — matches all synonyms automatically.'),
22
+ scientificName: z
23
+ .string()
24
+ .optional()
25
+ .describe('Scientific name filter. Less precise than taxonKey — does not match synonyms. Use taxonKey from gbif_match_species for reliable results.'),
26
+ country: z
27
+ .string()
28
+ .optional()
29
+ .describe('ISO 3166-1 alpha-2 country code (e.g., "GB", "US", "DE", "SE").'),
30
+ decimalLatitude: z
31
+ .string()
32
+ .optional()
33
+ .describe('Latitude range as "min,max" (e.g., "47.0,48.5"). Decimal degrees, WGS84. Combine with decimalLongitude for a bounding box.'),
34
+ decimalLongitude: z
35
+ .string()
36
+ .optional()
37
+ .describe('Longitude range as "min,max" (e.g., "8.0,9.5"). Decimal degrees, WGS84. Combine with decimalLatitude for a bounding box.'),
38
+ geometry: z
39
+ .string()
40
+ .optional()
41
+ .describe('WKT polygon for geographic filtering (e.g., POLYGON((8 47, 9 47, 9 48, 8 48, 8 47))). Coordinates are longitude latitude. Takes precedence over decimalLatitude/decimalLongitude.'),
42
+ year: z
43
+ .string()
44
+ .optional()
45
+ .describe('Year or year range. Single year: "2024". Range: "2020,2024". Filters by observation year.'),
46
+ month: z
47
+ .number()
48
+ .min(1)
49
+ .max(12)
50
+ .optional()
51
+ .describe('Calendar month (1–12). Useful for seasonal distribution queries.'),
52
+ basisOfRecord: z
53
+ .enum([
54
+ 'HUMAN_OBSERVATION',
55
+ 'MACHINE_OBSERVATION',
56
+ 'PRESERVED_SPECIMEN',
57
+ 'LIVING_SPECIMEN',
58
+ 'MATERIAL_SAMPLE',
59
+ 'MATERIAL_CITATION',
60
+ 'OCCURRENCE',
61
+ 'LITERATURE',
62
+ ])
63
+ .optional()
64
+ .describe('Filter by how the occurrence was recorded. HUMAN_OBSERVATION covers citizen science. PRESERVED_SPECIMEN covers natural history collections.'),
65
+ hasCoordinate: z
66
+ .boolean()
67
+ .optional()
68
+ .describe('When true, return only georeferenced records. When false, include records without coordinates.'),
69
+ isInCluster: z
70
+ .boolean()
71
+ .optional()
72
+ .describe('Filter to records flagged as likely duplicates (true) or exclude them (false). Omit to include all.'),
73
+ limit: z
74
+ .number()
75
+ .min(1)
76
+ .max(300)
77
+ .default(20)
78
+ .describe('Number of records to return (default 20, max 300).'),
79
+ offset: z
80
+ .number()
81
+ .min(0)
82
+ .default(0)
83
+ .describe('Pagination offset. GBIF caps offset+limit at approximately 100,000 — use gbif_occurrence_facets for aggregate analysis beyond this.'),
84
+ }),
85
+ output: z.object({
86
+ occurrences: z
87
+ .array(z
88
+ .object({
89
+ key: z
90
+ .number()
91
+ .optional()
92
+ .describe('GBIF occurrence key for gbif_get_occurrence chaining.'),
93
+ taxonKey: z.number().optional().describe('Backbone taxon key.'),
94
+ scientificName: z
95
+ .string()
96
+ .optional()
97
+ .describe('Scientific name from occurrence record.'),
98
+ canonicalName: z.string().optional().describe('Canonical name without authorship.'),
99
+ rank: z.string().optional().describe('Taxonomic rank of the identified taxon.'),
100
+ decimalLatitude: z
101
+ .number()
102
+ .optional()
103
+ .describe('Latitude in decimal degrees (WGS84). May be absent.'),
104
+ decimalLongitude: z
105
+ .number()
106
+ .optional()
107
+ .describe('Longitude in decimal degrees (WGS84). May be absent.'),
108
+ coordinateUncertaintyInMeters: z
109
+ .number()
110
+ .optional()
111
+ .describe('Coordinate uncertainty radius in meters. May be absent.'),
112
+ country: z.string().optional().describe('Country name. May be absent.'),
113
+ countryCode: z
114
+ .string()
115
+ .optional()
116
+ .describe('ISO 3166-1 alpha-2 country code. May be absent.'),
117
+ stateProvince: z.string().optional().describe('State or province name. May be absent.'),
118
+ locality: z.string().optional().describe('Locality description. May be absent.'),
119
+ eventDate: z
120
+ .string()
121
+ .optional()
122
+ .describe('Observation date as ISO 8601 string. May be absent.'),
123
+ year: z.number().optional().describe('Observation year. May be absent.'),
124
+ month: z.number().optional().describe('Observation month (1–12). May be absent.'),
125
+ day: z.number().optional().describe('Observation day. May be absent.'),
126
+ basisOfRecord: z.string().optional().describe('How the occurrence was recorded.'),
127
+ individualCount: z
128
+ .number()
129
+ .optional()
130
+ .describe('Number of individuals. May be absent.'),
131
+ datasetKey: z.string().optional().describe('UUID of the source dataset.'),
132
+ datasetName: z
133
+ .string()
134
+ .optional()
135
+ .describe('Name of the source dataset. May be absent.'),
136
+ publishingCountry: z
137
+ .string()
138
+ .optional()
139
+ .describe('Country code of the publishing organization.'),
140
+ recordedBy: z.string().optional().describe('Collector name(s). May be absent.'),
141
+ issues: z
142
+ .array(z.string())
143
+ .optional()
144
+ .describe('GBIF data quality issue flags for this record.'),
145
+ })
146
+ .describe('A single occurrence record with location, taxon, date, and provenance fields.'))
147
+ .describe('Occurrence records matching the filters.'),
148
+ totalCount: z.number().describe('Total matching occurrences before pagination.'),
149
+ offset: z.number().describe('Current pagination offset.'),
150
+ limit: z.number().describe('Records returned in this page.'),
151
+ endOfRecords: z.boolean().describe('True when there are no more results after this page.'),
152
+ }),
153
+ errors: [
154
+ {
155
+ reason: 'upstream_error',
156
+ code: JsonRpcErrorCode.InternalError,
157
+ when: 'The GBIF occurrence search API returned an unexpected error.',
158
+ recovery: 'Retry the request or narrow the filters. Check that geometry WKT is valid if supplied.',
159
+ },
160
+ ],
161
+ async handler(input, ctx) {
162
+ ctx.log.info('Searching occurrences', {
163
+ taxonKey: input.taxonKey,
164
+ country: input.country,
165
+ limit: input.limit,
166
+ offset: input.offset,
167
+ });
168
+ if (input.offset + input.limit > PAGINATION_CAP) {
169
+ throw ctx.fail('upstream_error', `offset + limit (${input.offset + input.limit}) exceeds the GBIF pagination cap of ~100,000. Use gbif_occurrence_facets for aggregate analysis, or reduce offset/limit.`, { ...ctx.recoveryFor('upstream_error') });
170
+ }
171
+ const raw = await getGbifService().searchOccurrences({
172
+ ...(input.taxonKey !== undefined && { taxonKey: input.taxonKey }),
173
+ ...(input.scientificName?.trim() && { scientificName: input.scientificName }),
174
+ ...(input.country?.trim() && { country: input.country }),
175
+ ...(input.decimalLatitude?.trim() && { decimalLatitude: input.decimalLatitude }),
176
+ ...(input.decimalLongitude?.trim() && { decimalLongitude: input.decimalLongitude }),
177
+ ...(input.geometry?.trim() && { geometry: input.geometry }),
178
+ ...(input.year?.trim() && { year: input.year }),
179
+ ...(input.month !== undefined && { month: input.month }),
180
+ ...(input.basisOfRecord && { basisOfRecord: input.basisOfRecord }),
181
+ ...(input.hasCoordinate !== undefined && { hasCoordinate: input.hasCoordinate }),
182
+ ...(input.isInCluster !== undefined && { isInCluster: input.isInCluster }),
183
+ limit: input.limit,
184
+ offset: input.offset,
185
+ }, ctx);
186
+ const occurrences = (raw.results ?? []).map((r) => ({
187
+ key: r.key,
188
+ taxonKey: r.taxonKey,
189
+ scientificName: r.scientificName,
190
+ canonicalName: r.canonicalName,
191
+ rank: r.taxonRank,
192
+ decimalLatitude: r.decimalLatitude,
193
+ decimalLongitude: r.decimalLongitude,
194
+ coordinateUncertaintyInMeters: r.coordinateUncertaintyInMeters,
195
+ country: r.country,
196
+ countryCode: r.countryCode,
197
+ stateProvince: r.stateProvince,
198
+ locality: r.locality,
199
+ eventDate: r.eventDate,
200
+ year: r.year,
201
+ month: r.month,
202
+ day: r.day,
203
+ basisOfRecord: r.basisOfRecord,
204
+ individualCount: r.individualCount,
205
+ datasetKey: r.datasetKey,
206
+ datasetName: r.datasetName,
207
+ publishingCountry: r.publishingCountry,
208
+ recordedBy: r.recordedBy,
209
+ issues: r.issues?.length ? r.issues : undefined,
210
+ }));
211
+ return {
212
+ occurrences,
213
+ totalCount: raw.count ?? 0,
214
+ offset: raw.offset ?? input.offset,
215
+ limit: raw.limit ?? input.limit,
216
+ endOfRecords: raw.endOfRecords ?? true,
217
+ };
218
+ },
219
+ format: (result) => {
220
+ const lines = [
221
+ `**Total matches:** ${result.totalCount} | **Showing:** ${result.occurrences.length} | **Limit:** ${result.limit} | **End of records:** ${result.endOfRecords} (offset ${result.offset})`,
222
+ ];
223
+ for (const occ of result.occurrences) {
224
+ const canonical = occ.canonicalName ?? occ.scientificName ?? 'Unknown taxon';
225
+ const sci = occ.scientificName && occ.scientificName !== canonical ? ` [${occ.scientificName}]` : '';
226
+ lines.push(`\n## ${canonical}${sci}`);
227
+ if (occ.key != null)
228
+ lines.push(`**Occurrence key:** ${occ.key}`);
229
+ if (occ.taxonKey != null)
230
+ lines.push(`**Taxon key:** ${occ.taxonKey}`);
231
+ if (occ.rank)
232
+ lines.push(`**Rank:** ${occ.rank}`);
233
+ if (occ.basisOfRecord)
234
+ lines.push(`**Basis of record:** ${occ.basisOfRecord}`);
235
+ if (occ.eventDate) {
236
+ lines.push(`**Date:** ${occ.eventDate}`);
237
+ }
238
+ if (occ.year != null)
239
+ lines.push(`**Year:** ${occ.year}`);
240
+ if (occ.month != null)
241
+ lines.push(`**Month:** ${occ.month}`);
242
+ if (occ.day != null)
243
+ lines.push(`**Day:** ${occ.day}`);
244
+ if (occ.decimalLatitude != null && occ.decimalLongitude != null) {
245
+ lines.push(`**Coordinates:** ${occ.decimalLatitude}, ${occ.decimalLongitude}${occ.coordinateUncertaintyInMeters != null ? ` (±${occ.coordinateUncertaintyInMeters}m)` : ''}`);
246
+ }
247
+ else {
248
+ lines.push('**Coordinates:** Not available');
249
+ }
250
+ const geo = [];
251
+ if (occ.locality)
252
+ geo.push(occ.locality);
253
+ if (occ.stateProvince)
254
+ geo.push(occ.stateProvince);
255
+ if (occ.country)
256
+ geo.push(occ.country);
257
+ if (geo.length > 0)
258
+ lines.push(`**Location:** ${geo.join(', ')}${occ.countryCode ? ` (${occ.countryCode})` : ''}`);
259
+ else if (occ.countryCode)
260
+ lines.push(`**Country code:** ${occ.countryCode}`);
261
+ if (occ.publishingCountry)
262
+ lines.push(`**Publishing country:** ${occ.publishingCountry}`);
263
+ if (occ.recordedBy)
264
+ lines.push(`**Recorded by:** ${occ.recordedBy}`);
265
+ if (occ.individualCount != null)
266
+ lines.push(`**Count:** ${occ.individualCount}`);
267
+ if (occ.datasetKey)
268
+ lines.push(`**Dataset:** ${occ.datasetName ?? occ.datasetKey} (key: ${occ.datasetKey})`);
269
+ if (occ.issues?.length)
270
+ lines.push(`**Issues:** ${occ.issues.join(', ')}`);
271
+ }
272
+ if (!result.endOfRecords) {
273
+ lines.push(`\n*More results — use offset ${result.offset + result.limit} to continue.*`);
274
+ }
275
+ return [{ type: 'text', text: lines.join('\n') }];
276
+ },
277
+ });
278
+ //# sourceMappingURL=gbif-search-occurrences.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gbif-search-occurrences.tool.js","sourceRoot":"","sources":["../../../../src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,GAAG,CAAC,UAAU;gBAChB,KAAK,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,UAAU,UAAU,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC;YAC3F,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,gCAAgC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,gBAAgB,CAAC,CAAC;QAC3F,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"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @fileoverview Search GBIF publishing organizations by name or country.
3
+ * @module mcp-server/tools/definitions/gbif-search-publishers
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const gbifSearchPublishers: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
7
+ q: z.ZodOptional<z.ZodString>;
8
+ country: z.ZodOptional<z.ZodString>;
9
+ limit: z.ZodDefault<z.ZodNumber>;
10
+ offset: z.ZodDefault<z.ZodNumber>;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ publishers: z.ZodArray<z.ZodObject<{
13
+ key: z.ZodOptional<z.ZodString>;
14
+ title: z.ZodOptional<z.ZodString>;
15
+ country: z.ZodOptional<z.ZodString>;
16
+ city: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
18
+ totalCount: z.ZodNumber;
19
+ offset: z.ZodNumber;
20
+ limit: z.ZodNumber;
21
+ endOfRecords: z.ZodBoolean;
22
+ }, z.core.$strip>, undefined>;
23
+ //# sourceMappingURL=gbif-search-publishers.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gbif-search-publishers.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/gbif-search-publishers.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;6BAwF/B,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @fileoverview Search GBIF publishing organizations by name or country.
3
+ * @module mcp-server/tools/definitions/gbif-search-publishers
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { getGbifService } from '../../../services/gbif/gbif-service.js';
7
+ export const gbifSearchPublishers = tool('gbif_search_publishers', {
8
+ title: 'Search Publishers',
9
+ description: 'Search organizations registered with GBIF by name fragment or country. ' +
10
+ 'Returns organization key, title, and country — sufficient to chain into gbif_search_datasets ' +
11
+ 'with hostingOrg, or to understand who publishes data for a region.',
12
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
13
+ input: z.object({
14
+ q: z.string().optional().describe('Name fragment to search for. Matches organization names.'),
15
+ country: z
16
+ .string()
17
+ .optional()
18
+ .describe('ISO 3166-1 alpha-2 country code to filter organizations by country.'),
19
+ limit: z
20
+ .number()
21
+ .min(1)
22
+ .max(1000)
23
+ .default(20)
24
+ .describe('Number of organizations to return (default 20, max 1000).'),
25
+ offset: z.number().min(0).default(0).describe('Pagination offset.'),
26
+ }),
27
+ output: z.object({
28
+ publishers: z
29
+ .array(z
30
+ .object({
31
+ key: z
32
+ .string()
33
+ .optional()
34
+ .describe('Organization UUID for gbif_search_datasets hostingOrg parameter.'),
35
+ title: z.string().optional().describe('Organization name.'),
36
+ country: z.string().optional().describe('ISO 3166-1 alpha-2 country code.'),
37
+ city: z.string().optional().describe('City. May be absent.'),
38
+ })
39
+ .describe('A GBIF-registered publishing organization.'))
40
+ .describe('Matching organizations.'),
41
+ totalCount: z.number().describe('Total matching organizations before pagination.'),
42
+ offset: z.number().describe('Current pagination offset.'),
43
+ limit: z.number().describe('Organizations returned in this page.'),
44
+ endOfRecords: z.boolean().describe('True when there are no more results after this page.'),
45
+ }),
46
+ async handler(input, ctx) {
47
+ ctx.log.info('Searching publishers', { q: input.q, country: input.country });
48
+ const raw = await getGbifService().searchPublishers({
49
+ ...(input.q?.trim() && { q: input.q }),
50
+ ...(input.country?.trim() && { country: input.country }),
51
+ limit: input.limit,
52
+ offset: input.offset,
53
+ }, ctx);
54
+ const publishers = (raw.results ?? []).map((r) => ({
55
+ key: r.key,
56
+ title: r.title,
57
+ country: r.country,
58
+ city: r.city,
59
+ }));
60
+ return {
61
+ publishers,
62
+ totalCount: raw.count ?? 0,
63
+ offset: raw.offset ?? input.offset,
64
+ limit: raw.limit ?? input.limit,
65
+ endOfRecords: raw.endOfRecords ?? true,
66
+ };
67
+ },
68
+ format: (result) => {
69
+ const lines = [
70
+ `**Total matches:** ${result.totalCount} | **Showing:** ${result.publishers.length} | **Limit:** ${result.limit} | **End of records:** ${result.endOfRecords} (offset ${result.offset})`,
71
+ ];
72
+ for (const pub of result.publishers) {
73
+ lines.push(`\n- **${pub.title ?? 'Unknown'}**`);
74
+ if (pub.key)
75
+ lines.push(` Key: ${pub.key}`);
76
+ const location = [];
77
+ if (pub.city)
78
+ location.push(pub.city);
79
+ if (pub.country)
80
+ location.push(pub.country);
81
+ if (location.length > 0)
82
+ lines.push(` Location: ${location.join(', ')}`);
83
+ }
84
+ if (!result.endOfRecords) {
85
+ lines.push(`\n*More results — use offset ${result.offset + result.limit} to continue.*`);
86
+ }
87
+ return [{ type: 'text', text: lines.join('\n') }];
88
+ },
89
+ });
90
+ //# sourceMappingURL=gbif-search-publishers.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gbif-search-publishers.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/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