get_satellite_trajectory
Calculate and visualize a satellite's trajectory over a specified time period using the NORAD ID and observer's coordinates for precise tracking and analysis.
Instructions
Get satellite trajectory over time period for visualization
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noradId | Yes | NORAD catalog number of the satellite | |
| observerAlt | No | Observer altitude in meters above sea level | |
| observerLat | Yes | Observer latitude in degrees | |
| observerLng | Yes | Observer longitude in degrees | |
| seconds | No | Time period in seconds for trajectory (max 3600) |
Implementation Reference
- src/server.ts:1105-1135 (handler)Main MCP tool handler: validates args, calls N2YOClient.getSatelliteTrajectory, formats JSON response with trajectory dataprivate async getSatelliteTrajectory(args: any): Promise<CallToolResult> { SatelliteValidator.validatePositionRequest(args); const trajectory = await this.n2yoClient.getSatelliteTrajectory( args.noradId, args.observerLat, args.observerLng, args.observerAlt || 0, args.seconds || 300 ); return { content: [ { type: "text", text: JSON.stringify({ satellite: { noradId: args.noradId }, observer: { latitude: args.observerLat, longitude: args.observerLng, altitude: args.observerAlt || 0, }, timeSpan: args.seconds || 300, trajectory: trajectory, count: trajectory.length, note: "Position data points over time for trajectory visualization" }, null, 2), }, ], }; }
- src/server.ts:317-353 (schema)Input schema definition for the tool, defining parameters, types, validation rules, and requirements{ name: "get_satellite_trajectory", description: "Get satellite trajectory over time period for visualization", inputSchema: { type: "object", properties: { noradId: { type: "string", description: "NORAD catalog number of the satellite", }, observerLat: { type: "number", description: "Observer latitude in degrees", minimum: -90, maximum: 90, }, observerLng: { type: "number", description: "Observer longitude in degrees", minimum: -180, maximum: 180, }, observerAlt: { type: "number", description: "Observer altitude in meters above sea level", default: 0, }, seconds: { type: "number", description: "Time period in seconds for trajectory (max 3600)", default: 300, maximum: 3600, }, }, required: ["noradId", "observerLat", "observerLng"], }, },
- src/server.ts:468-469 (registration)Dispatcher/registration in callTool switch statement that routes to the handlercase "get_satellite_trajectory": return await this.getSatelliteTrajectory(args);
- src/n2yo-client.ts:514-534 (helper)Core helper function that computes trajectory by fetching multiple position snapshots over timeasync getSatelliteTrajectory( noradId: string, observerLat: number, observerLng: number, observerAlt: number = 0, seconds: number = 300 ): Promise<SatellitePosition[]> { // Get multiple positions over time to show trajectory const positions = []; const steps = Math.min(10, Math.max(2, Math.floor(seconds / 30))); // Max 10 points for (let i = 0; i <= steps; i++) { const timeOffset = Math.floor((seconds / steps) * i); const stepPositions = await this.getPositions(noradId, observerLat, observerLng, observerAlt, timeOffset); if (stepPositions.length > 0) { positions.push(stepPositions[0]); } } return positions; }