-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.ts
2182 lines (2073 loc) · 72.7 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env node
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import dotenv from "dotenv";
import { setupHandlers } from "./handlers/setup";
import { setupEnvironment } from "./utils/env-setup";
import { z } from "zod";
import {
CallToolRequestSchema,
ListResourcesRequestSchema,
ReadResourceRequestSchema
} from "@modelcontextprotocol/sdk/types.js";
import path from 'path';
import { nasaApiRequest, jplApiRequest } from './utils/api-client';
import { apodParamsSchema } from './handlers/nasa/apod';
import { resources, addResource as addResourceCore, Resource } from './resources';
// Load environment variables with enhanced setup
setupEnvironment();
// Also load with standard dotenv for compatibility
dotenv.config();
// Keep a reference to the server for notifications
let serverInstance: Server | null = null;
// Define resource generator function type
type ResourceGenerator = (params: Record<string, string>) => Promise<{
name: string;
mimeType: string;
text?: string;
blob?: Uint8Array;
}>;
// Resource templates definition
export const resourceTemplates: Array<{
uriTemplate: string;
name: string;
description: string;
generator: ResourceGenerator;
}> = [
{
name: "nasa-apod-image",
description: "NASA Astronomy Picture of the Day",
uriTemplate: "nasa://apod/image?date={date}",
generator: async (params) => {
const date = params["date"] || "2023-01-01";
return {
name: `Astronomy Picture of the Day (${date})`,
mimeType: "application/json",
text: JSON.stringify({
date,
title: "The Tail of a Christmas Comet",
url: "https://apod.nasa.gov/apod/image/2301/CometZTF_Hernandez_1080.jpg",
explanation: "Better known as Comet ZTF, this comet was captured on January 1, glowing in the predawn sky."
}, null, 2)
};
}
},
{
name: "nasa-epic-image",
description: "NASA EPIC Earth observation image",
uriTemplate: "nasa://epic/image?date={date}&collection={collection}",
generator: async (params) => {
const date = params["date"] || "2023-01-01";
const collection = params["collection"] || "natural";
return {
name: `EPIC Earth View (${date})`,
mimeType: "application/json",
text: JSON.stringify({
date,
collection,
images: [
{
identifier: "20230101010203",
caption: "Earth from the DSCOVR satellite",
image: "https://epic.gsfc.nasa.gov/archive/natural/2023/01/01/png/epic_1b_20230101010203.png"
}
]
}, null, 2)
};
}
},
{
name: "mars-rover-photo",
description: "NASA Mars Rover photograph",
uriTemplate: "nasa://mars-rover/photo?rover={rover}&id={id}",
generator: async (params) => {
const rover = params["rover"] || "curiosity";
const id = params["id"] || "1";
return {
name: `NASA Mars Rover photograph`,
mimeType: "image/jpeg",
text: `https://mars.nasa.gov/msl-raw-images/proj/msl/redops/odyssey/images/${rover}/edr/fcam/${id}.jpg`,
blob: new Uint8Array()
};
}
},
{
name: "nasa-image",
description: "NASA Image and Video Library item",
uriTemplate: "nasa://images/item?nasa_id={nasa_id}",
generator: async (params) => {
const nasa_id = params["nasa_id"] || "1";
return {
name: `NASA Image and Video Library item (${nasa_id})`,
mimeType: "image/jpeg",
text: `https://images-assets.nasa.gov/image/${nasa_id}/metadata.json`,
blob: new Uint8Array()
};
}
},
{
name: "nasa-gibs-imagery",
description: "NASA Global Imagery Browse Services (GIBS) satellite image",
uriTemplate: "nasa://gibs/imagery?layer={layer}&date={date}",
generator: async (params) => {
const layer = params["layer"] || "MODIS_Terra_CorrectedReflectance_TrueColor";
const date = params["date"] || "2023-01-01";
return {
name: `NASA Global Imagery Browse Services satellite image (${layer}, ${date})`,
mimeType: "image/jpeg",
text: `https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/${layer}/${date}/default/default.jpg`,
blob: new Uint8Array()
};
}
},
{
name: "jpl-asteroid-data",
description: "JPL Small-Body Database entry",
uriTemplate: "jpl://sbdb?object={object}",
generator: async (params) => {
const object = params["object"] || "Ceres";
return {
name: `JPL Small-Body Database entry (${object})`,
mimeType: "application/json",
text: `https://ssd.jpl.nasa.gov/api/astorb.api?format=json&number=1&orb=0&fullname=${encodeURIComponent(object)}`,
blob: new Uint8Array()
};
}
},
{
name: "nasa-earth-imagery",
description: "NASA Earth Landsat satellite imagery",
uriTemplate: "nasa://earth/imagery?lon={lon}&lat={lat}&date={date}",
generator: async (params) => {
const lon = params["lon"] || "-122.4783";
const lat = params["lat"] || "37.8199";
const date = params["date"] || "";
return {
name: `Landsat imagery at coordinates (${lon}, ${lat})`,
mimeType: "application/json",
text: JSON.stringify({
coordinates: {
lon,
lat
},
date: date || "latest",
image_url: `https://api.nasa.gov/planetary/earth/imagery?lon=${lon}&lat=${lat}${date ? `&date=${date}` : ''}&api_key=DEMO_KEY`
}, null, 2)
};
}
}
];
// Add some initial example resources
function initializeResources() {
// Add an example APOD resource
addResource("nasa://apod/image?date=2023-01-01", {
name: "Astronomy Picture of the Day (2023-01-01)",
mimeType: "application/json",
text: JSON.stringify({
date: "2023-01-01",
title: "The Tail of a Christmas Comet",
url: "https://apod.nasa.gov/apod/image/2301/CometZTF_Hernandez_1080.jpg",
explanation: "Better known as Comet ZTF, this comet was captured on January 1, glowing in the predawn sky."
}, null, 2)
});
// Add an example EPIC resource
addResource("nasa://epic/image?date=2023-01-01&collection=natural", {
name: "EPIC Earth View (2023-01-01)",
mimeType: "application/json",
text: JSON.stringify({
date: "2023-01-01",
collection: "natural",
images: [
{
identifier: "20230101010203",
caption: "Earth from the DSCOVR satellite",
image: "https://epic.gsfc.nasa.gov/archive/natural/2023/01/01/png/epic_1b_20230101010203.png"
}
]
}, null, 2)
});
// Add an example NEO resource
addResource("nasa://neo/list?date=2023-01-01", {
name: "Near Earth Objects (2023-01-01)",
mimeType: "application/json",
text: JSON.stringify({
date: "2023-01-01",
element_count: 2,
near_earth_objects: {
"2023-01-01": [
{
id: "3542519",
name: "2054 UR6",
absolute_magnitude_h: 20.7,
is_potentially_hazardous_asteroid: false
},
{
id: "3759690",
name: "2016 WF9",
absolute_magnitude_h: 19.3,
is_potentially_hazardous_asteroid: true
}
]
}
}, null, 2)
});
}
// Define our prompts
const nasaPrompts = [
{
name: "nasa/get-astronomy-picture",
description: "Fetch NASA's Astronomy Picture of the Day with optional date selection",
arguments: [
{
name: "date",
description: "The date of the APOD image to retrieve (YYYY-MM-DD format)",
required: false
},
{
name: "count",
description: "Number of random APODs to retrieve",
required: false
},
{
name: "start_date",
description: "Start date for date range search (YYYY-MM-DD)",
required: false
},
{
name: "end_date",
description: "End date for date range search (YYYY-MM-DD)",
required: false
},
{
name: "thumbs",
description: "Return URL of thumbnail for video content",
required: false
}
]
},
{
name: "nasa/browse-near-earth-objects",
description: "Find near-Earth asteroids within a specific date range",
arguments: [
{
name: "start_date",
description: "Start date for asteroid search (YYYY-MM-DD format)",
required: true
},
{
name: "end_date",
description: "End date for asteroid search (YYYY-MM-DD format)",
required: true
}
]
},
{
name: "nasa/view-epic-imagery",
description: "Browse Earth Polychromatic Imaging Camera views of Earth",
arguments: [
{
name: "collection",
description: "Image collection to view ('natural' or 'enhanced')",
required: false
},
{
name: "date",
description: "Date of images to retrieve (YYYY-MM-DD format)",
required: false
}
]
}
];
const jplPrompts = [
{
name: "jpl_query-small-body-database",
description: "Search the Small-Body Database for asteroids and comets matching specific criteria",
arguments: [
{
name: "object_name",
description: "Name or designation of the object (e.g., 'Ceres')",
required: false
},
{
name: "spk_id",
description: "SPK ID of the object",
required: false
},
{
name: "object_type",
description: "Type of object ('ast' for asteroid, 'com' for comet)",
required: false
}
]
},
{
name: "jpl_find-close-approaches",
description: "Find close approaches of asteroids and comets to Earth or other planets",
arguments: [
{
name: "dist-max",
description: "Maximum approach distance in lunar distances (LD)",
required: false
},
{
name: "date-min",
description: "Start date for search (YYYY-MM-DD)",
required: false
},
{
name: "date-max",
description: "End date for search (YYYY-MM-DD)",
required: false
},
{
name: "body",
description: "Body to find close approaches to (default: Earth)",
required: false
}
]
},
{
name: "jpl_get-fireball-data",
description: "Retrieve data about fireballs detected by US Government sensors",
arguments: [
{
name: "date-min",
description: "Start date for fireball data (YYYY-MM-DD)",
required: false
},
{
name: "date-max",
description: "End date for fireball data (YYYY-MM-DD)",
required: false
},
{
name: "energy-min",
description: "Minimum energy in kilotons of TNT",
required: false
}
]
}
];
// Define the additional direct MCP prompts
const mcpPrompts = [
{
name: "apod-daily",
description: "Get NASA's Astronomy Picture of the Day with a natural language prompt",
arguments: [
{
name: "date",
description: "The date of the APOD image to retrieve (YYYY-MM-DD format)",
required: false
},
{
name: "count",
description: "Number of random APODs to retrieve",
required: false
},
{
name: "start_date",
description: "Start date for date range search (YYYY-MM-DD)",
required: false
},
{
name: "end_date",
description: "End date for date range search (YYYY-MM-DD)",
required: false
},
{
name: "thumbs",
description: "Return URL of thumbnail for video content",
required: false
}
]
}
];
// Combine all prompts
const allPrompts = [...nasaPrompts, ...jplPrompts, ...mcpPrompts];
async function startServer() {
try {
// Initialize resources
initializeResources();
// Initialize MCP server with proper capabilities structure
const server = new Server(
{
name: "NASA MCP Server",
description: "Model Context Protocol server for NASA APIs",
version: "1.0.11"
},
{
capabilities: {
resources: {
uriSchemes: ["nasa", "jpl"]
},
tools: {
callSchema: CallToolRequestSchema
},
prompts: {
list: allPrompts
},
logging: {}
}
}
);
// Store the server instance for global access
serverInstance = server;
// Register the tools/manifest method handler (important for MCP compliance)
server.setRequestHandler(
z.object({
method: z.literal("tools/manifest"),
params: z.object({}).optional()
}),
async () => {
// Return all tools we support in the MCP required format
return {
apis: [
{
name: "nasa_apod",
id: "nasa/apod",
description: "Fetch NASA's Astronomy Picture of the Day"
},
{
name: "nasa_neo",
id: "nasa/neo",
description: "Information about asteroids and near-Earth objects"
},
{
name: "nasa_epic",
id: "nasa/epic",
description: "Earth Polychromatic Imaging Camera views of Earth"
},
{
name: "nasa_gibs",
id: "nasa/gibs",
description: "Global Imagery Browse Services satellite imagery"
},
{
name: "nasa_cmr",
id: "nasa/cmr",
description: "Search NASA's Common Metadata Repository for satellite data"
},
{
name: "nasa_firms",
id: "nasa/firms",
description: "Fire Information for Resource Management System"
},
{
name: "nasa_images",
id: "nasa/images",
description: "Search NASA's image and video library"
},
{
name: "nasa_exoplanet",
id: "nasa/exoplanet",
description: "Access NASA's Exoplanet Archive data"
},
{
name: "nasa_donki",
id: "nasa/donki",
description: "Space Weather Database Of Notifications, Knowledge, Information"
},
{
name: "nasa_mars_rover",
id: "nasa/mars-rover",
description: "Browse photos from NASA's Mars rovers"
},
{
name: "nasa_eonet",
id: "nasa/eonet",
description: "Earth Observatory Natural Event Tracker"
},
{
name: "nasa_power",
id: "nasa/power",
description: "Prediction of Worldwide Energy Resources"
},
{
name: "jpl_sbdb",
id: "jpl/sbdb",
description: "Small-Body DataBase (SBDB) - primarily orbital data on all known asteroids and comets"
},
{
name: "jpl_fireball",
id: "jpl/fireball",
description: "Fireball atmospheric impact data reported by US Government sensors"
},
{
name: "jpl_jd_cal",
id: "jpl/jd_cal",
description: "Julian Day number to/from calendar date/time converter"
},
{
name: "jpl_nhats",
id: "jpl/nhats",
description: "Human-accessible NEOs (Near-Earth Objects) data"
},
{
name: "jpl_cad",
id: "jpl/cad",
description: "Asteroid and comet close approaches to the planets in the past and future"
},
{
name: "jpl_sentry",
id: "jpl/sentry",
description: "JPL Sentry - NEO Earth impact risk assessment data"
},
{
name: "jpl_horizons",
id: "jpl/horizons",
description: "JPL Horizons - Solar system objects ephemeris data"
},
{
name: "jpl_scout",
id: "jpl/scout",
description: "NEOCP orbits, ephemerides, and impact risk data (Scout)"
},
{
name: "nasa_earth",
id: "nasa/earth",
description: "Earth - Landsat satellite imagery and data"
}
]
};
}
);
// Register the standard MCP methods
// List Resources Handler
server.setRequestHandler(
z.object({
method: z.literal("resources/list"),
params: z.object({}).optional()
}),
async () => {
// Get concrete resources
const concreteResources = Array.from(resources.entries()).map(([uri, resource]) => ({
uri: uri,
mimeType: resource.mimeType,
name: resource.name
}));
// Get resource templates
const resourceTemplatesList = resourceTemplates.map(template => ({
uriTemplate: template.uriTemplate,
name: template.name,
description: template.description
}));
// Return combined list
return {
resources: [...concreteResources, ...resourceTemplatesList]
};
}
);
// Standard handler using the ListResourcesRequestSchema (may be an alternate way to call the same endpoint)
server.setRequestHandler(ListResourcesRequestSchema, async () => {
// Get concrete resources
const concreteResources = Array.from(resources.entries()).map(([uri, resource]) => ({
uri: uri,
mimeType: resource.mimeType,
name: resource.name
}));
// Get resource templates - mapped to have uri property to match protocol requirements
const resourceTemplatesList = resourceTemplates.map(template => ({
uri: template.uriTemplate, // Use uriTemplate as uri
name: template.name,
description: template.description
}));
// Return combined list
return {
resources: [...concreteResources, ...resourceTemplatesList]
};
});
// Read Resource Handler
server.setRequestHandler(
z.object({
method: z.literal("resources/read"),
params: z.object({
uri: z.string()
})
}),
async (request) => {
const uri = request.params.uri.toString();
const resource = resources.get(uri);
if (!resource) {
throw new Error(`Resource not found: ${uri}`);
}
return {
contents: [{
uri,
mimeType: resource.mimeType,
text: resource.text,
blob: resource.blob
}]
};
}
);
// Standard handler using the ReadResourceRequestSchema
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
const uri = request.params.uri.toString();
// Check if this is a concrete resource
const resource = resources.get(uri);
if (resource) {
return {
contents: [{
uri,
mimeType: resource.mimeType,
text: resource.text,
blob: resource.blob
}]
};
}
// If not found as a concrete resource, check if it matches any resource templates
for (const template of resourceTemplates) {
// Create a regex pattern from the template URI, replacing parameters with capture groups
// This is a basic implementation - a more robust one would properly parse URI templates
const pattern = template.uriTemplate.replace(/\{([^}]+)\}/g, '([^/]+)');
const regex = new RegExp(`^${pattern}$`);
const match = uri.match(regex);
if (match) {
// Extract parameter values from the URI
const paramNames = Array.from(template.uriTemplate.matchAll(/\{([^}]+)\}/g)).map(m => m[1]);
const paramValues = match.slice(1); // Skip the first element (full match)
const params: Record<string, string> = {};
paramNames.forEach((name, index) => {
params[name] = paramValues[index];
});
// Call the parameterized generator function to get the resource
try {
const generatedResource = await template.generator(params);
return {
contents: [{
uri,
mimeType: generatedResource.mimeType,
text: generatedResource.text,
blob: generatedResource.blob
}]
};
} catch (error: unknown) {
const errorMessage = error instanceof Error ? error.message : String(error);
throw new Error(`Failed to generate resource: ${errorMessage}`);
}
}
}
// If we get here, the resource was not found
throw new Error(`Resource not found: ${uri}`);
});
// List Tools Handler - Fixed the method name from "list-tools" to "tools/list"
server.setRequestHandler(
z.object({
method: z.literal("tools/list"),
params: z.object({}).optional()
}),
async () => {
// Return all tools we support in the MCP required format
return {
tools: [
{
name: "nasa_apod",
description: "Fetch NASA's Astronomy Picture of the Day",
inputSchema: {
type: "object",
properties: {
date: {
type: "string",
description: "The date of the APOD image to retrieve (YYYY-MM-DD)"
},
count: {
type: "number",
description: "Count of random APODs to retrieve"
},
start_date: {
type: "string",
description: "Start date for date range search (YYYY-MM-DD)"
},
end_date: {
type: "string",
description: "End date for date range search (YYYY-MM-DD)"
},
thumbs: {
type: "boolean",
description: "Return URL of thumbnail for video content"
}
},
required: ["date"]
}
},
{
name: "nasa_neo",
description: "Near Earth Object Web Service - information about asteroids",
inputSchema: {
type: "object",
properties: {
start_date: {
type: "string",
description: "Start date for asteroid search (YYYY-MM-DD)"
},
end_date: {
type: "string",
description: "End date for asteroid search (YYYY-MM-DD)"
},
asteroid_id: {
type: "string",
description: "ID of a specific asteroid"
}
},
required: ["start_date", "end_date"]
}
},
{
name: "nasa_epic",
description: "Earth Polychromatic Imaging Camera - views of Earth",
inputSchema: {
type: "object",
properties: {
collection: {
type: "string",
description: "Image collection (natural or enhanced)"
},
date: {
type: "string",
description: "Date of the image (YYYY-MM-DD)"
}
}
}
},
{
name: "nasa_gibs",
description: "Global Imagery Browse Services - satellite imagery",
inputSchema: {
type: "object",
properties: {
layer: {
type: "string",
description: "Layer name (e.g., MODIS_Terra_CorrectedReflectance_TrueColor)"
},
date: {
type: "string",
description: "Date of imagery (YYYY-MM-DD)"
},
format: {
type: "string",
description: "Image format (png, jpg, jpeg)"
},
resolution: {
type: "number",
description: "Resolution in pixels per degree"
}
},
required: ["layer", "date"]
}
},
{
name: "nasa_cmr",
description: "NASA Common Metadata Repository - search for NASA data collections",
inputSchema: {
type: "object",
properties: {
keyword: {
type: "string",
description: "Search keyword"
},
limit: {
type: "number",
description: "Maximum number of results to return"
},
page: {
type: "number",
description: "Page number for pagination"
},
sort_key: {
type: "string",
description: "Field to sort results by"
}
},
required: ["keyword"]
}
},
{
name: "nasa_firms",
description: "NASA Fire Information for Resource Management System - fire data",
inputSchema: {
type: "object",
properties: {
latitude: {
type: "number",
description: "Latitude coordinate"
},
longitude: {
type: "number",
description: "Longitude coordinate"
},
days: {
type: "number",
description: "Number of days of data to retrieve"
}
},
required: ["latitude", "longitude"]
}
},
{
name: "nasa_images",
description: "NASA Image and Video Library - search NASA's media archive",
inputSchema: {
type: "object",
properties: {
q: {
type: "string",
description: "Search query"
},
media_type: {
type: "string",
description: "Media type (image, video, audio)"
},
year_start: {
type: "string",
description: "Start year for results"
},
year_end: {
type: "string",
description: "End year for results"
},
page: {
type: "number",
description: "Page number for pagination"
}
},
required: ["q"]
}
},
{
name: "nasa_exoplanet",
description: "NASA Exoplanet Archive - data about planets beyond our solar system",
inputSchema: {
type: "object",
properties: {
table: {
type: "string",
description: "Database table to query"
},
select: {
type: "string",
description: "Columns to return"
},
where: {
type: "string",
description: "Filter conditions"
},
order: {
type: "string",
description: "Ordering of results"
},
limit: {
type: "number",
description: "Maximum number of results"
}
},
required: ["table"]
}
},
{
name: "nasa_donki",
description: "Space Weather Database Of Notifications, Knowledge, Information",
inputSchema: {
type: "object",
properties: {
type: {
type: "string",
description: "Type of space weather event"
},
startDate: {
type: "string",
description: "Start date (YYYY-MM-DD)"
},
endDate: {
type: "string",
description: "End date (YYYY-MM-DD)"
}
},
required: ["type"]
}
},
{
name: "nasa_mars_rover",
description: "NASA Mars Rover Photos - images from Mars rovers",
inputSchema: {
type: "object",
properties: {
rover: {
type: "string",
description: "Name of the rover (curiosity, opportunity, spirit, perseverance)"
},
sol: {
type: "number",
description: "Martian sol (day) of the photos"
},
earth_date: {
type: "string",
description: "Earth date of the photos (YYYY-MM-DD)"
},
camera: {
type: "string",
description: "Camera name"
},
page: {
type: "number",
description: "Page number for pagination"
}
},
required: ["rover"]
}
},
{
name: "nasa_eonet",
description: "Earth Observatory Natural Event Tracker - natural events data",
inputSchema: {
type: "object",
properties: {
category: {
type: "string",
description: "Event category (wildfires, volcanoes, etc.)"
},
days: {
type: "number",
description: "Number of days to look back"
},
source: {
type: "string",
description: "Data source"
},
status: {
type: "string",
description: "Event status (open, closed)"
},
limit: {
type: "number",
description: "Maximum number of events to return"
}
}
}
},
{
name: "nasa_power",
description: "Prediction of Worldwide Energy Resources - meteorological data",
inputSchema: {
type: "object",
properties: {
parameters: {
type: "string",
description: "Comma-separated data parameters"
},
community: {
type: "string",
description: "User community (RE, SB, AG, etc.)"
},
longitude: {
type: "number",
description: "Longitude coordinate"
},
latitude: {
type: "number",