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
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | YYYY-MM-DD 형식의 날짜 (선택사항, 기본값: 오늘) | |
| hd | No | 고해상도 이미지 여부 (기본값: false) |
Implementation Reference
- server/index.js:188-220 (handler)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}` : ''}`, }, ], }; }
- server/index.js:40-53 (schema)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, }, }, }, },
- server/index.js:163-164 (registration)Dispatch registration in the callTool request handler, routing 'get_apod' calls to the getAPOD method.case 'get_apod': return await this.getAPOD(args);