@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,109 @@
1
+ /**
2
+ * @fileoverview astronomy_get_moon_phase — illuminated fraction, phase name, age,
3
+ * phase angle, and the next four lunar quarters for a given instant.
4
+ * @module mcp-server/tools/definitions/get-moon-phase.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
+ const QUARTER_LABEL = {
11
+ new: 'New Moon',
12
+ first_quarter: 'First Quarter',
13
+ full: 'Full Moon',
14
+ last_quarter: 'Last Quarter',
15
+ };
16
+ export const MoonPhaseOutput = z.object({
17
+ time_utc: z.string().describe('The instant the phase was computed for, in ISO 8601 UTC.'),
18
+ time_local: z
19
+ .string()
20
+ .optional()
21
+ .describe('The same instant in the observer-local timezone with offset, present only when a timezone was supplied.'),
22
+ phase_angle_degrees: z
23
+ .number()
24
+ .describe('Moon phase angle in degrees: 0 = new, 90 = first quarter, 180 = full, 270 = last quarter.'),
25
+ illuminated_fraction: z.number().describe('Fraction of the lunar disc illuminated, 0 to 1.'),
26
+ phase_name: z
27
+ .string()
28
+ .describe('Human-readable phase name (New Moon, Waxing Crescent, First Quarter, …, Waning Crescent).'),
29
+ age_days: z.number().describe('Synodic age in days since the previous new moon.'),
30
+ next_quarters: z
31
+ .array(z
32
+ .object({
33
+ quarter: z
34
+ .enum(['new', 'first_quarter', 'full', 'last_quarter'])
35
+ .describe('Which quarter phase this entry is.'),
36
+ time_utc: z.string().describe('Time of the quarter phase in ISO 8601 UTC.'),
37
+ time_local: z
38
+ .string()
39
+ .optional()
40
+ .describe('Time of the quarter phase in the observer-local timezone, present only when a timezone was supplied.'),
41
+ })
42
+ .describe('A single lunar quarter phase with its timestamp.'))
43
+ .describe('The next four lunar quarter phases (new/first/full/last) in chronological order.'),
44
+ });
45
+ export const getMoonPhaseTool = tool('astronomy_get_moon_phase', {
46
+ title: 'astronomy-mcp-server: get moon phase',
47
+ description: 'Report the Moon phase for an instant: illuminated fraction, phase name, synodic age in days since the new moon, phase angle, and the next four quarter phases (new, first quarter, full, last quarter) with timestamps. Answers "what is the moon phase tonight" and "when is the next full moon" in one call without iteration. The time defaults to now; pass an IANA `timezone` to also receive observer-local timestamps. The phase is geocentric — no observer location is needed.',
48
+ annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
49
+ input: z.object({
50
+ time: z
51
+ .string()
52
+ .optional()
53
+ .describe('Instant to evaluate as an ISO 8601 UTC string, e.g. "2024-12-15T00:00:00Z". Defaults to now.'),
54
+ timezone: z
55
+ .string()
56
+ .optional()
57
+ .describe('IANA timezone for localized output, e.g. "America/Los_Angeles". When omitted, output is UTC-only.'),
58
+ }),
59
+ output: MoonPhaseOutput,
60
+ errors: [
61
+ {
62
+ reason: 'time_out_of_range',
63
+ code: JsonRpcErrorCode.InvalidParams,
64
+ when: "The requested instant is outside the engine's high-accuracy span (≈1900–2100).",
65
+ recovery: 'Use a date between 1900 and 2100 and retry.',
66
+ },
67
+ ],
68
+ handler(input, ctx) {
69
+ const svc = getEphemerisService();
70
+ const timezone = svc.resolveTimezone(input.timezone ?? getServerConfig().defaultTimezone);
71
+ const date = svc.resolveTime(input.time);
72
+ const phase = svc.moonPhase(date, timezone);
73
+ ctx.log.info('Computed moon phase', {
74
+ phaseName: phase.phaseName,
75
+ illuminated: phase.illuminatedFraction,
76
+ });
77
+ const out = {
78
+ time_utc: phase.timeUtc,
79
+ ...(phase.timeLocal ? { time_local: phase.timeLocal } : {}),
80
+ phase_angle_degrees: phase.phaseAngleDegrees,
81
+ illuminated_fraction: phase.illuminatedFraction,
82
+ phase_name: phase.phaseName,
83
+ age_days: phase.ageDays,
84
+ next_quarters: phase.nextQuarters.map((q) => ({
85
+ quarter: q.quarter,
86
+ time_utc: q.timeUtc,
87
+ ...(q.timeLocal ? { time_local: q.timeLocal } : {}),
88
+ })),
89
+ };
90
+ return out;
91
+ },
92
+ format: (r) => {
93
+ const lines = [];
94
+ lines.push(`## Moon — ${r.phase_name}`);
95
+ lines.push(`**Time (UTC):** ${r.time_utc}`);
96
+ if (r.time_local)
97
+ lines.push(`**Time (local):** ${r.time_local}`);
98
+ lines.push(`**Illuminated:** ${(r.illuminated_fraction * 100).toFixed(1)}%`);
99
+ lines.push(`**Phase angle:** ${r.phase_angle_degrees.toFixed(1)}°`);
100
+ lines.push(`**Age:** ${r.age_days.toFixed(1)} days since new moon`);
101
+ lines.push('**Next quarters:**');
102
+ for (const q of r.next_quarters) {
103
+ const localPart = q.time_local ? ` (local ${q.time_local})` : '';
104
+ lines.push(`- ${QUARTER_LABEL[q.quarter]}: ${q.time_utc}${localPart}`);
105
+ }
106
+ return [{ type: 'text', text: lines.join('\n') }];
107
+ },
108
+ });
109
+ //# sourceMappingURL=get-moon-phase.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-moon-phase.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-moon-phase.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;AAEhF,MAAM,aAAa,GAA2B;IAC5C,GAAG,EAAE,UAAU;IACf,aAAa,EAAE,eAAe;IAC9B,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,cAAc;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;IACzF,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yGAAyG,CAC1G;IACH,mBAAmB,EAAE,CAAC;SACnB,MAAM,EAAE;SACR,QAAQ,CACP,2FAA2F,CAC5F;IACH,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IAC5F,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,CACP,2FAA2F,CAC5F;IACH,QAAQ,EAAE,CAA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C,aAAa,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,CAAC,UAAU;YAAE,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;QAClE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC7E,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACpE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;QACpE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACjC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;YAChC,MAAM,SAAS,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,KAAK,CAAC,IAAI,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;QACzE,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,100 @@
1
+ /**
2
+ * @fileoverview astronomy_get_rise_set — rise, set, and culmination times for a body
3
+ * at a location, plus the Sun's three twilight pairs. Handles circumpolar /
4
+ * never-rises cases as null fields with an explanatory note.
5
+ * @module mcp-server/tools/definitions/get-rise-set.tool
6
+ */
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ export declare const RiseSetOutput: z.ZodObject<{
10
+ events: z.ZodArray<z.ZodObject<{
11
+ rise_utc: z.ZodNullable<z.ZodString>;
12
+ set_utc: z.ZodNullable<z.ZodString>;
13
+ transit_utc: z.ZodNullable<z.ZodString>;
14
+ transit_altitude_degrees: z.ZodNullable<z.ZodNumber>;
15
+ rise_local: z.ZodOptional<z.ZodString>;
16
+ set_local: z.ZodOptional<z.ZodString>;
17
+ transit_local: z.ZodOptional<z.ZodString>;
18
+ twilight: z.ZodOptional<z.ZodObject<{
19
+ civil: z.ZodObject<{
20
+ dawn_utc: z.ZodNullable<z.ZodString>;
21
+ dusk_utc: z.ZodNullable<z.ZodString>;
22
+ dawn_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ dusk_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ }, z.core.$strip>;
25
+ nautical: z.ZodObject<{
26
+ dawn_utc: z.ZodNullable<z.ZodString>;
27
+ dusk_utc: z.ZodNullable<z.ZodString>;
28
+ dawn_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ dusk_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
+ }, z.core.$strip>;
31
+ astronomical: z.ZodObject<{
32
+ dawn_utc: z.ZodNullable<z.ZodString>;
33
+ dusk_utc: z.ZodNullable<z.ZodString>;
34
+ dawn_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
+ dusk_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
+ }, z.core.$strip>;
37
+ }, z.core.$strip>>;
38
+ note: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$strip>;
41
+ export type RiseSetOutputType = z.infer<typeof RiseSetOutput>;
42
+ export declare const getRiseSetTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
43
+ body: z.ZodEnum<{
44
+ sun: "sun";
45
+ moon: "moon";
46
+ mercury: "mercury";
47
+ venus: "venus";
48
+ mars: "mars";
49
+ jupiter: "jupiter";
50
+ saturn: "saturn";
51
+ uranus: "uranus";
52
+ neptune: "neptune";
53
+ pluto: "pluto";
54
+ }>;
55
+ latitude: z.ZodNumber;
56
+ longitude: z.ZodNumber;
57
+ elevation: z.ZodDefault<z.ZodNumber>;
58
+ start: z.ZodOptional<z.ZodString>;
59
+ count: z.ZodDefault<z.ZodNumber>;
60
+ timezone: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ events: z.ZodArray<z.ZodObject<{
63
+ rise_utc: z.ZodNullable<z.ZodString>;
64
+ set_utc: z.ZodNullable<z.ZodString>;
65
+ transit_utc: z.ZodNullable<z.ZodString>;
66
+ transit_altitude_degrees: z.ZodNullable<z.ZodNumber>;
67
+ rise_local: z.ZodOptional<z.ZodString>;
68
+ set_local: z.ZodOptional<z.ZodString>;
69
+ transit_local: z.ZodOptional<z.ZodString>;
70
+ twilight: z.ZodOptional<z.ZodObject<{
71
+ civil: z.ZodObject<{
72
+ dawn_utc: z.ZodNullable<z.ZodString>;
73
+ dusk_utc: z.ZodNullable<z.ZodString>;
74
+ dawn_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ dusk_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
76
+ }, z.core.$strip>;
77
+ nautical: z.ZodObject<{
78
+ dawn_utc: z.ZodNullable<z.ZodString>;
79
+ dusk_utc: z.ZodNullable<z.ZodString>;
80
+ dawn_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ dusk_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ }, z.core.$strip>;
83
+ astronomical: z.ZodObject<{
84
+ dawn_utc: z.ZodNullable<z.ZodString>;
85
+ dusk_utc: z.ZodNullable<z.ZodString>;
86
+ dawn_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ dusk_local: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ }, z.core.$strip>;
89
+ }, z.core.$strip>>;
90
+ note: z.ZodOptional<z.ZodString>;
91
+ }, z.core.$strip>>;
92
+ }, z.core.$strip>, readonly [{
93
+ readonly reason: "time_out_of_range";
94
+ readonly code: JsonRpcErrorCode.InvalidParams;
95
+ readonly when: "The requested start instant is outside the engine's high-accuracy span (≈1900–2100).";
96
+ readonly recovery: "Use a start date between 1900 and 2100 and retry.";
97
+ }], {
98
+ readonly totalCount: z.ZodNumber;
99
+ }>;
100
+ //# sourceMappingURL=get-rise-set.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-rise-set.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-rise-set.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwCjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiExB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0HzB,CAAC"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * @fileoverview astronomy_get_rise_set — rise, set, and culmination times for a body
3
+ * at a location, plus the Sun's three twilight pairs. Handles circumpolar /
4
+ * never-rises cases as null fields with an explanatory note.
5
+ * @module mcp-server/tools/definitions/get-rise-set.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 { BODY_NAMES } from '../../../services/ephemeris/types.js';
12
+ /** Map the service's camelCase twilight pair to the snake_case wire shape. */
13
+ function toTwilightPair(p) {
14
+ return {
15
+ dawn_utc: p.dawnUtc,
16
+ dusk_utc: p.duskUtc,
17
+ ...(p.dawnLocal !== undefined ? { dawn_local: p.dawnLocal } : {}),
18
+ ...(p.duskLocal !== undefined ? { dusk_local: p.duskLocal } : {}),
19
+ };
20
+ }
21
+ const TwilightPairSchema = z.object({
22
+ dawn_utc: z
23
+ .string()
24
+ .nullable()
25
+ .describe('Dawn (Sun ascending through the depth) in ISO 8601 UTC, or null if it does not occur.'),
26
+ dusk_utc: z
27
+ .string()
28
+ .nullable()
29
+ .describe('Dusk (Sun descending through the depth) in ISO 8601 UTC, or null if it does not occur.'),
30
+ dawn_local: z
31
+ .string()
32
+ .nullable()
33
+ .optional()
34
+ .describe('Dawn in observer-local time, present only when a timezone was supplied.'),
35
+ dusk_local: z
36
+ .string()
37
+ .nullable()
38
+ .optional()
39
+ .describe('Dusk in observer-local time, present only when a timezone was supplied.'),
40
+ });
41
+ export const RiseSetOutput = z.object({
42
+ events: z
43
+ .array(z
44
+ .object({
45
+ rise_utc: z
46
+ .string()
47
+ .nullable()
48
+ .describe('Rise time in ISO 8601 UTC, or null when the body does not rise in this cycle (e.g. circumpolar).'),
49
+ set_utc: z
50
+ .string()
51
+ .nullable()
52
+ .describe('Set time in ISO 8601 UTC, or null when the body does not set in this cycle.'),
53
+ transit_utc: z
54
+ .string()
55
+ .nullable()
56
+ .describe('Culmination (highest point) time in ISO 8601 UTC, or null when not found.'),
57
+ transit_altitude_degrees: z
58
+ .number()
59
+ .nullable()
60
+ .describe('Maximum altitude in degrees at culmination, or null when not found.'),
61
+ rise_local: z
62
+ .string()
63
+ .optional()
64
+ .describe('Rise time in observer-local time, present only when a timezone was supplied.'),
65
+ set_local: z
66
+ .string()
67
+ .optional()
68
+ .describe('Set time in observer-local time, present only when a timezone was supplied.'),
69
+ transit_local: z
70
+ .string()
71
+ .optional()
72
+ .describe('Culmination time in observer-local time, present only when a timezone was supplied.'),
73
+ twilight: z
74
+ .object({
75
+ civil: TwilightPairSchema.describe('Civil twilight (Sun at −6°) dawn and dusk.'),
76
+ nautical: TwilightPairSchema.describe('Nautical twilight (Sun at −12°) dawn and dusk.'),
77
+ astronomical: TwilightPairSchema.describe('Astronomical twilight (Sun at −18°) dawn and dusk — the dark-sky window.'),
78
+ })
79
+ .optional()
80
+ .describe('The three twilight pairs. Present only when body is "sun".'),
81
+ note: z
82
+ .string()
83
+ .optional()
84
+ .describe('Explanatory note when a rise or set is absent (e.g. "Circumpolar — never sets at this latitude/date.").'),
85
+ })
86
+ .describe('One rise/set/transit cycle, with twilight when the body is the Sun.'))
87
+ .describe('One entry per rise/set/transit cycle, searching forward from the start time.'),
88
+ });
89
+ export const getRiseSetTool = tool('astronomy_get_rise_set', {
90
+ title: 'astronomy-mcp-server: get rise/set times',
91
+ description: 'Compute rise, set, and culmination (transit) times for a body at an observer location, plus the maximum altitude at culmination. For the Sun, also returns the three twilight pairs (civil −6°, nautical −12°, astronomical −18°) so a single call answers "when does the sun set and when is it truly dark." Searches forward from `start` (default today) and returns the next `count` cycles (default 1). Circumpolar or never-rises situations are reported as null rise/set fields with an explanatory note rather than an error — the fact is the answer. Default elevation is 0 m; pass an IANA `timezone` for observer-local times. This server does not geocode — resolve coordinates upstream first.',
92
+ annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
93
+ input: z.object({
94
+ body: z
95
+ .enum(BODY_NAMES)
96
+ .describe('The body to compute rise/set for. Twilight is included only when this is "sun".'),
97
+ latitude: z
98
+ .number()
99
+ .min(-90)
100
+ .max(90)
101
+ .describe('Observer latitude in decimal degrees, north positive.'),
102
+ longitude: z
103
+ .number()
104
+ .min(-180)
105
+ .max(180)
106
+ .describe('Observer longitude in decimal degrees, east positive.'),
107
+ elevation: z
108
+ .number()
109
+ .default(0)
110
+ .describe('Observer elevation in meters above sea level. Default 0.'),
111
+ start: z
112
+ .string()
113
+ .optional()
114
+ .describe('Search start as an ISO 8601 UTC string, e.g. "2024-06-21T00:00:00Z". Defaults to now.'),
115
+ count: z
116
+ .number()
117
+ .int()
118
+ .min(1)
119
+ .max(31)
120
+ .default(1)
121
+ .describe('Number of forward rise/set cycles to return. Default 1, max 31.'),
122
+ timezone: z
123
+ .string()
124
+ .optional()
125
+ .describe('IANA timezone for localized output, e.g. "America/Los_Angeles". When omitted, output is UTC-only.'),
126
+ }),
127
+ output: RiseSetOutput,
128
+ enrichment: {
129
+ totalCount: z.number().describe('Number of rise/set cycles returned.'),
130
+ },
131
+ errors: [
132
+ {
133
+ reason: 'time_out_of_range',
134
+ code: JsonRpcErrorCode.InvalidParams,
135
+ when: "The requested start instant is outside the engine's high-accuracy span (≈1900–2100).",
136
+ recovery: 'Use a start date between 1900 and 2100 and retry.',
137
+ },
138
+ ],
139
+ handler(input, ctx) {
140
+ const svc = getEphemerisService();
141
+ const timezone = svc.resolveTimezone(input.timezone ?? getServerConfig().defaultTimezone);
142
+ const start = svc.resolveTime(input.start);
143
+ const observer = {
144
+ latitude: input.latitude,
145
+ longitude: input.longitude,
146
+ elevation: input.elevation,
147
+ };
148
+ const events = svc.riseSet(input.body, observer, start, input.count, timezone);
149
+ ctx.log.info('Computed rise/set', { body: input.body, cycles: events.length });
150
+ ctx.enrich.total(events.length);
151
+ const out = {
152
+ events: events.map((e) => ({
153
+ rise_utc: e.riseUtc,
154
+ set_utc: e.setUtc,
155
+ transit_utc: e.transitUtc,
156
+ transit_altitude_degrees: e.transitAltitudeDegrees,
157
+ ...(e.riseLocal ? { rise_local: e.riseLocal } : {}),
158
+ ...(e.setLocal ? { set_local: e.setLocal } : {}),
159
+ ...(e.transitLocal ? { transit_local: e.transitLocal } : {}),
160
+ ...(e.twilight
161
+ ? {
162
+ twilight: {
163
+ civil: toTwilightPair(e.twilight.civil),
164
+ nautical: toTwilightPair(e.twilight.nautical),
165
+ astronomical: toTwilightPair(e.twilight.astronomical),
166
+ },
167
+ }
168
+ : {}),
169
+ ...(e.note ? { note: e.note } : {}),
170
+ })),
171
+ };
172
+ return out;
173
+ },
174
+ format: (r) => {
175
+ const lines = [];
176
+ for (const e of r.events) {
177
+ lines.push('## Cycle');
178
+ lines.push(`rise_utc: ${e.rise_utc ?? 'none'}${e.rise_local ? ` | rise_local: ${e.rise_local}` : ''}`);
179
+ lines.push(`set_utc: ${e.set_utc ?? 'none'}${e.set_local ? ` | set_local: ${e.set_local}` : ''}`);
180
+ lines.push(`transit_utc: ${e.transit_utc ?? 'none'}${e.transit_local ? ` | transit_local: ${e.transit_local}` : ''} | transit_altitude_degrees: ${e.transit_altitude_degrees ?? 'none'}`);
181
+ if (e.note)
182
+ lines.push(`note: ${e.note}`);
183
+ if (e.twilight) {
184
+ const fmt = (label, p) => {
185
+ let line = `${label}: dawn_utc ${p.dawn_utc ?? 'none'}, dusk_utc ${p.dusk_utc ?? 'none'}`;
186
+ if (p.dawn_local)
187
+ line += `, dawn_local ${p.dawn_local}`;
188
+ if (p.dusk_local)
189
+ line += `, dusk_local ${p.dusk_local}`;
190
+ return line;
191
+ };
192
+ lines.push(fmt('Civil twilight', e.twilight.civil));
193
+ lines.push(fmt('Nautical twilight', e.twilight.nautical));
194
+ lines.push(fmt('Astronomical twilight', e.twilight.astronomical));
195
+ }
196
+ }
197
+ return [{ type: 'text', text: lines.join('\n') }];
198
+ },
199
+ });
200
+ //# sourceMappingURL=get-rise-set.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-rise-set.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-rise-set.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAA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AC"}
@@ -0,0 +1,77 @@
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 { z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ export declare const SatellitePassesOutput: z.ZodObject<{
10
+ norad_id: z.ZodNumber;
11
+ satellite_name: z.ZodOptional<z.ZodString>;
12
+ passes: z.ZodArray<z.ZodObject<{
13
+ rise_utc: z.ZodString;
14
+ peak_utc: z.ZodString;
15
+ set_utc: z.ZodString;
16
+ rise_local: z.ZodOptional<z.ZodString>;
17
+ peak_local: z.ZodOptional<z.ZodString>;
18
+ set_local: z.ZodOptional<z.ZodString>;
19
+ peak_altitude_degrees: z.ZodNumber;
20
+ rise_azimuth_degrees: z.ZodNumber;
21
+ set_azimuth_degrees: z.ZodNumber;
22
+ peak_azimuth_degrees: z.ZodNumber;
23
+ duration_seconds: z.ZodNumber;
24
+ sunlit: z.ZodBoolean;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>;
27
+ export type SatellitePassesOutputType = z.infer<typeof SatellitePassesOutput>;
28
+ export declare const getSatellitePassesTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
29
+ norad_id: z.ZodNumber;
30
+ latitude: z.ZodNumber;
31
+ longitude: z.ZodNumber;
32
+ elevation: z.ZodDefault<z.ZodNumber>;
33
+ days: z.ZodDefault<z.ZodNumber>;
34
+ start: z.ZodOptional<z.ZodString>;
35
+ timezone: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ norad_id: z.ZodNumber;
38
+ satellite_name: z.ZodOptional<z.ZodString>;
39
+ passes: z.ZodArray<z.ZodObject<{
40
+ rise_utc: z.ZodString;
41
+ peak_utc: z.ZodString;
42
+ set_utc: z.ZodString;
43
+ rise_local: z.ZodOptional<z.ZodString>;
44
+ peak_local: z.ZodOptional<z.ZodString>;
45
+ set_local: z.ZodOptional<z.ZodString>;
46
+ peak_altitude_degrees: z.ZodNumber;
47
+ rise_azimuth_degrees: z.ZodNumber;
48
+ set_azimuth_degrees: z.ZodNumber;
49
+ peak_azimuth_degrees: z.ZodNumber;
50
+ duration_seconds: z.ZodNumber;
51
+ sunlit: z.ZodBoolean;
52
+ }, z.core.$strip>>;
53
+ }, z.core.$strip>, readonly [{
54
+ readonly reason: "invalid_time";
55
+ readonly code: JsonRpcErrorCode.InvalidParams;
56
+ readonly when: "The start timestamp is not a parseable ISO 8601 instant.";
57
+ readonly recovery: "Pass start as an ISO 8601 UTC timestamp, e.g. 2024-01-01T00:00:00Z, then retry.";
58
+ }, {
59
+ readonly reason: "time_out_of_range";
60
+ readonly code: JsonRpcErrorCode.InvalidParams;
61
+ readonly when: "The start instant is outside the SGP4 high-accuracy span (≈1900–2100).";
62
+ readonly recovery: "Use a start date between 1900 and 2100 — TLEs are only accurate within weeks of epoch.";
63
+ }, {
64
+ readonly reason: "tle_not_found";
65
+ readonly code: JsonRpcErrorCode.NotFound;
66
+ readonly when: "CelesTrak has no current element set for the NORAD ID.";
67
+ readonly recovery: "Verify the catalog number at celestrak.org; the object may have decayed or never been catalogued.";
68
+ }, {
69
+ readonly reason: "celestrak_unavailable";
70
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
71
+ readonly when: "The TLE fetch failed after retries.";
72
+ readonly retryable: true;
73
+ readonly recovery: "CelesTrak is degraded or timed out; retry in a few minutes.";
74
+ }], {
75
+ readonly totalCount: z.ZodNumber;
76
+ }>;
77
+ //# sourceMappingURL=get-satellite-passes.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-satellite-passes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-satellite-passes.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;iBAqDhC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkJjC,CAAC"}