Skip to main content
Glama
seoh0711

NASA API Desktop Extension

by seoh0711

get_apod

Retrieve NASA's Astronomy Picture of the Day (APOD) with optional date and HD settings using the NASA API Desktop Extension. Access daily space images easily.

Instructions

NASA의 오늘의 천체 사진(Astronomy Picture of the Day)을 가져옵니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoYYYY-MM-DD 형식의 날짜 (선택사항, 기본값: 오늘)
hdNo고해상도 이미지 여부 (기본값: false)

Implementation Reference

  • The primary handler function for the 'get_apod' tool. Fetches APOD data from NASA API using provided date and HD parameters, handles errors, and returns formatted markdown text content.
    async getAPOD(args) { const { date, hd = false } = args || {}; const params = new URLSearchParams({ api_key: this.apiKey, hd: hd.toString(), }); if (date) { params.append('date', date); } const response = await fetch(`${this.baseUrl}/planetary/apod?${params}`); const data = await response.json(); if (!response.ok) { throw new Error(`NASA API 오류: ${data.error?.message || '알 수 없는 오류'}`); } return { content: [ { type: 'text', text: `**${data.title}** (${data.date}) ${data.explanation} ${data.media_type === 'image' ? `이미지 URL: ${data.url}` : `비디오 URL: ${data.url}`} ${data.copyright ? `저작권: ${data.copyright}` : ''}`, }, ], }; }
  • Input schema definition for the 'get_apod' tool, specifying optional 'date' (string) and 'hd' (boolean) parameters.
    inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'YYYY-MM-DD 형식의 날짜 (선택사항, 기본값: 오늘)', }, hd: { type: 'boolean', description: '고해상도 이미지 여부 (기본값: false)', default: false, }, }, },
  • server/index.js:37-54 (registration)
    Tool registration in the listTools handler, defining name, description, and input schema for 'get_apod'.
    { name: 'get_apod', description: 'NASA의 오늘의 천체 사진(Astronomy Picture of the Day)을 가져옵니다', inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'YYYY-MM-DD 형식의 날짜 (선택사항, 기본값: 오늘)', }, hd: { type: 'boolean', description: '고해상도 이미지 여부 (기본값: false)', default: false, }, }, }, },
  • Dispatch registration in the callTool request handler, routing 'get_apod' calls to the getAPOD method.
    case 'get_apod': return await this.getAPOD(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