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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions fetching images from an API but does not cover critical aspects such as authentication requirements, rate limits, error handling, or the format of returned data (e.g., image type, size). This leaves significant gaps in understanding how the tool behaves in practice.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Korean that directly states the tool's purpose without any unnecessary words. It is front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 parameters, no output schema, and no annotations), the description is insufficient. It lacks details on behavioral traits, output format, and usage guidelines, which are crucial for an AI agent to effectively invoke this tool without annotations or output schema to fill the gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters (date, dim, lat, lon) with descriptions and constraints. The description adds no additional parameter semantics beyond what the schema provides, which is acceptable given the high coverage, resulting in a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'fetch satellite images through NASA's Earth imagery API.' It specifies the verb ('fetch') and resource ('satellite images'), and distinguishes it from siblings by mentioning 'Earth imagery' versus astronomical or Mars-related tools. However, it doesn't explicitly differentiate from 'search_nasa_images,' which might overlap in functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_nasa_images' or other sibling tools. It lacks context on use cases, prerequisites, or exclusions, leaving the agent to infer usage based on the tool name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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