get_recent_launches
Retrieve satellites launched within the past 30 days using N2YO Satellite Tracker data to monitor recent space activity.
Instructions
Get satellites launched in the last 30 days
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:276-283 (registration)Tool registration entry defining the name, description, and input schema (no required parameters) for get_recent_launches.
{ name: "get_recent_launches", description: "Get satellites launched in the last 30 days", inputSchema: { type: "object", properties: {}, }, }, - src/server.ts:1057-1073 (handler)Main handler function that invokes the N2YO client to retrieve recent launches and formats the result as a CallToolResult for the MCP protocol.
private async getRecentLaunches(): Promise<CallToolResult> { const launches = await this.n2yoClient.getRecentLaunches(); return { content: [ { type: "text", text: JSON.stringify({ timeRange: "Last 30 days", recentLaunches: launches, count: launches.length, note: "Recently launched satellites with current position data" }, null, 2), }, ], }; } - src/server.ts:462-463 (handler)Dispatch case in callTool method that routes the tool name to the specific handler.
case "get_recent_launches": return await this.getRecentLaunches(); - src/n2yo-client.ts:481-493 (helper)Supporting method in N2YO client that queries the API for satellites launched in the last 30 days.
async getRecentLaunches(): Promise<RecentLaunch[]> { const now = new Date(); const thirtyDaysAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000); const startDate = thirtyDaysAgo.toISOString().split('T')[0]; const endDate = now.toISOString().split('T')[0]; const response = await this.makeRequest(`/launchDate/${startDate}/${endDate}`, { startDate, endDate, }); return response.above || []; }