Skip to main content
Glama
seoh0711

NASA API Desktop Extension

by seoh0711

get_earth_imagery

Retrieve satellite images of Earth using NASA's API by specifying latitude, longitude, and date. Display detailed visualizations with customizable image size for geographic analysis.

Instructions

NASA의 지구 이미지 API를 통해 위성 이미지를 가져옵니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo날짜 (YYYY-MM-DD)
dimNo이미지 크기 (0.03 ~ 0.5)
latYes위도
lonYes경도

Implementation Reference

  • The handler function for get_earth_imagery. It constructs the NASA Earth Imagery API request using lat, lon, optional date and dim, fetches the imagery, and returns a formatted text response with the image URL.
    async getEarthImagery(args) { const { lat, lon, date, dim = 0.15 } = args; const params = new URLSearchParams({ lat: lat.toString(), lon: lon.toString(), dim: dim.toString(), api_key: this.apiKey, }); if (date) { params.append('date', date); } const response = await fetch(`${this.baseUrl}/planetary/earth/imagery?${params}`); if (!response.ok) { const errorData = await response.json(); throw new Error(`NASA Earth Imagery API 오류: ${errorData.error?.message || '알 수 없는 오류'}`); } // 이미지 데이터를 직접 반환하는 대신 URL을 구성 const imageUrl = `${this.baseUrl}/planetary/earth/imagery?${params}`; return { content: [ { type: 'text', text: `**지구 위성 이미지** 위치: 위도 ${lat}, 경도 ${lon} ${date ? `날짜: ${date}` : '최신 이미지'} 이미지 크기: ${dim} 이미지 URL: ${imageUrl} 이 이미지는 NASA의 Landsat 8 위성에서 촬영된 지구 표면의 위성 이미지입니다.`, }, ], }; }
  • Input schema definition for the get_earth_imagery tool, specifying parameters lat, lon (required), date, and dim.
    inputSchema: { type: 'object', properties: { lat: { type: 'number', description: '위도', }, lon: { type: 'number', description: '경도', }, date: { type: 'string', description: '날짜 (YYYY-MM-DD)', }, dim: { type: 'number', description: '이미지 크기 (0.03 ~ 0.5)', default: 0.15, }, }, required: ['lat', 'lon'], },
  • Registration of the get_earth_imagery tool in the listTools handler, including name, description, and schema.
    { name: 'get_earth_imagery', description: 'NASA의 지구 이미지 API를 통해 위성 이미지를 가져옵니다', inputSchema: { type: 'object', properties: { lat: { type: 'number', description: '위도', }, lon: { type: 'number', description: '경도', }, date: { type: 'string', description: '날짜 (YYYY-MM-DD)', }, dim: { type: 'number', description: '이미지 크기 (0.03 ~ 0.5)', default: 0.15, }, }, required: ['lat', 'lon'], }, },
  • Dispatch case in the CallToolRequestSchema handler that routes to the getEarthImagery method.
    case 'get_earth_imagery': return await this.getEarthImagery(args);

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seoh0711/dxt_nasa'

If you have feedback or need assistance with the MCP directory API, please join our Discord server