Skip to main content
Glama
seoh0711

NASA API Desktop Extension

by seoh0711

search_nasa_images

Search NASA’s image, video, and audio library for space-related media. Specify search queries, media types, and page numbers to find and explore space content directly from NASA’s database.

Instructions

NASA 이미지 및 비디오 라이브러리에서 검색합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_typeNo미디어 타입image
pageNo페이지 번호
qYes검색 쿼리

Implementation Reference

  • The main handler function that executes the tool logic: destructures args, fetches from NASA images API, handles errors, limits results to 10, and returns formatted text content with search results.
      async searchNASAImages(args) {
        const { q, media_type = 'image', page = 1 } = args;
        const params = new URLSearchParams({
          q,
          media_type,
          page: page.toString(),
        });
    
        const response = await fetch(`https://images-api.nasa.gov/search?${params}`);
        const data = await response.json();
    
        if (!response.ok) {
          throw new Error(`NASA Images API 오류: ${data.reason || '알 수 없는 오류'}`);
        }
    
        const items = data.collection.items.slice(0, 10); // 최대 10개 결과만 반환
    
        return {
          content: [
            {
              type: 'text',
              text: `**NASA 이미지 검색 결과** - "${q}"
    
    총 ${data.collection.metadata.total_hits}개의 결과를 찾았습니다. 처음 ${items.length}개를 보여드립니다:
    
    ${items.map((item, index) => `
    ${index + 1}. **${item.data[0].title}**
       - **설명**: ${item.data[0].description || '설명 없음'}
       - **날짜**: ${item.data[0].date_created}
       - **미디어 타입**: ${item.data[0].media_type}
       - **이미지 URL**: ${item.links?.[0]?.href || '이미지 없음'}
       - **NASA ID**: ${item.data[0].nasa_id}
    `).join('')}`,
            },
          ],
        };
      }
  • Input schema definition for the tool, specifying required 'q' parameter and optional media_type and page.
    inputSchema: {
      type: 'object',
      properties: {
        q: {
          type: 'string',
          description: '검색 쿼리',
        },
        media_type: {
          type: 'string',
          enum: ['image', 'video', 'audio'],
          description: '미디어 타입',
          default: 'image',
        },
        page: {
          type: 'number',
          description: '페이지 번호',
          default: 1,
        },
      },
      required: ['q'],
    },
  • Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'search_nasa_images',
      description: 'NASA 이미지 및 비디오 라이브러리에서 검색합니다',
      inputSchema: {
        type: 'object',
        properties: {
          q: {
            type: 'string',
            description: '검색 쿼리',
          },
          media_type: {
            type: 'string',
            enum: ['image', 'video', 'audio'],
            description: '미디어 타입',
            default: 'image',
          },
          page: {
            type: 'number',
            description: '페이지 번호',
            default: 1,
          },
        },
        required: ['q'],
      },
    },
  • Dispatch registration in the CallToolRequestSchema switch statement, mapping the tool name to its handler method.
    case 'search_nasa_images':
      return await this.searchNASAImages(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('검색합니다') without details on permissions, rate limits, pagination (implied by 'page' parameter but not explained), or response format. For a search tool with no annotation coverage, this leaves critical behavioral traits unspecified.

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 function without unnecessary words. It's front-loaded with the core action and resource, making it highly concise and well-structured for quick understanding.

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 (search with parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns, how results are formatted, or any limitations. For a tool with 3 parameters and no structured output information, more context is needed to guide effective use.

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 parameters like 'q' for search query and 'media_type' with enum values. The description adds no additional meaning beyond what's in the schema, such as search syntax or result examples. Baseline 3 is appropriate when the schema handles parameter documentation effectively.

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: searching ('검색합니다') in NASA's image and video library. It specifies the resource (NASA 이미지 및 비디오 라이브러리) and verb, but doesn't distinguish it from sibling tools like get_apod or get_mars_rover_photos, which also retrieve NASA media. This makes it clear but not fully differentiated.

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. It doesn't mention sibling tools or contexts where search_nasa_images is preferred over get_apod (for astronomy photos) or get_mars_rover_photos (for Mars-specific images). Without such context, users must infer usage from the tool name 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