@cyanheads/astronomy-mcp-server 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/AGENTS.md +431 -0
  2. package/CLAUDE.md +431 -0
  3. package/Dockerfile +104 -0
  4. package/LICENSE +201 -0
  5. package/README.md +320 -0
  6. package/changelog/0.1.x/0.1.1.md +28 -0
  7. package/changelog/0.1.x/0.1.2.md +16 -0
  8. package/changelog/template.md +127 -0
  9. package/dist/config/server-config.d.ts +22 -0
  10. package/dist/config/server-config.d.ts.map +1 -0
  11. package/dist/config/server-config.js +40 -0
  12. package/dist/config/server-config.js.map +1 -0
  13. package/dist/index.d.ts +11 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +55 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.d.ts +12 -0
  18. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.d.ts.map +1 -0
  19. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js +36 -0
  20. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js.map +1 -0
  21. package/dist/mcp-server/resources/definitions/body.resource.d.ts +29 -0
  22. package/dist/mcp-server/resources/definitions/body.resource.d.ts.map +1 -0
  23. package/dist/mcp-server/resources/definitions/body.resource.js +65 -0
  24. package/dist/mcp-server/resources/definitions/body.resource.js.map +1 -0
  25. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts +157 -0
  26. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts.map +1 -0
  27. package/dist/mcp-server/tools/definitions/find-events.tool.js +242 -0
  28. package/dist/mcp-server/tools/definitions/find-events.tool.js.map +1 -0
  29. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts +62 -0
  30. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts.map +1 -0
  31. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js +161 -0
  32. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js.map +1 -0
  33. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.d.ts +53 -0
  34. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.d.ts.map +1 -0
  35. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js +109 -0
  36. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js.map +1 -0
  37. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts +100 -0
  38. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts.map +1 -0
  39. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js +200 -0
  40. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js.map +1 -0
  41. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts +77 -0
  42. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts.map +1 -0
  43. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js +180 -0
  44. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js.map +1 -0
  45. package/dist/mcp-server/tools/definitions/get-sky-position.tool.d.ts +99 -0
  46. package/dist/mcp-server/tools/definitions/get-sky-position.tool.d.ts.map +1 -0
  47. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js +196 -0
  48. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js.map +1 -0
  49. package/dist/mcp-server/tools/definitions/list-visible.tool.d.ts +104 -0
  50. package/dist/mcp-server/tools/definitions/list-visible.tool.d.ts.map +1 -0
  51. package/dist/mcp-server/tools/definitions/list-visible.tool.js +151 -0
  52. package/dist/mcp-server/tools/definitions/list-visible.tool.js.map +1 -0
  53. package/dist/services/ephemeris/body-data.d.ts +25 -0
  54. package/dist/services/ephemeris/body-data.d.ts.map +1 -0
  55. package/dist/services/ephemeris/body-data.js +24 -0
  56. package/dist/services/ephemeris/body-data.js.map +1 -0
  57. package/dist/services/ephemeris/ephemeris-service.d.ts +93 -0
  58. package/dist/services/ephemeris/ephemeris-service.d.ts.map +1 -0
  59. package/dist/services/ephemeris/ephemeris-service.js +742 -0
  60. package/dist/services/ephemeris/ephemeris-service.js.map +1 -0
  61. package/dist/services/ephemeris/star-catalog.d.ts +17 -0
  62. package/dist/services/ephemeris/star-catalog.d.ts.map +1 -0
  63. package/dist/services/ephemeris/star-catalog.js +273 -0
  64. package/dist/services/ephemeris/star-catalog.js.map +1 -0
  65. package/dist/services/ephemeris/types.d.ts +150 -0
  66. package/dist/services/ephemeris/types.d.ts.map +1 -0
  67. package/dist/services/ephemeris/types.js +33 -0
  68. package/dist/services/ephemeris/types.js.map +1 -0
  69. package/dist/services/horizons/horizons-service.d.ts +47 -0
  70. package/dist/services/horizons/horizons-service.d.ts.map +1 -0
  71. package/dist/services/horizons/horizons-service.js +229 -0
  72. package/dist/services/horizons/horizons-service.js.map +1 -0
  73. package/dist/services/horizons/types.d.ts +21 -0
  74. package/dist/services/horizons/types.d.ts.map +1 -0
  75. package/dist/services/horizons/types.js +6 -0
  76. package/dist/services/horizons/types.js.map +1 -0
  77. package/dist/services/satellite/satellite-service.d.ts +48 -0
  78. package/dist/services/satellite/satellite-service.d.ts.map +1 -0
  79. package/dist/services/satellite/satellite-service.js +231 -0
  80. package/dist/services/satellite/satellite-service.js.map +1 -0
  81. package/dist/services/satellite/types.d.ts +32 -0
  82. package/dist/services/satellite/types.d.ts.map +1 -0
  83. package/dist/services/satellite/types.js +6 -0
  84. package/dist/services/satellite/types.js.map +1 -0
  85. package/package.json +104 -0
  86. package/server.json +139 -0
@@ -0,0 +1,180 @@
1
+ /**
2
+ * @fileoverview astronomy_get_satellite_passes — gated extension. Visible passes of a
3
+ * satellite (by NORAD ID) over an observer, via a CelesTrak TLE propagated with
4
+ * SGP4 offline. Registered only when ASTRONOMY_ENABLE_SATELLITES is set.
5
+ * @module mcp-server/tools/definitions/get-satellite-passes.tool
6
+ */
7
+ import { tool, z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ import { getServerConfig } from '../../../config/server-config.js';
10
+ import { getEphemerisService } from '../../../services/ephemeris/ephemeris-service.js';
11
+ import { getSatelliteService } from '../../../services/satellite/satellite-service.js';
12
+ export const SatellitePassesOutput = z.object({
13
+ norad_id: z.number().describe('The NORAD catalog number echoed from the request.'),
14
+ satellite_name: z
15
+ .string()
16
+ .optional()
17
+ .describe('Satellite name from the TLE header, when present.'),
18
+ passes: z
19
+ .array(z
20
+ .object({
21
+ rise_utc: z
22
+ .string()
23
+ .describe('Acquisition of signal (rise above horizon) in ISO 8601 UTC.'),
24
+ peak_utc: z.string().describe('Time of maximum elevation in ISO 8601 UTC.'),
25
+ set_utc: z.string().describe('Loss of signal (set below horizon) in ISO 8601 UTC.'),
26
+ rise_local: z
27
+ .string()
28
+ .optional()
29
+ .describe('Rise time in observer-local time, present only when a timezone was supplied.'),
30
+ peak_local: z
31
+ .string()
32
+ .optional()
33
+ .describe('Peak time in observer-local time, present only when a timezone was supplied.'),
34
+ set_local: z
35
+ .string()
36
+ .optional()
37
+ .describe('Set time in observer-local time, present only when a timezone was supplied.'),
38
+ peak_altitude_degrees: z
39
+ .number()
40
+ .describe('Maximum elevation angle during the pass, in degrees.'),
41
+ rise_azimuth_degrees: z
42
+ .number()
43
+ .describe('Azimuth at rise, in degrees (0=N, 90=E, 180=S, 270=W).'),
44
+ set_azimuth_degrees: z.number().describe('Azimuth at set, in degrees.'),
45
+ peak_azimuth_degrees: z.number().describe('Azimuth at peak elevation, in degrees.'),
46
+ duration_seconds: z.number().describe('Pass duration from rise to set, in seconds.'),
47
+ sunlit: z
48
+ .boolean()
49
+ .describe('True when the satellite is in sunlight at peak — a precondition for naked-eye visibility.'),
50
+ })
51
+ .describe('One visible pass with rise/peak/set geometry and illumination.'))
52
+ .describe('Visible passes (sunlit satellite over a dark-enough sky) in the requested window, chronological.'),
53
+ });
54
+ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
55
+ title: 'astronomy-mcp-server: get satellite passes',
56
+ description: "Predict visible passes of a satellite (e.g. the ISS, NORAD 25544) over an observer in the next `days`. Fetches the current TLE from CelesTrak, propagates it with SGP4 in-process, and returns each pass's rise, peak, and set times with azimuths and the peak elevation. Only passes that are naked-eye-plausible are returned — the satellite must be sunlit at peak while the observer's sky is dark. NORAD catalog numbers are found at celestrak.org or heavens-above.com. This is a gated, network-backed extension (CelesTrak is keyless but rate-limited; TLEs are cached briefly). Default elevation 0 m; pass an IANA timezone for observer-local pass times.",
57
+ annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
58
+ input: z.object({
59
+ norad_id: z
60
+ .number()
61
+ .int()
62
+ .positive()
63
+ .describe('NORAD catalog number of the satellite, e.g. 25544 for the ISS. Found at celestrak.org or heavens-above.com.'),
64
+ latitude: z
65
+ .number()
66
+ .min(-90)
67
+ .max(90)
68
+ .describe('Observer latitude in decimal degrees, north positive.'),
69
+ longitude: z
70
+ .number()
71
+ .min(-180)
72
+ .max(180)
73
+ .describe('Observer longitude in decimal degrees, east positive.'),
74
+ elevation: z
75
+ .number()
76
+ .default(0)
77
+ .describe('Observer elevation in meters above sea level. Default 0.'),
78
+ days: z
79
+ .number()
80
+ .int()
81
+ .min(1)
82
+ .max(10)
83
+ .default(7)
84
+ .describe('Number of days ahead to search for passes. Default 7, max 10.'),
85
+ start: z
86
+ .string()
87
+ .optional()
88
+ .describe('Search start as an ISO 8601 UTC string. Defaults to now.'),
89
+ timezone: z
90
+ .string()
91
+ .optional()
92
+ .describe('IANA timezone for localized pass times, e.g. "America/Los_Angeles". When omitted, output is UTC-only.'),
93
+ }),
94
+ output: SatellitePassesOutput,
95
+ enrichment: {
96
+ totalCount: z.number().describe('Number of visible passes found in the window.'),
97
+ },
98
+ errors: [
99
+ {
100
+ reason: 'invalid_time',
101
+ code: JsonRpcErrorCode.InvalidParams,
102
+ when: 'The start timestamp is not a parseable ISO 8601 instant.',
103
+ recovery: 'Pass start as an ISO 8601 UTC timestamp, e.g. 2024-01-01T00:00:00Z, then retry.',
104
+ },
105
+ {
106
+ reason: 'time_out_of_range',
107
+ code: JsonRpcErrorCode.InvalidParams,
108
+ when: 'The start instant is outside the SGP4 high-accuracy span (≈1900–2100).',
109
+ recovery: 'Use a start date between 1900 and 2100 — TLEs are only accurate within weeks of epoch.',
110
+ },
111
+ {
112
+ reason: 'tle_not_found',
113
+ code: JsonRpcErrorCode.NotFound,
114
+ when: 'CelesTrak has no current element set for the NORAD ID.',
115
+ recovery: 'Verify the catalog number at celestrak.org; the object may have decayed or never been catalogued.',
116
+ },
117
+ {
118
+ reason: 'celestrak_unavailable',
119
+ code: JsonRpcErrorCode.ServiceUnavailable,
120
+ when: 'The TLE fetch failed after retries.',
121
+ retryable: true,
122
+ recovery: 'CelesTrak is degraded or timed out; retry in a few minutes.',
123
+ },
124
+ ],
125
+ async handler(input, ctx) {
126
+ const satSvc = getSatelliteService();
127
+ const ephSvc = getEphemerisService();
128
+ const timezone = ephSvc.resolveTimezone(input.timezone ?? getServerConfig().defaultTimezone);
129
+ /**
130
+ * resolveTime() validates the instant (invalid_time / time_out_of_range) and returns
131
+ * now when start is omitted — an Invalid Date here would yield NaN SGP4 positions and a
132
+ * silently empty, falsely-successful pass list.
133
+ */
134
+ const start = ephSvc.resolveTime(input.start);
135
+ const observer = {
136
+ latitude: input.latitude,
137
+ longitude: input.longitude,
138
+ elevation: input.elevation,
139
+ };
140
+ const tle = await satSvc.fetchTle(input.norad_id, ctx);
141
+ const formatLocal = timezone ? (d) => ephSvc.formatLocal(d, timezone) : undefined;
142
+ const result = satSvc.predictPasses(tle, input.norad_id, observer, input.days, start, formatLocal);
143
+ ctx.log.info('Predicted satellite passes', {
144
+ noradId: input.norad_id,
145
+ passes: result.passes.length,
146
+ });
147
+ ctx.enrich.total(result.passes.length);
148
+ const out = {
149
+ norad_id: result.noradId,
150
+ ...(result.satelliteName ? { satellite_name: result.satelliteName } : {}),
151
+ passes: result.passes.map((p) => ({
152
+ rise_utc: p.riseUtc,
153
+ peak_utc: p.peakUtc,
154
+ set_utc: p.setUtc,
155
+ ...(p.riseLocal ? { rise_local: p.riseLocal } : {}),
156
+ ...(p.peakLocal ? { peak_local: p.peakLocal } : {}),
157
+ ...(p.setLocal ? { set_local: p.setLocal } : {}),
158
+ peak_altitude_degrees: p.peakAltitudeDegrees,
159
+ rise_azimuth_degrees: p.riseAzimuthDegrees,
160
+ set_azimuth_degrees: p.setAzimuthDegrees,
161
+ peak_azimuth_degrees: p.peakAzimuthDegrees,
162
+ duration_seconds: p.durationSeconds,
163
+ sunlit: p.sunlit,
164
+ })),
165
+ };
166
+ return out;
167
+ },
168
+ format: (r) => {
169
+ const lines = [];
170
+ const nameLabel = r.satellite_name ? `${r.satellite_name} ` : '';
171
+ lines.push(`## ${nameLabel}(NORAD ${r.norad_id}) — ${r.passes.length} visible passes`);
172
+ if (r.passes.length === 0)
173
+ lines.push('No visible passes in the requested window (sunlit satellite over a dark sky).');
174
+ for (const p of r.passes) {
175
+ lines.push(`- rise_utc ${p.rise_utc}${p.rise_local ? ` (local ${p.rise_local})` : ''} az ${p.rise_azimuth_degrees}° → peak_utc ${p.peak_utc}${p.peak_local ? ` (local ${p.peak_local})` : ''} alt ${p.peak_altitude_degrees}° az ${p.peak_azimuth_degrees}° → set_utc ${p.set_utc}${p.set_local ? ` (local ${p.set_local})` : ''} az ${p.set_azimuth_degrees}°, duration ${p.duration_seconds}s, sunlit ${p.sunlit}`);
176
+ }
177
+ return [{ type: 'text', text: lines.join('\n') }];
178
+ },
179
+ });
180
+ //# sourceMappingURL=get-satellite-passes.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-satellite-passes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-satellite-passes.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,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AC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,oBAAoB,gBAAgB,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,qBAAqB,QAAQ,CAAC,CAAC,oBAAoB,eAAe,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,mBAAmB,eAAe,CAAC,CAAC,gBAAgB,aAAa,CAAC,CAAC,MAAM,EAAE,CAC1Y,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @fileoverview astronomy_get_sky_position — apparent topocentric position of one
3
+ * solar-system body or named bright star for an observer and instant.
4
+ * @module mcp-server/tools/definitions/get-sky-position.tool
5
+ */
6
+ import { z } from '@cyanheads/mcp-ts-core';
7
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
8
+ export declare const SkyPositionOutput: z.ZodObject<{
9
+ body: z.ZodString;
10
+ time_utc: z.ZodString;
11
+ time_local: z.ZodOptional<z.ZodString>;
12
+ equatorial: z.ZodObject<{
13
+ ra_hours: z.ZodNumber;
14
+ dec_degrees: z.ZodNumber;
15
+ distance_au: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ horizontal: z.ZodObject<{
18
+ altitude_degrees: z.ZodNumber;
19
+ azimuth_degrees: z.ZodNumber;
20
+ above_horizon: z.ZodBoolean;
21
+ }, z.core.$strip>;
22
+ ecliptic: z.ZodObject<{
23
+ longitude_degrees: z.ZodNumber;
24
+ latitude_degrees: z.ZodNumber;
25
+ }, z.core.$strip>;
26
+ magnitude: z.ZodNullable<z.ZodNumber>;
27
+ angular_diameter_arcsec: z.ZodNullable<z.ZodNumber>;
28
+ phase_angle_degrees: z.ZodNullable<z.ZodNumber>;
29
+ illuminated_fraction: z.ZodNullable<z.ZodNumber>;
30
+ constellation: z.ZodObject<{
31
+ abbreviation: z.ZodString;
32
+ name: z.ZodString;
33
+ }, z.core.$strip>;
34
+ }, z.core.$strip>;
35
+ export type SkyPositionOutputType = z.infer<typeof SkyPositionOutput>;
36
+ export declare const getSkyPositionTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
37
+ body: z.ZodOptional<z.ZodEnum<{
38
+ sun: "sun";
39
+ moon: "moon";
40
+ mercury: "mercury";
41
+ venus: "venus";
42
+ mars: "mars";
43
+ jupiter: "jupiter";
44
+ saturn: "saturn";
45
+ uranus: "uranus";
46
+ neptune: "neptune";
47
+ pluto: "pluto";
48
+ }>>;
49
+ star: z.ZodOptional<z.ZodString>;
50
+ latitude: z.ZodNumber;
51
+ longitude: z.ZodNumber;
52
+ elevation: z.ZodDefault<z.ZodNumber>;
53
+ time: z.ZodOptional<z.ZodString>;
54
+ timezone: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ body: z.ZodString;
57
+ time_utc: z.ZodString;
58
+ time_local: z.ZodOptional<z.ZodString>;
59
+ equatorial: z.ZodObject<{
60
+ ra_hours: z.ZodNumber;
61
+ dec_degrees: z.ZodNumber;
62
+ distance_au: z.ZodNumber;
63
+ }, z.core.$strip>;
64
+ horizontal: z.ZodObject<{
65
+ altitude_degrees: z.ZodNumber;
66
+ azimuth_degrees: z.ZodNumber;
67
+ above_horizon: z.ZodBoolean;
68
+ }, z.core.$strip>;
69
+ ecliptic: z.ZodObject<{
70
+ longitude_degrees: z.ZodNumber;
71
+ latitude_degrees: z.ZodNumber;
72
+ }, z.core.$strip>;
73
+ magnitude: z.ZodNullable<z.ZodNumber>;
74
+ angular_diameter_arcsec: z.ZodNullable<z.ZodNumber>;
75
+ phase_angle_degrees: z.ZodNullable<z.ZodNumber>;
76
+ illuminated_fraction: z.ZodNullable<z.ZodNumber>;
77
+ constellation: z.ZodObject<{
78
+ abbreviation: z.ZodString;
79
+ name: z.ZodString;
80
+ }, z.core.$strip>;
81
+ }, z.core.$strip>, readonly [{
82
+ readonly reason: "time_out_of_range";
83
+ readonly code: JsonRpcErrorCode.InvalidParams;
84
+ readonly when: "The requested instant is outside the engine's high-accuracy span (≈1900–2100).";
85
+ readonly recovery: "Use a date between 1900 and 2100 and retry.";
86
+ }, {
87
+ readonly reason: "star_not_found";
88
+ readonly code: JsonRpcErrorCode.NotFound;
89
+ readonly when: "The `star` name is not present in the bundled bright-star catalog.";
90
+ readonly recovery: "Check the spelling or use a common name or Bayer designation such as \"Sirius\" or \"Polaris\".";
91
+ }, {
92
+ readonly reason: "body_required";
93
+ readonly code: JsonRpcErrorCode.InvalidParams;
94
+ readonly when: "Neither a `body` nor a `star` was supplied.";
95
+ readonly recovery: "Provide a solar-system body via `body` or a star name via `star`.";
96
+ }], undefined>;
97
+ /** Render a position record for content[] — every output field is represented. */
98
+ export declare function formatPosition(r: SkyPositionOutputType): string;
99
+ //# sourceMappingURL=get-sky-position.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-sky-position.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-sky-position.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+D5B,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8F7B,CAAC;AAgCH,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,CAAC,EAAE,qBAAqB,GAAG,MAAM,CA0B/D"}
@@ -0,0 +1,196 @@
1
+ /**
2
+ * @fileoverview astronomy_get_sky_position — apparent topocentric position of one
3
+ * solar-system body or named bright star for an observer and instant.
4
+ * @module mcp-server/tools/definitions/get-sky-position.tool
5
+ */
6
+ import { tool, z } from '@cyanheads/mcp-ts-core';
7
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
8
+ import { getServerConfig } from '../../../config/server-config.js';
9
+ import { getEphemerisService } from '../../../services/ephemeris/ephemeris-service.js';
10
+ import { BODY_NAMES } from '../../../services/ephemeris/types.js';
11
+ export const SkyPositionOutput = z.object({
12
+ body: z.string().describe('The body or star this position is for, echoed from the request.'),
13
+ time_utc: z.string().describe('The instant of the observation in ISO 8601 UTC.'),
14
+ time_local: z
15
+ .string()
16
+ .optional()
17
+ .describe('The same instant in the observer-local timezone with offset, present only when a timezone was supplied.'),
18
+ equatorial: z
19
+ .object({
20
+ ra_hours: z.number().describe('Right ascension in sidereal hours [0,24), equator-of-date.'),
21
+ dec_degrees: z.number().describe('Declination in degrees [-90,90], equator-of-date.'),
22
+ distance_au: z
23
+ .number()
24
+ .describe('Distance from the observer to the body in astronomical units.'),
25
+ })
26
+ .describe('Apparent equatorial coordinates, corrected for precession, nutation, parallax, and aberration.'),
27
+ horizontal: z
28
+ .object({
29
+ altitude_degrees: z
30
+ .number()
31
+ .describe('Angle above (positive) or below (negative) the horizon, refraction-corrected.'),
32
+ azimuth_degrees: z.number().describe('Compass bearing in degrees: 0=N, 90=E, 180=S, 270=W.'),
33
+ above_horizon: z
34
+ .boolean()
35
+ .describe('True when the body is above the horizon (altitude > 0).'),
36
+ })
37
+ .describe('Refraction-corrected horizontal coordinates as seen from the observer.'),
38
+ ecliptic: z
39
+ .object({
40
+ longitude_degrees: z.number().describe('Ecliptic longitude in degrees [0,360).'),
41
+ latitude_degrees: z.number().describe('Ecliptic latitude in degrees [-90,90].'),
42
+ })
43
+ .describe('Ecliptic-of-date coordinates of the body.'),
44
+ magnitude: z
45
+ .number()
46
+ .nullable()
47
+ .describe('Apparent visual magnitude (lower is brighter). Null for bodies where the engine cannot compute it.'),
48
+ angular_diameter_arcsec: z
49
+ .number()
50
+ .nullable()
51
+ .describe('Apparent angular diameter of the disc in arcseconds. Null for point-source convention bodies.'),
52
+ phase_angle_degrees: z
53
+ .number()
54
+ .nullable()
55
+ .describe('Sun-body-observer phase angle in degrees. Null when not applicable (e.g. stars).'),
56
+ illuminated_fraction: z
57
+ .number()
58
+ .nullable()
59
+ .describe('Fraction of the disc illuminated, 0 to 1. Null when not applicable.'),
60
+ constellation: z
61
+ .object({
62
+ abbreviation: z.string().describe('IAU 3-letter constellation abbreviation, e.g. "Ori".'),
63
+ name: z.string().describe('Full constellation name, e.g. "Orion".'),
64
+ })
65
+ .describe('The constellation the body currently falls within.'),
66
+ });
67
+ export const getSkyPositionTool = tool('astronomy_get_sky_position', {
68
+ title: 'astronomy-mcp-server: get sky position',
69
+ description: 'Compute the apparent topocentric position of one solar-system body (sun, moon, mercury through neptune, pluto) or a named bright star for an observer location and instant. Returns equatorial (RA/Dec), refraction-corrected horizontal (altitude/azimuth), and ecliptic coordinates, plus distance, apparent magnitude, angular diameter, phase angle, illuminated fraction, and the constellation it falls in. Positions are parallax- and aberration-corrected for the given observer; default elevation is 0 m and the default time is now. Supply `star` (e.g. "Sirius", "Polaris") instead of `body` to target a catalog star; `body` is ignored when `star` is set. Pass an IANA `timezone` to also receive the observer-local time. This server does not geocode — resolve a place name to latitude/longitude upstream first.',
70
+ annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
71
+ input: z.object({
72
+ body: z
73
+ .enum(BODY_NAMES)
74
+ .optional()
75
+ .describe('Solar-system body to locate. Omit when targeting a named star via `star`.'),
76
+ star: z
77
+ .string()
78
+ .optional()
79
+ .describe('Named bright star to locate (common name or Bayer designation, e.g. "Sirius", "Alpha Centauri"). Takes precedence over `body`.'),
80
+ latitude: z
81
+ .number()
82
+ .min(-90)
83
+ .max(90)
84
+ .describe('Observer latitude in decimal degrees, north positive.'),
85
+ longitude: z
86
+ .number()
87
+ .min(-180)
88
+ .max(180)
89
+ .describe('Observer longitude in decimal degrees, east positive.'),
90
+ elevation: z
91
+ .number()
92
+ .default(0)
93
+ .describe('Observer elevation in meters above sea level. Default 0.'),
94
+ time: z
95
+ .string()
96
+ .optional()
97
+ .describe('Instant of observation as an ISO 8601 UTC string, e.g. "2024-04-08T18:00:00Z". Defaults to now.'),
98
+ timezone: z
99
+ .string()
100
+ .optional()
101
+ .describe('IANA timezone for localized output, e.g. "America/Los_Angeles". When omitted, output is UTC-only.'),
102
+ }),
103
+ output: SkyPositionOutput,
104
+ errors: [
105
+ {
106
+ reason: 'time_out_of_range',
107
+ code: JsonRpcErrorCode.InvalidParams,
108
+ when: "The requested instant is outside the engine's high-accuracy span (≈1900–2100).",
109
+ recovery: 'Use a date between 1900 and 2100 and retry.',
110
+ },
111
+ {
112
+ reason: 'star_not_found',
113
+ code: JsonRpcErrorCode.NotFound,
114
+ when: 'The `star` name is not present in the bundled bright-star catalog.',
115
+ recovery: 'Check the spelling or use a common name or Bayer designation such as "Sirius" or "Polaris".',
116
+ },
117
+ {
118
+ reason: 'body_required',
119
+ code: JsonRpcErrorCode.InvalidParams,
120
+ when: 'Neither a `body` nor a `star` was supplied.',
121
+ recovery: 'Provide a solar-system body via `body` or a star name via `star`.',
122
+ },
123
+ ],
124
+ handler(input, ctx) {
125
+ const svc = getEphemerisService();
126
+ const timezone = svc.resolveTimezone(input.timezone ?? getServerConfig().defaultTimezone);
127
+ const date = svc.resolveTime(input.time);
128
+ const observer = {
129
+ latitude: input.latitude,
130
+ longitude: input.longitude,
131
+ elevation: input.elevation,
132
+ };
133
+ let pos;
134
+ if (input.star && input.star.trim().length > 0) {
135
+ const target = svc.resolveStarTarget(input.star);
136
+ pos = svc.position({ kind: 'star', star: target }, observer, date, timezone);
137
+ }
138
+ else if (input.body) {
139
+ pos = svc.position({ kind: 'body', body: input.body }, observer, date, timezone);
140
+ }
141
+ else {
142
+ throw ctx.fail('body_required', undefined, { ...ctx.recoveryFor('body_required') });
143
+ }
144
+ ctx.log.info('Computed sky position', {
145
+ body: pos.body,
146
+ altitude: pos.horizontal.altitudeDegrees,
147
+ });
148
+ return toOutput(pos);
149
+ },
150
+ format: (result) => [{ type: 'text', text: formatPosition(result) }],
151
+ });
152
+ /** Map the service's camelCase record to the snake_case wire output. */
153
+ function toOutput(pos) {
154
+ return {
155
+ body: pos.body,
156
+ time_utc: pos.timeUtc,
157
+ ...(pos.timeLocal ? { time_local: pos.timeLocal } : {}),
158
+ equatorial: {
159
+ ra_hours: pos.equatorial.raHours,
160
+ dec_degrees: pos.equatorial.decDegrees,
161
+ distance_au: pos.equatorial.distanceAu,
162
+ },
163
+ horizontal: {
164
+ altitude_degrees: pos.horizontal.altitudeDegrees,
165
+ azimuth_degrees: pos.horizontal.azimuthDegrees,
166
+ above_horizon: pos.horizontal.aboveHorizon,
167
+ },
168
+ ecliptic: {
169
+ longitude_degrees: pos.ecliptic.longitudeDegrees,
170
+ latitude_degrees: pos.ecliptic.latitudeDegrees,
171
+ },
172
+ magnitude: pos.magnitude,
173
+ angular_diameter_arcsec: pos.angularDiameterArcsec,
174
+ phase_angle_degrees: pos.phaseAngleDegrees,
175
+ illuminated_fraction: pos.illuminatedFraction,
176
+ constellation: pos.constellation,
177
+ };
178
+ }
179
+ /** Render a position record for content[] — every output field is represented. */
180
+ export function formatPosition(r) {
181
+ const lines = [];
182
+ lines.push(`## ${r.body}`);
183
+ lines.push(`**Time (UTC):** ${r.time_utc}`);
184
+ if (r.time_local)
185
+ lines.push(`**Time (local):** ${r.time_local}`);
186
+ lines.push(`**Equatorial:** RA ${r.equatorial.ra_hours.toFixed(4)} h, Dec ${r.equatorial.dec_degrees.toFixed(4)}°, dist ${r.equatorial.distance_au.toFixed(6)} AU`);
187
+ lines.push(`**Horizontal:** altitude ${r.horizontal.altitude_degrees.toFixed(2)}°, azimuth ${r.horizontal.azimuth_degrees.toFixed(2)}° (${r.horizontal.above_horizon ? 'above' : 'below'} horizon)`);
188
+ lines.push(`**Ecliptic:** longitude ${r.ecliptic.longitude_degrees.toFixed(2)}°, latitude ${r.ecliptic.latitude_degrees.toFixed(2)}°`);
189
+ lines.push(`**Magnitude:** ${r.magnitude === null ? 'unavailable' : r.magnitude.toFixed(2)}`);
190
+ lines.push(`**Angular diameter:** ${r.angular_diameter_arcsec === null ? 'unavailable' : `${r.angular_diameter_arcsec.toFixed(2)}″`}`);
191
+ lines.push(`**Phase angle:** ${r.phase_angle_degrees === null ? 'unavailable' : `${r.phase_angle_degrees.toFixed(2)}°`}`);
192
+ lines.push(`**Illuminated fraction:** ${r.illuminated_fraction === null ? 'unavailable' : `${(r.illuminated_fraction * 100).toFixed(1)}%`}`);
193
+ lines.push(`**Constellation:** ${r.constellation.name} (${r.constellation.abbreviation})`);
194
+ return lines.join('\n');
195
+ }
196
+ //# sourceMappingURL=get-sky-position.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-sky-position.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-sky-position.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAA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GAAG,CAAC,CAAC,CAAC,oBAAoB,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CACjI,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,CAAC,aAAa,CAAC,YAAY,GAAG,CAAC,CAAC;IAC3F,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @fileoverview astronomy_list_visible — the workflow flagship. For a location and
3
+ * instant, iterate every naked-eye body (and optionally catalog stars), filter to
4
+ * above the horizon, rank brightest-and-highest first, annotate each with a
5
+ * visibility note, and gate the whole sky by the Sun's altitude.
6
+ * @module mcp-server/tools/definitions/list-visible.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const ListVisibleOutput: z.ZodObject<{
11
+ sky_condition: z.ZodEnum<{
12
+ dark: "dark";
13
+ daylight: "daylight";
14
+ civil_twilight: "civil_twilight";
15
+ nautical_twilight: "nautical_twilight";
16
+ astronomical_twilight: "astronomical_twilight";
17
+ }>;
18
+ sun_altitude_degrees: z.ZodNumber;
19
+ total_count: z.ZodNumber;
20
+ bodies: z.ZodArray<z.ZodObject<{
21
+ body: z.ZodString;
22
+ time_utc: z.ZodString;
23
+ time_local: z.ZodOptional<z.ZodString>;
24
+ equatorial: z.ZodObject<{
25
+ ra_hours: z.ZodNumber;
26
+ dec_degrees: z.ZodNumber;
27
+ distance_au: z.ZodNumber;
28
+ }, z.core.$strip>;
29
+ horizontal: z.ZodObject<{
30
+ altitude_degrees: z.ZodNumber;
31
+ azimuth_degrees: z.ZodNumber;
32
+ above_horizon: z.ZodBoolean;
33
+ }, z.core.$strip>;
34
+ ecliptic: z.ZodObject<{
35
+ longitude_degrees: z.ZodNumber;
36
+ latitude_degrees: z.ZodNumber;
37
+ }, z.core.$strip>;
38
+ magnitude: z.ZodNullable<z.ZodNumber>;
39
+ angular_diameter_arcsec: z.ZodNullable<z.ZodNumber>;
40
+ phase_angle_degrees: z.ZodNullable<z.ZodNumber>;
41
+ illuminated_fraction: z.ZodNullable<z.ZodNumber>;
42
+ constellation: z.ZodObject<{
43
+ abbreviation: z.ZodString;
44
+ name: z.ZodString;
45
+ }, z.core.$strip>;
46
+ rank: z.ZodNumber;
47
+ visibility_note: z.ZodString;
48
+ }, z.core.$strip>>;
49
+ }, z.core.$strip>;
50
+ export type ListVisibleOutputType = z.infer<typeof ListVisibleOutput>;
51
+ export declare const listVisibleTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
52
+ latitude: z.ZodNumber;
53
+ longitude: z.ZodNumber;
54
+ elevation: z.ZodDefault<z.ZodNumber>;
55
+ time: z.ZodOptional<z.ZodString>;
56
+ timezone: z.ZodOptional<z.ZodString>;
57
+ min_altitude: z.ZodDefault<z.ZodNumber>;
58
+ include_stars: z.ZodDefault<z.ZodBoolean>;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ sky_condition: z.ZodEnum<{
61
+ dark: "dark";
62
+ daylight: "daylight";
63
+ civil_twilight: "civil_twilight";
64
+ nautical_twilight: "nautical_twilight";
65
+ astronomical_twilight: "astronomical_twilight";
66
+ }>;
67
+ sun_altitude_degrees: z.ZodNumber;
68
+ total_count: z.ZodNumber;
69
+ bodies: z.ZodArray<z.ZodObject<{
70
+ body: z.ZodString;
71
+ time_utc: z.ZodString;
72
+ time_local: z.ZodOptional<z.ZodString>;
73
+ equatorial: z.ZodObject<{
74
+ ra_hours: z.ZodNumber;
75
+ dec_degrees: z.ZodNumber;
76
+ distance_au: z.ZodNumber;
77
+ }, z.core.$strip>;
78
+ horizontal: z.ZodObject<{
79
+ altitude_degrees: z.ZodNumber;
80
+ azimuth_degrees: z.ZodNumber;
81
+ above_horizon: z.ZodBoolean;
82
+ }, z.core.$strip>;
83
+ ecliptic: z.ZodObject<{
84
+ longitude_degrees: z.ZodNumber;
85
+ latitude_degrees: z.ZodNumber;
86
+ }, z.core.$strip>;
87
+ magnitude: z.ZodNullable<z.ZodNumber>;
88
+ angular_diameter_arcsec: z.ZodNullable<z.ZodNumber>;
89
+ phase_angle_degrees: z.ZodNullable<z.ZodNumber>;
90
+ illuminated_fraction: z.ZodNullable<z.ZodNumber>;
91
+ constellation: z.ZodObject<{
92
+ abbreviation: z.ZodString;
93
+ name: z.ZodString;
94
+ }, z.core.$strip>;
95
+ rank: z.ZodNumber;
96
+ visibility_note: z.ZodString;
97
+ }, z.core.$strip>>;
98
+ }, z.core.$strip>, readonly [{
99
+ readonly reason: "time_out_of_range";
100
+ readonly code: JsonRpcErrorCode.InvalidParams;
101
+ readonly when: "The requested instant is outside the engine's high-accuracy span (≈1900–2100).";
102
+ readonly recovery: "Use a date between 1900 and 2100 and retry.";
103
+ }], undefined>;
104
+ //# sourceMappingURL=list-visible.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-visible.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/list-visible.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAgBjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe5B,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEtE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAyI1B,CAAC"}