Skip to content

Commit 7ee4cf5

Browse files
Update version to 1.0.13 and modify API parameters in index.ts
1 parent 55eb348 commit 7ee4cf5

File tree

2 files changed

+77
-63
lines changed

2 files changed

+77
-63
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@programcomputer/nasa-mcp-server",
3-
"version": "1.0.12",
3+
"version": "1.0.13",
44
"description": "Model Context Protocol (MCP) server for NASA APIs",
55
"main": "dist/index.js",
66
"files": [

src/index.ts

Lines changed: 76 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ async function startServer() {
408408
{
409409
name: "NASA MCP Server",
410410
description: "Model Context Protocol server for NASA APIs",
411-
version: "1.0.12"
411+
version: "1.0.13"
412412
},
413413
{
414414
capabilities: {
@@ -539,11 +539,11 @@ async function startServer() {
539539
id: "jpl/scout",
540540
description: "NEOCP orbits, ephemerides, and impact risk data (Scout)"
541541
},
542-
{
543-
name: "nasa_earth",
544-
id: "nasa/earth",
545-
description: "Earth - Landsat satellite imagery and data"
546-
}
542+
// {
543+
// name: "nasa_earth",
544+
// id: "nasa/earth",
545+
// description: "Earth - Landsat satellite imagery and data"
546+
// }
547547
]
548548
};
549549
}
@@ -799,6 +799,18 @@ async function startServer() {
799799
type: "string",
800800
description: "Search keyword"
801801
},
802+
search_type: {
803+
type: "string",
804+
description: "Search type (collections or granules)",
805+
enum: ["collections", "granules"],
806+
default: "collections"
807+
},
808+
format: {
809+
type: "string",
810+
description: "Response format",
811+
enum: ["json", "umm_json", "atom", "echo10", "iso19115", "iso_smap", "kml"],
812+
default: "json"
813+
},
802814
limit: {
803815
type: "number",
804816
description: "Maximum number of results to return"
@@ -812,7 +824,7 @@ async function startServer() {
812824
description: "Field to sort results by"
813825
}
814826
},
815-
required: ["keyword"]
827+
required: ["keyword","search_type", "format"]
816828
}
817829
},
818830
{
@@ -1415,36 +1427,36 @@ async function startServer() {
14151427
// No required fields explicitly listed, as API might default to list
14161428
}
14171429
},
1418-
{
1419-
name: "nasa_earth",
1420-
description: "Earth - Landsat satellite imagery",
1421-
inputSchema: {
1422-
type: "object",
1423-
properties: {
1424-
lon: {
1425-
type: "number",
1426-
description: "Longitude of the imagery location"
1427-
},
1428-
lat: {
1429-
type: "number",
1430-
description: "Latitude of the imagery location"
1431-
},
1432-
date: {
1433-
type: "string",
1434-
description: "Date of imagery (YYYY-MM-DD format). If not specified, most recent imagery is used"
1435-
},
1436-
dim: {
1437-
type: "number",
1438-
description: "Width and height of image in degrees (0.025 to 0.5)"
1439-
},
1440-
cloud_score: {
1441-
type: "boolean",
1442-
description: "Calculate the percentage of the image covered by clouds"
1443-
}
1444-
},
1445-
required: ["lon", "lat"]
1446-
}
1447-
}
1430+
// {
1431+
// name: "nasa_earth",
1432+
// description: "Earth - Landsat satellite imagery",
1433+
// inputSchema: {
1434+
// type: "object",
1435+
// properties: {
1436+
// lon: {
1437+
// type: "number",
1438+
// description: "Longitude of the imagery location"
1439+
// },
1440+
// lat: {
1441+
// type: "number",
1442+
// description: "Latitude of the imagery location"
1443+
// },
1444+
// date: {
1445+
// type: "string",
1446+
// description: "Date of imagery (YYYY-MM-DD format). If not specified, most recent imagery is used"
1447+
// },
1448+
// dim: {
1449+
// type: "number",
1450+
// description: "Width and height of image in degrees (0.025 to 0.5)"
1451+
// },
1452+
// cloud_score: {
1453+
// type: "boolean",
1454+
// description: "Calculate the percentage of the image covered by clouds"
1455+
// }
1456+
// },
1457+
// required: ["lon", "lat"]
1458+
// }
1459+
// }
14481460
]
14491461
};
14501462
}
@@ -1549,10 +1561,12 @@ async function startServer() {
15491561
method: z.literal("nasa/cmr"),
15501562
params: z.object({
15511563
keyword: z.string().optional(),
1564+
search_type: z.enum(['collections', 'granules']).optional(),
1565+
format: z.enum(['json', 'umm_json', 'atom', 'echo10', 'iso19115', 'iso_smap', 'kml']).optional(),
15521566
limit: z.number().optional(),
15531567
page: z.number().optional(),
15541568
sort_key: z.string().optional()
1555-
}).optional()
1569+
}).passthrough().optional()
15561570
}),
15571571
async (request) => {
15581572
return await handleToolCall("nasa/cmr", request.params || {});
@@ -1659,22 +1673,22 @@ async function startServer() {
16591673
}
16601674
);
16611675

1662-
// Earth Handler
1663-
server.setRequestHandler(
1664-
z.object({
1665-
method: z.literal("nasa/earth"),
1666-
params: z.object({
1667-
lon: z.number().or(z.string().regex(/^-?\d+(\.\d+)?$/).transform(Number)),
1668-
lat: z.number().or(z.string().regex(/^-?\d+(\.\d+)?$/).transform(Number)),
1669-
date: z.string().optional(),
1670-
dim: z.number().optional(),
1671-
cloud_score: z.boolean().optional()
1672-
}).optional()
1673-
}),
1674-
async (request) => {
1675-
return await handleToolCall("nasa/earth", request.params || {});
1676-
}
1677-
);
1676+
// Earth Handler - COMMENTED OUT: NASA Earth API is archived and replaced with GIBS
1677+
// server.setRequestHandler(
1678+
// z.object({
1679+
// method: z.literal("nasa/earth"),
1680+
// params: z.object({
1681+
// lon: z.number().or(z.string().regex(/^-?\d+(\.\d+)?$/).transform(Number)),
1682+
// lat: z.number().or(z.string().regex(/^-?\d+(\.\d+)?$/).transform(Number)),
1683+
// date: z.string().optional(),
1684+
// dim: z.number().optional(),
1685+
// cloud_score: z.boolean().optional()
1686+
// }).optional()
1687+
// }),
1688+
// async (request) => {
1689+
// return await handleToolCall("nasa/earth", request.params || {});
1690+
// }
1691+
// );
16781692

16791693
// Scout Handler
16801694
server.setRequestHandler(
@@ -2151,14 +2165,14 @@ export function registerMcpTools() {
21512165
return await handleToolCall('jpl/periodic_orbits', args);
21522166
});
21532167

2154-
// Register Earth tool
2155-
registerGlobalTool('mcp__nasaearth', async (args: Record<string, any>) => {
2156-
serverInstance?.sendLoggingMessage({
2157-
level: "info",
2158-
data: `MCP NASA Earth called with args: ${JSON.stringify(args)}`,
2159-
});
2160-
return await handleToolCall('nasa/earth', args);
2161-
});
2168+
// Register Earth tool - COMMENTED OUT: NASA Earth API is archived and replaced with GIBS
2169+
// registerGlobalTool('mcp__nasaearth', async (args: Record<string, any>) => {
2170+
// serverInstance?.sendLoggingMessage({
2171+
// level: "info",
2172+
// data: `MCP NASA Earth called with args: ${JSON.stringify(args)}`,
2173+
// });
2174+
// return await handleToolCall('nasa/earth', args);
2175+
// });
21622176

21632177
// Register Scout tool
21642178
registerGlobalTool('mcp__jplscout', async (args: Record<string, any>) => {

0 commit comments

Comments
 (0)