@cyanheads/astronomy-mcp-server 0.4.0 → 0.4.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 (61) hide show
  1. package/AGENTS.md +17 -16
  2. package/CLAUDE.md +17 -16
  3. package/Dockerfile +91 -36
  4. package/README.md +69 -94
  5. package/changelog/0.4.x/0.4.1.md +27 -0
  6. package/changelog/0.4.x/0.4.2.md +37 -0
  7. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js +1 -1
  8. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js.map +1 -1
  9. package/dist/mcp-server/resources/definitions/body.resource.d.ts.map +1 -1
  10. package/dist/mcp-server/resources/definitions/body.resource.js +1 -3
  11. package/dist/mcp-server/resources/definitions/body.resource.js.map +1 -1
  12. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts +31 -4
  13. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts.map +1 -1
  14. package/dist/mcp-server/tools/definitions/find-events.tool.js +99 -25
  15. package/dist/mcp-server/tools/definitions/find-events.tool.js.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts +29 -7
  17. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js +219 -49
  19. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js +1 -0
  22. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts +49 -2
  24. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js +85 -43
  26. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts +28 -4
  28. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js +97 -23
  30. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/get-sky-position.tool.d.ts.map +1 -1
  32. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js +2 -1
  33. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js.map +1 -1
  34. package/dist/mcp-server/tools/definitions/list-visible.tool.d.ts.map +1 -1
  35. package/dist/mcp-server/tools/definitions/list-visible.tool.js +1 -0
  36. package/dist/mcp-server/tools/definitions/list-visible.tool.js.map +1 -1
  37. package/dist/services/ephemeris/ephemeris-service.d.ts +78 -15
  38. package/dist/services/ephemeris/ephemeris-service.d.ts.map +1 -1
  39. package/dist/services/ephemeris/ephemeris-service.js +374 -98
  40. package/dist/services/ephemeris/ephemeris-service.js.map +1 -1
  41. package/dist/services/ephemeris/iso-time.d.ts +2 -2
  42. package/dist/services/ephemeris/iso-time.js +5 -5
  43. package/dist/services/ephemeris/types.d.ts +42 -1
  44. package/dist/services/ephemeris/types.d.ts.map +1 -1
  45. package/dist/services/ephemeris/types.js +16 -0
  46. package/dist/services/ephemeris/types.js.map +1 -1
  47. package/dist/services/horizons/horizons-service.d.ts +25 -3
  48. package/dist/services/horizons/horizons-service.d.ts.map +1 -1
  49. package/dist/services/horizons/horizons-service.js +154 -15
  50. package/dist/services/horizons/horizons-service.js.map +1 -1
  51. package/dist/services/horizons/types.d.ts +8 -4
  52. package/dist/services/horizons/types.d.ts.map +1 -1
  53. package/dist/services/satellite/satellite-service.d.ts +48 -10
  54. package/dist/services/satellite/satellite-service.d.ts.map +1 -1
  55. package/dist/services/satellite/satellite-service.js +215 -102
  56. package/dist/services/satellite/satellite-service.js.map +1 -1
  57. package/dist/services/satellite/types.d.ts +36 -2
  58. package/dist/services/satellite/types.d.ts.map +1 -1
  59. package/dist/services/satellite/types.js.map +1 -1
  60. package/package.json +12 -11
  61. package/server.json +10 -24
@@ -1 +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;AA6CjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsExB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8IzB,CAAC"}
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;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAsEjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8DxB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuLzB,CAAC"}
@@ -1,15 +1,22 @@
1
1
  /**
2
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.
3
+ * at a location, plus the Sun's three twilight pairs per cycle and for the night under
4
+ * way at the start. Handles circumpolar / never-rises cases as null fields with an
5
+ * explanatory note. Serves at most `RISE_SET_PER_CALL` cycles per call and names the
6
+ * exact `start` and `count` that continue a longer request, while that start lies
7
+ * inside the supported span.
5
8
  * @module mcp-server/tools/definitions/get-rise-set.tool
6
9
  */
7
10
  import { tool, z } from '@cyanheads/mcp-ts-core';
8
11
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
12
  import { getServerConfig } from '../../../config/server-config.js';
10
13
  import { num } from '../format-numbers.js';
11
- import { getEphemerisService } from '../../../services/ephemeris/ephemeris-service.js';
14
+ import { getEphemerisService, SUPPORTED_SPAN } from '../../../services/ephemeris/ephemeris-service.js';
12
15
  import { BODY_NAMES } from '../../../services/ephemeris/types.js';
16
+ /** Cycles computed per call; a larger `count` is served this many with a resume notice. */
17
+ const RISE_SET_PER_CALL = 31;
18
+ /** Largest `count` accepted — a year of daily cycles. Past it the schema rejects. */
19
+ const RISE_SET_COUNT_CEILING = 366;
13
20
  /** Map the service's camelCase twilight pair to the snake_case wire shape. */
14
21
  function toTwilightPair(p) {
15
22
  return {
@@ -19,25 +26,38 @@ function toTwilightPair(p) {
19
26
  ...(p.duskLocal !== undefined ? { dusk_local: p.duskLocal } : {}),
20
27
  };
21
28
  }
29
+ /** Map all three depths of a twilight set to the wire shape. */
30
+ function toTwilightSet(t) {
31
+ return {
32
+ civil: toTwilightPair(t.civil),
33
+ nautical: toTwilightPair(t.nautical),
34
+ astronomical: toTwilightPair(t.astronomical),
35
+ };
36
+ }
22
37
  const TwilightPairSchema = z.object({
23
38
  dawn_utc: z
24
39
  .string()
25
40
  .nullable()
26
- .describe("Dawn (Sun ascending through the depth) in ISO 8601 UTC, or null if it does not occur. This is the morning after the cycle's set, ending the night that begins at the dusk beside it — a day later than the cycle's rise, not the dawn before it."),
41
+ .describe("Dawn (Sun ascending through the depth) in ISO 8601 UTC, or null when the night never reaches the depth. It ends the night that begins at the dusk beside it: in a cycle, the morning after that cycle's set, or after its culmination when it has no set — a day later than the cycle's rise, not the dawn before it."),
27
42
  dusk_utc: z
28
43
  .string()
29
44
  .nullable()
30
- .describe("Dusk (Sun descending through the depth) in ISO 8601 UTC, or null if it does not occur. This is the evening of the cycle's set."),
45
+ .describe("Dusk (Sun descending through the depth) in ISO 8601 UTC, or null when the night never reaches the depth. It is the evening the night begins: in a cycle, the evening of that cycle's set, or after its culmination when it has no set."),
31
46
  dawn_local: z
32
47
  .string()
33
48
  .nullable()
34
49
  .optional()
35
- .describe("Dawn in observer-local time — the morning after the cycle's set — present only when a timezone was supplied."),
50
+ .describe('Dawn in observer-local time — the morning that ends the night — present only when a timezone was supplied.'),
36
51
  dusk_local: z
37
52
  .string()
38
53
  .nullable()
39
54
  .optional()
40
- .describe("Dusk in observer-local time — the evening of the cycle's set — present only when a timezone was supplied."),
55
+ .describe('Dusk in observer-local time — the evening that begins the night — present only when a timezone was supplied.'),
56
+ });
57
+ const TwilightSetSchema = z.object({
58
+ civil: TwilightPairSchema.describe('Civil twilight (Sun at −6°): dusk and the following dawn.'),
59
+ nautical: TwilightPairSchema.describe('Nautical twilight (Sun at −12°): dusk and the following dawn.'),
60
+ astronomical: TwilightPairSchema.describe('Astronomical twilight (Sun at −18°): dusk and the following dawn, bounding the dark-sky window.'),
41
61
  });
42
62
  export const RiseSetOutput = z.object({
43
63
  body: z.string().describe('The body these rise/set cycles are for, echoed from the request.'),
@@ -47,7 +67,7 @@ export const RiseSetOutput = z.object({
47
67
  rise_utc: z
48
68
  .string()
49
69
  .nullable()
50
- .describe('Rise time in ISO 8601 UTC, or null when the body does not rise in this cycle — because it is circumpolar, or because it was already above the horizon at the search start, whose rise precedes the search. The accompanying note says which.'),
70
+ .describe('Rise time in ISO 8601 UTC, or null when the body does not rise in this cycle — because it is circumpolar, or because it was already above the horizon when the cycle opened (at the search start, or after a day it never set on), so its rise precedes the cycle. The accompanying note says which.'),
51
71
  set_utc: z
52
72
  .string()
53
73
  .nullable()
@@ -55,7 +75,7 @@ export const RiseSetOutput = z.object({
55
75
  transit_utc: z
56
76
  .string()
57
77
  .nullable()
58
- .describe('Culmination (highest point) time in ISO 8601 UTC, or null when not found.'),
78
+ .describe('Culmination (highest point) time in ISO 8601 UTC, or null when it falls outside this cycle — before its rise, after its set, or before the search start.'),
59
79
  transit_altitude_degrees: z
60
80
  .number()
61
81
  .nullable()
@@ -72,14 +92,7 @@ export const RiseSetOutput = z.object({
72
92
  .string()
73
93
  .optional()
74
94
  .describe('Culmination time in observer-local time, present only when a timezone was supplied.'),
75
- twilight: z
76
- .object({
77
- civil: TwilightPairSchema.describe('Civil twilight (Sun at −6°): dusk and the following dawn.'),
78
- nautical: TwilightPairSchema.describe('Nautical twilight (Sun at −12°): dusk and the following dawn.'),
79
- astronomical: TwilightPairSchema.describe('Astronomical twilight (Sun at −18°): dusk and the following dawn, bounding the dark-sky window.'),
80
- })
81
- .optional()
82
- .describe("The three twilight pairs, present only when body is \"sun\". Each pair spans one night: dusk is the evening of this cycle's set and dawn is the following morning, so a cycle's dawn falls a day after its rise. The dawn before a given sunrise is in the previous cycle's pair — start the search a day earlier to get it."),
95
+ twilight: TwilightSetSchema.optional().describe("The three twilight pairs, present only when body is \"sun\". Each pair spans one night: dusk is the evening of this cycle's set — or, in a cycle with no set, the evening after its culmination — and dawn is the following morning, so a cycle's dawn falls a day after its rise. Each is searched only up to the start of the next cycle's day (its sunrise, or its culmination when it has no rise), so a depth the night never reaches is null. A first cycle with no rise, set, or transit is the rest of the day the search started in, inside or at the edge of a polar night; its pairs can include times before `start` that have passed. The dawn before a given sunrise is in the previous cycle's pair; before the first cycle's sunrise it is in `night_in_progress` when `start` falls in a night that began with a sunset, and otherwise start the search a day earlier to get it."),
83
96
  note: z
84
97
  .string()
85
98
  .optional()
@@ -87,10 +100,11 @@ export const RiseSetOutput = z.object({
87
100
  })
88
101
  .describe('One rise/set/transit cycle, with twilight when the body is the Sun.'))
89
102
  .describe('One entry per rise/set/transit cycle, searching forward from the start time.'),
103
+ night_in_progress: TwilightSetSchema.optional().describe('The night under way at `start`, present only when body is "sun", the Sun is below the horizon at `start`, it set since its last culmination and within the two days before, and it rises within the two days after. The first cycle then opens with the next day — at its sunrise, or its culmination when the Sun does not rise that day — and its twilight is the night after, so this field holds the night the caller is in: for each depth, dusk on the evening of that sunset and dawn before the day of the first cycle begins. Times earlier than `start` are included and have already passed. Each pair is searched only within that night, so a depth the night never reaches is null. Absent when a day the Sun never rose on fell between the last sunset and `start`: that sunset began an earlier night. A continuation call, started one second past the last set of the previous call, repeats here the night the last cycle of that call carried; its `events` do not repeat. Not one of `events` and not counted by `count`.'),
90
104
  });
91
105
  export const getRiseSetTool = tool('astronomy_get_rise_set', {
92
106
  title: 'astronomy-mcp-server: get rise/set times',
93
- 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." Each pair covers the night after the cycle\'s set — dusk that evening, dawn the next morning — so the dawn listed beside a sunrise is the following day\'s; for the dawn before a sunrise, read the previous cycle or start a day earlier. Searches forward from `start` (default today) and returns the next `count` cycles (default 1). When the body is already above the horizon at `start`, the first cycle is the interval in progress: its `set` is the imminent one and its `rise` is null, since that rise precedes the search — so a set is never reported earlier than the rise beside it. 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.',
107
+ 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." Each pair covers the night after the cycle\'s set (after its culmination when it has none) — dusk that evening, dawn the next morning — so the dawn listed beside a sunrise is the following day\'s. A depth a night never reaches (astronomical twilight around midsummer at mid-to-high latitudes) is null for that night. When `start` falls between sunset and sunrise, the first cycle opens at the next sunrise and `night_in_progress` carries the night already under way, dusk through dawn, including times before `start` that have passed; otherwise, for the dawn before a sunrise, read the previous cycle or start a day earlier. Searches forward from `start` (default today) and returns the next `count` cycles (default 1), up to 31 per call: a larger `count`, up to 366, returns the first 31 and a notice naming the exact `start` and `count` that continue the series, or saying no call can when the next cycle starts after 2100; a continuation started just past a sunset repeats in `night_in_progress` the night the last cycle of the previous call carried, while its cycles pick up without overlap. When the body is already above the horizon at `start`, the first cycle is the interval in progress: its `set` is the imminent one and its `rise` is null, since that rise precedes the search — so a set is never reported earlier than the rise beside it. 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. One cycle covers one day: a day the body neither rises nor sets on (polar night, midnight sun) is a cycle of its own, so consecutive cycles are consecutive days and each night appears in exactly one cycle. When `start` falls after the culmination of such a polar-night day, or after the last sunset before one, the first cycle is the rest of that day — rise, set, and transit null — carrying the twilight of that night, including times before `start` that have passed. Default elevation is 0 m; pass an IANA `timezone` for observer-local times. This server does not geocode — resolve coordinates upstream first.',
94
108
  annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
95
109
  input: z.object({
96
110
  body: z
@@ -118,9 +132,9 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
118
132
  .number()
119
133
  .int()
120
134
  .min(1)
121
- .max(31)
135
+ .max(RISE_SET_COUNT_CEILING)
122
136
  .default(1)
123
- .describe('Number of forward rise/set cycles to return. Default 1, max 31.'),
137
+ .describe(`Number of forward rise/set cycles to return. Default 1. At most ${RISE_SET_PER_CALL} are computed per call; a count up to ${RISE_SET_COUNT_CEILING} returns the first ${RISE_SET_PER_CALL} with a notice naming the \`start\` and \`count\` that continue the series.`),
124
138
  timezone: z
125
139
  .string()
126
140
  .optional()
@@ -129,6 +143,16 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
129
143
  output: RiseSetOutput,
130
144
  enrichment: {
131
145
  totalCount: z.number().describe('Number of rise/set cycles returned.'),
146
+ truncated: z
147
+ .boolean()
148
+ .optional()
149
+ .describe('True when `count` exceeded the per-call cap and only the first cycles came back.'),
150
+ shown: z.number().optional().describe('Number of cycles returned when the cap applied.'),
151
+ cap: z.number().optional().describe('The per-call cycle cap that was applied.'),
152
+ notice: z
153
+ .string()
154
+ .optional()
155
+ .describe('How to retrieve the cycles the per-call cap held back: the exact `start` and `count` to re-call with, or — when the next cycle starts after 2100, the end of the supported span — that no call can continue the series. Absent when every requested cycle came back.'),
132
156
  },
133
157
  errors: [
134
158
  {
@@ -144,6 +168,7 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
144
168
  reason: 'time_out_of_range',
145
169
  code: JsonRpcErrorCode.InvalidParams,
146
170
  when: "The requested start instant is outside the engine's high-accuracy span (≈1900–2100).",
171
+ // resolveTime() throws this reason with no hint, so this string is the wire hint.
147
172
  recovery: 'Use a start date between 1900 and 2100 and retry.',
148
173
  thrownBy: 'service',
149
174
  },
@@ -165,9 +190,26 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
165
190
  longitude: input.longitude,
166
191
  elevation: input.elevation,
167
192
  };
168
- const events = svc.riseSet(input.body, observer, start, input.count, timezone);
193
+ const served = Math.min(input.count, RISE_SET_PER_CALL);
194
+ const { events, nightInProgress, resumeAt } = svc.riseSetSearch(input.body, observer, start, served, timezone);
169
195
  ctx.log.info('Computed rise/set', { body: input.body, cycles: events.length });
170
196
  ctx.enrich.total(events.length);
197
+ if (input.count > served) {
198
+ /**
199
+ * `resumeAt` is where the cycle loop itself would continue, so a call from there
200
+ * returns the next cycles exactly — none repeated, none skipped. The loop computes
201
+ * cycles past 2100 but `start` must lie inside the span, so a resume instant past it
202
+ * names no call: that one would fail time_out_of_range.
203
+ */
204
+ const returned = `Returned ${events.length} of the ${input.count} requested cycles (${RISE_SET_PER_CALL} per call).`;
205
+ ctx.enrich.truncated({
206
+ shown: events.length,
207
+ cap: RISE_SET_PER_CALL,
208
+ guidance: resumeAt.getUTCFullYear() > SUPPORTED_SPAN.lastYear
209
+ ? `${returned} The next cycle starts past the end of the supported span (${SUPPORTED_SPAN.lastYear}), so no call can continue the series.`
210
+ : `${returned} Re-call with start ${resumeAt.toISOString()} and count ${input.count - events.length} for the rest.`,
211
+ });
212
+ }
171
213
  const out = {
172
214
  body: input.body,
173
215
  events: events.map((e) => ({
@@ -178,17 +220,10 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
178
220
  ...(e.riseLocal ? { rise_local: e.riseLocal } : {}),
179
221
  ...(e.setLocal ? { set_local: e.setLocal } : {}),
180
222
  ...(e.transitLocal ? { transit_local: e.transitLocal } : {}),
181
- ...(e.twilight
182
- ? {
183
- twilight: {
184
- civil: toTwilightPair(e.twilight.civil),
185
- nautical: toTwilightPair(e.twilight.nautical),
186
- astronomical: toTwilightPair(e.twilight.astronomical),
187
- },
188
- }
189
- : {}),
223
+ ...(e.twilight ? { twilight: toTwilightSet(e.twilight) } : {}),
190
224
  ...(e.note ? { note: e.note } : {}),
191
225
  })),
226
+ ...(nightInProgress ? { night_in_progress: toTwilightSet(nightInProgress) } : {}),
192
227
  };
193
228
  return out;
194
229
  },
@@ -196,6 +231,24 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
196
231
  const count = r.events.length;
197
232
  const lines = [`## ${r.body} — ${count} rise/set cycle${count === 1 ? '' : 's'}`];
198
233
  const stamp = (utc, local) => `${utc ?? 'none'}${local ? ` (local ${local})` : ''}`;
234
+ const twilightLines = (t) => {
235
+ const fmt = (label, p) => {
236
+ let line = ` ${label}: dawn ${p.dawn_utc ?? 'none'}, dusk ${p.dusk_utc ?? 'none'}`;
237
+ if (p.dawn_local)
238
+ line += `, dawn local ${p.dawn_local}`;
239
+ if (p.dusk_local)
240
+ line += `, dusk local ${p.dusk_local}`;
241
+ return line;
242
+ };
243
+ return [
244
+ fmt('Civil twilight', t.civil),
245
+ fmt('Nautical twilight', t.nautical),
246
+ fmt('Astronomical twilight', t.astronomical),
247
+ ];
248
+ };
249
+ if (r.night_in_progress) {
250
+ lines.push('Night in progress (under way at the search start; times before the start have already passed):', ...twilightLines(r.night_in_progress));
251
+ }
199
252
  r.events.forEach((e, i) => {
200
253
  const alt = e.transit_altitude_degrees === null
201
254
  ? ''
@@ -203,19 +256,8 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
203
256
  lines.push(`${i + 1}. Rise ${stamp(e.rise_utc, e.rise_local)} · Set ${stamp(e.set_utc, e.set_local)} · Transit ${stamp(e.transit_utc, e.transit_local)}${alt}`);
204
257
  if (e.note)
205
258
  lines.push(` ${e.note}`);
206
- if (e.twilight) {
207
- const fmt = (label, p) => {
208
- let line = ` ${label}: dawn ${p.dawn_utc ?? 'none'}, dusk ${p.dusk_utc ?? 'none'}`;
209
- if (p.dawn_local)
210
- line += `, dawn local ${p.dawn_local}`;
211
- if (p.dusk_local)
212
- line += `, dusk local ${p.dusk_local}`;
213
- return line;
214
- };
215
- lines.push(fmt('Civil twilight', e.twilight.civil));
216
- lines.push(fmt('Nautical twilight', e.twilight.nautical));
217
- lines.push(fmt('Astronomical twilight', e.twilight.astronomical));
218
- }
259
+ if (e.twilight)
260
+ lines.push(...twilightLines(e.twilight));
219
261
  });
220
262
  return [{ type: 'text', text: lines.join('\n') }];
221
263
  },
@@ -1 +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,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,sCA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AAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,CACtC,CAAC;QACJ,CAAC;QACD,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACxB,MAAM,GAAG,GACP,CAAC,CAAC,wBAAwB,KAAK,IAAI;gBACjC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;YAC7D,KAAK,CAAC,IAAI,CACR,GAAG,CAAC,GAAG,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,GAAG,EAAE,CACpJ,CAAC;YACF,IAAI,CAAC,CAAC,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,CAAC,QAAQ;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -1,8 +1,11 @@
1
1
  /**
2
2
  * @fileoverview astronomy_get_satellite_passes — gated extension. Visible passes of a
3
3
  * satellite (by NORAD catalog number, or by a name resolved against the catalog) over
4
- * an observer, via a CelesTrak GP element set propagated with SGP4 offline. Registered
5
- * only when ASTRONOMY_ENABLE_SATELLITES is set.
4
+ * an observer, via a CelesTrak GP element set propagated with SGP4 offline, each with
5
+ * the stretch of it visible to the naked eye. Searches at most
6
+ * `SATELLITE_DAYS_PER_CALL` days per call and names the exact `start` and `days` that
7
+ * continue a longer request, while that start stays inside the element set's epoch
8
+ * horizon. Registered only when ASTRONOMY_ENABLE_SATELLITES is set.
6
9
  * @module mcp-server/tools/definitions/get-satellite-passes.tool
7
10
  */
8
11
  import { z } from '@cyanheads/mcp-ts-core';
@@ -24,6 +27,14 @@ export declare const SatellitePassesOutput: z.ZodObject<{
24
27
  peak_azimuth_degrees: z.ZodNumber;
25
28
  duration_seconds: z.ZodNumber;
26
29
  sunlit: z.ZodBoolean;
30
+ visible_start_utc: z.ZodString;
31
+ visible_end_utc: z.ZodString;
32
+ visible_start_local: z.ZodOptional<z.ZodString>;
33
+ visible_end_local: z.ZodOptional<z.ZodString>;
34
+ visible_start_altitude_degrees: z.ZodNumber;
35
+ visible_end_altitude_degrees: z.ZodNumber;
36
+ visible_start_azimuth_degrees: z.ZodNumber;
37
+ visible_end_azimuth_degrees: z.ZodNumber;
27
38
  }, z.core.$strip>>;
28
39
  }, z.core.$strip>;
29
40
  export type SatellitePassesOutputType = z.infer<typeof SatellitePassesOutput>;
@@ -53,6 +64,14 @@ export declare const getSatellitePassesTool: import("@cyanheads/mcp-ts-core").To
53
64
  peak_azimuth_degrees: z.ZodNumber;
54
65
  duration_seconds: z.ZodNumber;
55
66
  sunlit: z.ZodBoolean;
67
+ visible_start_utc: z.ZodString;
68
+ visible_end_utc: z.ZodString;
69
+ visible_start_local: z.ZodOptional<z.ZodString>;
70
+ visible_end_local: z.ZodOptional<z.ZodString>;
71
+ visible_start_altitude_degrees: z.ZodNumber;
72
+ visible_end_altitude_degrees: z.ZodNumber;
73
+ visible_start_azimuth_degrees: z.ZodNumber;
74
+ visible_end_azimuth_degrees: z.ZodNumber;
56
75
  }, z.core.$strip>>;
57
76
  }, z.core.$strip>, readonly [{
58
77
  readonly reason: "invalid_time";
@@ -63,8 +82,12 @@ export declare const getSatellitePassesTool: import("@cyanheads/mcp-ts-core").To
63
82
  }, {
64
83
  readonly reason: "time_out_of_range";
65
84
  readonly code: JsonRpcErrorCode.InvalidParams;
66
- readonly when: "The start instant is outside the SGP4 high-accuracy span (≈1900–2100), or more than about a month from the epoch of the current element set — checked on the epoch distance itself, since SGP4 keeps returning positions well past the point where the mean elements describe the orbit.";
67
- readonly recovery: "Request a start within about a month of today — element sets only describe the orbit for weeks around their epoch.";
85
+ readonly when: "The start instant falls outside the years 1900–2100, or more than about a month from the epoch of the current element set — checked on the epoch distance itself, since SGP4 keeps returning positions well past the point where the mean elements describe the orbit.";
86
+ /**
87
+ * Both checks send this hint: resolveTime()'s year-span rejection carries none, so the
88
+ * framework fills it, and SatelliteService writes it verbatim at the epoch-distance throw.
89
+ */
90
+ readonly recovery: "An element set describes the orbit for weeks either side of its epoch — request a start within about a month of today.";
68
91
  readonly thrownBy: "service";
69
92
  }, {
70
93
  readonly reason: "invalid_timezone";
@@ -116,5 +139,6 @@ export declare const getSatellitePassesTool: import("@cyanheads/mcp-ts-core").To
116
139
  readonly thrownBy: "service";
117
140
  }], {
118
141
  readonly totalCount: z.ZodNumber;
142
+ readonly notice: z.ZodOptional<z.ZodString>;
119
143
  }>;
120
144
  //# sourceMappingURL=get-satellite-passes.tool.d.ts.map
@@ -1 +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;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;iBA2DhC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8PjC,CAAC"}
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;;;;;;;;;GASG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAYjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiHhC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyG7B;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6LP,CAAC"}
@@ -1,8 +1,11 @@
1
1
  /**
2
2
  * @fileoverview astronomy_get_satellite_passes — gated extension. Visible passes of a
3
3
  * satellite (by NORAD catalog number, or by a name resolved against the catalog) over
4
- * an observer, via a CelesTrak GP element set propagated with SGP4 offline. Registered
5
- * only when ASTRONOMY_ENABLE_SATELLITES is set.
4
+ * an observer, via a CelesTrak GP element set propagated with SGP4 offline, each with
5
+ * the stretch of it visible to the naked eye. Searches at most
6
+ * `SATELLITE_DAYS_PER_CALL` days per call and names the exact `start` and `days` that
7
+ * continue a longer request, while that start stays inside the element set's epoch
8
+ * horizon. Registered only when ASTRONOMY_ENABLE_SATELLITES is set.
6
9
  * @module mcp-server/tools/definitions/get-satellite-passes.tool
7
10
  */
8
11
  import { tool, z } from '@cyanheads/mcp-ts-core';
@@ -11,6 +14,10 @@ import { getServerConfig } from '../../../config/server-config.js';
11
14
  import { num } from '../format-numbers.js';
12
15
  import { getEphemerisService } from '../../../services/ephemeris/ephemeris-service.js';
13
16
  import { getSatelliteService } from '../../../services/satellite/satellite-service.js';
17
+ /** Days searched per call; a larger `days` is served this many with a resume notice. */
18
+ const SATELLITE_DAYS_PER_CALL = 10;
19
+ /** Largest `days` accepted — the element set's own month-long reach. Past it the schema rejects. */
20
+ const SATELLITE_DAYS_CEILING = 30;
14
21
  export const SatellitePassesOutput = z.object({
15
22
  norad_id: z.number().describe('The NORAD catalog number echoed from the request.'),
16
23
  satellite_name: z
@@ -26,9 +33,13 @@ export const SatellitePassesOutput = z.object({
26
33
  .object({
27
34
  rise_utc: z
28
35
  .string()
29
- .describe('Acquisition of signal (rise above horizon) in ISO 8601 UTC.'),
30
- peak_utc: z.string().describe('Time of maximum elevation in ISO 8601 UTC.'),
31
- set_utc: z.string().describe('Loss of signal (set below horizon) in ISO 8601 UTC.'),
36
+ .describe('Rise above the horizon in ISO 8601 UTC, within 1 s of the true crossing. Can fall up to 30 s before `start` when the satellite rose inside the 30-second scan step ending at `start`.'),
37
+ peak_utc: z
38
+ .string()
39
+ .describe('Time of maximum elevation in ISO 8601 UTC, the highest sample of a 30-second scan.'),
40
+ set_utc: z
41
+ .string()
42
+ .describe('Set below the horizon in ISO 8601 UTC, within 1 s of the true crossing.'),
32
43
  rise_local: z
33
44
  .string()
34
45
  .optional()
@@ -43,23 +54,51 @@ export const SatellitePassesOutput = z.object({
43
54
  .describe('Set time in observer-local time, present only when a timezone was supplied.'),
44
55
  peak_altitude_degrees: z
45
56
  .number()
46
- .describe('Maximum elevation angle during the pass, in degrees.'),
57
+ .describe('Maximum elevation angle during the pass, in degrees, as sampled every 30 seconds.'),
47
58
  rise_azimuth_degrees: z
48
59
  .number()
49
- .describe('Azimuth at rise, in degrees (0=N, 90=E, 180=S, 270=W).'),
50
- set_azimuth_degrees: z.number().describe('Azimuth at set, in degrees.'),
60
+ .describe('Azimuth at `rise_utc`, in degrees (0=N, 90=E, 180=S, 270=W).'),
61
+ set_azimuth_degrees: z.number().describe('Azimuth at `set_utc`, in degrees.'),
51
62
  peak_azimuth_degrees: z.number().describe('Azimuth at peak elevation, in degrees.'),
52
- duration_seconds: z.number().describe('Pass duration from rise to set, in seconds.'),
63
+ duration_seconds: z
64
+ .number()
65
+ .describe('Pass duration from `rise_utc` to `set_utc`, in seconds.'),
53
66
  sunlit: z
54
67
  .boolean()
55
- .describe('True when the satellite is in sunlight at peak — a precondition for naked-eye visibility.'),
68
+ .describe("True when the satellite is in sunlight at the peak instant. False on a pass that enters Earth's shadow before its peak or leaves it after — the visible_* fields say when it can be seen."),
69
+ visible_start_utc: z
70
+ .string()
71
+ .describe("Start of the visible stretch — above the horizon, sunlit, over a dark sky — in ISO 8601 UTC. Equals `rise_utc` when the pass is visible from its rise; otherwise within 1 s of the moment it leaves Earth's shadow or the sky darkens."),
72
+ visible_end_utc: z
73
+ .string()
74
+ .describe("End of the visible stretch in ISO 8601 UTC. Equals `set_utc` when the pass is visible until it sets; otherwise within 1 s of the moment it enters Earth's shadow or the sky brightens."),
75
+ visible_start_local: z
76
+ .string()
77
+ .optional()
78
+ .describe('Visible-stretch start in observer-local time, present only when a timezone was supplied.'),
79
+ visible_end_local: z
80
+ .string()
81
+ .optional()
82
+ .describe('Visible-stretch end in observer-local time, present only when a timezone was supplied.'),
83
+ visible_start_altitude_degrees: z
84
+ .number()
85
+ .describe('Elevation where the visible stretch starts, in degrees — 0 when it starts at the rise.'),
86
+ visible_end_altitude_degrees: z
87
+ .number()
88
+ .describe('Elevation where the visible stretch ends, in degrees — 0 when it ends at the set.'),
89
+ visible_start_azimuth_degrees: z
90
+ .number()
91
+ .describe('Azimuth where the visible stretch starts, in degrees — where to look first.'),
92
+ visible_end_azimuth_degrees: z
93
+ .number()
94
+ .describe('Azimuth where the visible stretch ends, in degrees.'),
56
95
  })
57
- .describe('One visible pass with rise/peak/set geometry and illumination.'))
58
- .describe('Visible passes (sunlit satellite over a dark-enough sky) in the requested window, chronological.'),
96
+ .describe('One visible pass: horizon-to-horizon rise/peak/set geometry, illumination at peak, and the stretch of the pass that is visible to the naked eye.'))
97
+ .describe('Passes whose visible stretch — the satellite above the horizon and sunlit while the Sun is below −6° for the observer — reaches 10° elevation, in the window searched, chronological.'),
59
98
  });
60
99
  export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
61
100
  title: 'astronomy-mcp-server: get satellite passes',
62
- description: "Predict visible passes of a satellite (e.g. the ISS, NORAD 25544) over an observer in the next `days`. Identify the satellite by exactly one of `norad_id` or `name` — supplying both, or neither, is rejected. A few well-known common names resolve directly to their catalog numbers, ignoring case: ISS or International Space Station (25544), Hubble, Hubble Space Telescope, or HST (20580), and Tiangong, CSS, or Chinese Space Station (48274). Any other `name` is matched as a case-insensitive substring of CelesTrak's catalog names, so it resolves only when it picks out a single object: a broader query comes back with the matching objects and their catalog numbers to choose from. Either way the result echoes the query that resolved it as `resolved_from_name`. Fetches the object's current GP element set 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. Every returned pass rises within the requested window: a pass already underway at `start` is omitted rather than reported with `start` as its rise, so back up `start` to see it, while a pass still up when the window ends is reported through its actual set. A `start` further than about a month from the element set's epoch is rejected as out of range on that distance alone, and an element set that will not propagate to a window inside that horizon is rejected as a reentry — so an empty `passes` means only that nothing was visible. CelesTrak publishes only current element sets, so in practice `start` must be within about a month of today. NORAD catalog numbers and catalog names are found at celestrak.org or heavens-above.com. This is a gated, network-backed extension (CelesTrak is keyless but rate-limited; element sets are cached briefly). Default elevation 0 m; pass an IANA timezone for observer-local pass times.",
101
+ description: "Predict visible passes of a satellite (e.g. the ISS, NORAD 25544) over an observer in the next `days`. Identify the satellite by exactly one of `norad_id` or `name` — supplying both, or neither, is rejected. A few well-known common names resolve directly to their catalog numbers, ignoring case: ISS or International Space Station (25544), Hubble, Hubble Space Telescope, or HST (20580), and Tiangong, CSS, or Chinese Space Station (48274). Any other `name` is matched as a case-insensitive substring of CelesTrak's catalog names, so it resolves only when it picks out a single object: a broader query comes back with the matching objects and their catalog numbers to choose from. Either way the result echoes the query that resolved it as `resolved_from_name`. Fetches the object's current GP element set from CelesTrak, propagates it with SGP4 in-process, and returns each pass's rise, peak, and set times with azimuths and the peak elevation, plus the stretch of the pass visible to the naked eye: `visible_start_utc` through `visible_end_utc`, with the elevation and azimuth at each end. A pass is returned when that visible stretch — the satellite above the horizon and sunlit while the Sun is below −6° for the observer — reaches 10° elevation, wherever in the pass it falls. `sunlit` reports illumination at the peak instant, so it is false on a pass seen only before it enters Earth's shadow or after it leaves. Rise, set, and the visible-stretch edges are within 1 s of the true instants; the peak is the highest sample of a 30-second scan. Every returned pass rises in the requested window or in the 30 s before `start`: a pass up longer than that at `start` is omitted rather than reported with `start` as its rise, so back up `start` to see it, while a pass still up when the window ends is reported through its actual set. Searches at most 10 days per call: a larger `days`, up to 30, searches the first 10 and returns a notice naming the exact `start` and `days` that continue the search with no pass repeated or skipped, while that start stays within about a month of the element set's epoch. A `start` further than about a month from the element set's epoch is rejected as out of range on that distance alone, and an element set that will not propagate to a window inside that horizon is rejected as a reentry — so an empty `passes` means only that nothing was visible. CelesTrak publishes only current element sets, so in practice `start` must be within about a month of today. NORAD catalog numbers and catalog names are found at celestrak.org or heavens-above.com. This is a gated, network-backed extension (CelesTrak is keyless but rate-limited; element sets are cached briefly). Default elevation 0 m; pass an IANA timezone for observer-local pass times.",
63
102
  annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
64
103
  input: z
65
104
  .object({
@@ -91,9 +130,9 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
91
130
  .number()
92
131
  .int()
93
132
  .min(1)
94
- .max(10)
133
+ .max(SATELLITE_DAYS_CEILING)
95
134
  .default(7)
96
- .describe('Number of days ahead to search for passes. Default 7, max 10.'),
135
+ .describe(`Number of days ahead to search for passes. Default 7. At most ${SATELLITE_DAYS_PER_CALL} are searched per call; a value up to ${SATELLITE_DAYS_CEILING} searches the first ${SATELLITE_DAYS_PER_CALL} with a notice naming the \`start\` and \`days\` that continue the search.`),
97
136
  start: z
98
137
  .string()
99
138
  .optional()
@@ -128,7 +167,11 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
128
167
  }),
129
168
  output: SatellitePassesOutput,
130
169
  enrichment: {
131
- totalCount: z.number().describe('Number of visible passes found in the window.'),
170
+ totalCount: z.number().describe('Number of visible passes found in the window searched.'),
171
+ notice: z
172
+ .string()
173
+ .optional()
174
+ .describe("How to search the days the per-call cap held back: the exact `start` and `days` to re-call with, or — when that start would lie more than about a month from the element set's epoch — that no call can search them. Absent when every requested day was searched."),
132
175
  },
133
176
  errors: [
134
177
  {
@@ -143,8 +186,12 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
143
186
  {
144
187
  reason: 'time_out_of_range',
145
188
  code: JsonRpcErrorCode.InvalidParams,
146
- when: 'The start instant is outside the SGP4 high-accuracy span (≈1900–2100), or more than about a month from the epoch of the current element set — checked on the epoch distance itself, since SGP4 keeps returning positions well past the point where the mean elements describe the orbit.',
147
- recovery: 'Request a start within about a month of today — element sets only describe the orbit for weeks around their epoch.',
189
+ when: 'The start instant falls outside the years 1900–2100, or more than about a month from the epoch of the current element set — checked on the epoch distance itself, since SGP4 keeps returning positions well past the point where the mean elements describe the orbit.',
190
+ /**
191
+ * Both checks send this hint: resolveTime()'s year-span rejection carries none, so the
192
+ * framework fills it, and SatelliteService writes it verbatim at the epoch-distance throw.
193
+ */
194
+ recovery: 'An element set describes the orbit for weeks either side of its epoch — request a start within about a month of today.',
148
195
  thrownBy: 'service',
149
196
  },
150
197
  {
@@ -218,13 +265,15 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
218
265
  */
219
266
  const nameQuery = input.name?.trim() || undefined;
220
267
  if ((noradId === undefined) === (nameQuery === undefined)) {
221
- throw ctx.fail('invalid_target', 'Identify the satellite with exactly one of `norad_id` or `name`.', ctx.recoveryFor('invalid_target'));
268
+ throw ctx.fail('invalid_target', 'Identify the satellite with exactly one of `norad_id` or `name`.');
222
269
  }
223
270
  const timezone = ephSvc.resolveTimezone(input.timezone ?? getServerConfig().defaultTimezone);
224
271
  /**
225
272
  * resolveTime() validates the instant (invalid_time / time_out_of_range) and returns
226
273
  * now when start is omitted — an Invalid Date here would yield NaN SGP4 positions and a
227
- * silently empty, falsely-successful pass list.
274
+ * silently empty, falsely-successful pass list. Its year-span rejection carries no
275
+ * hint, so this tool's declared recovery fills it — the one that also covers the
276
+ * epoch-distance check.
228
277
  */
229
278
  const start = ephSvc.resolveTime(input.start);
230
279
  const observer = {
@@ -240,13 +289,29 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
240
289
  ? await satSvc.resolveByName(nameQuery, ctx)
241
290
  : await satSvc.fetchElementSet(noradId, ctx);
242
291
  const formatLocal = timezone ? (d) => ephSvc.formatLocal(d, timezone) : undefined;
243
- const result = satSvc.predictPasses(elements, observer, input.days, start, formatLocal);
292
+ const searchedDays = Math.min(input.days, SATELLITE_DAYS_PER_CALL);
293
+ const result = satSvc.predictPasses(elements, observer, searchedDays, start, formatLocal);
244
294
  ctx.log.info('Predicted satellite passes', {
245
295
  noradId: result.noradId,
246
296
  resolvedFromName: nameQuery,
247
297
  passes: result.passes.length,
248
298
  });
249
299
  ctx.enrich.total(result.passes.length);
300
+ if (input.days > searchedDays) {
301
+ /**
302
+ * `resumeAt` is one scan step past the window's end: this call already reported every
303
+ * pass rising by then, through its set, so a call from there continues the search
304
+ * with none repeated and none skipped. The epoch horizon checks `start` only, so a
305
+ * window opened late in it can end with the resume instant beyond it — that call
306
+ * would fail time_out_of_range, and its recovery cannot reach the days left, so the
307
+ * notice names no call then.
308
+ */
309
+ const searched = `Searched ${searchedDays} of the ${input.days} requested days (${SATELLITE_DAYS_PER_CALL} per call), through ${result.windowEnd.toISOString()}.`;
310
+ const remaining = input.days - searchedDays;
311
+ ctx.enrich.notice(result.resumeInRange
312
+ ? `${searched} Re-call with start ${result.resumeAt.toISOString()} and days ${remaining} for the rest.`
313
+ : `${searched} The remaining ${remaining} days start more than about a month from the element set's epoch, where it no longer describes the orbit, so no call can search them.`);
314
+ }
250
315
  const out = {
251
316
  norad_id: result.noradId,
252
317
  satellite_name: result.satelliteName,
@@ -264,6 +329,14 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
264
329
  peak_azimuth_degrees: p.peakAzimuthDegrees,
265
330
  duration_seconds: p.durationSeconds,
266
331
  sunlit: p.sunlit,
332
+ visible_start_utc: p.visibleStartUtc,
333
+ visible_end_utc: p.visibleEndUtc,
334
+ ...(p.visibleStartLocal ? { visible_start_local: p.visibleStartLocal } : {}),
335
+ ...(p.visibleEndLocal ? { visible_end_local: p.visibleEndLocal } : {}),
336
+ visible_start_altitude_degrees: p.visibleStartAltitudeDegrees,
337
+ visible_end_altitude_degrees: p.visibleEndAltitudeDegrees,
338
+ visible_start_azimuth_degrees: p.visibleStartAzimuthDegrees,
339
+ visible_end_azimuth_degrees: p.visibleEndAzimuthDegrees,
267
340
  })),
268
341
  };
269
342
  return out;
@@ -275,9 +348,10 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
275
348
  if (r.resolved_from_name)
276
349
  lines.push(`Resolved from the name query "${r.resolved_from_name}".`);
277
350
  if (r.passes.length === 0)
278
- lines.push('No visible passes in the requested window (sunlit satellite over a dark sky).');
351
+ lines.push('No visible passes in the window searched (sunlit satellite over a dark sky, reaching 10°).');
352
+ const local = (stamp) => (stamp ? ` (local ${stamp})` : '');
279
353
  for (const p of r.passes) {
280
- lines.push(`- rise_utc ${p.rise_utc}${p.rise_local ? ` (local ${p.rise_local})` : ''} az ${num(p.rise_azimuth_degrees, 1, '°')} → peak_utc ${p.peak_utc}${p.peak_local ? ` (local ${p.peak_local})` : ''} alt ${num(p.peak_altitude_degrees, 1, '°')} az ${num(p.peak_azimuth_degrees, 1, '°')} → set_utc ${p.set_utc}${p.set_local ? ` (local ${p.set_local})` : ''} az ${num(p.set_azimuth_degrees, 1, '°')}, duration ${num(p.duration_seconds, 0, 's')}, sunlit ${p.sunlit}`);
354
+ lines.push(`- rise_utc ${p.rise_utc}${local(p.rise_local)} az ${num(p.rise_azimuth_degrees, 1, '°')} → peak_utc ${p.peak_utc}${local(p.peak_local)} alt ${num(p.peak_altitude_degrees, 1, '°')} az ${num(p.peak_azimuth_degrees, 1, '°')} → set_utc ${p.set_utc}${local(p.set_local)} az ${num(p.set_azimuth_degrees, 1, '°')}, duration ${num(p.duration_seconds, 0, 's')}, sunlit ${p.sunlit}`, ` visible: visible_start_utc ${p.visible_start_utc}${local(p.visible_start_local)} alt ${num(p.visible_start_altitude_degrees, 1, '°')} az ${num(p.visible_start_azimuth_degrees, 1, '°')} → visible_end_utc ${p.visible_end_utc}${local(p.visible_end_local)} alt ${num(p.visible_end_altitude_degrees, 1, '°')} az ${num(p.visible_end_azimuth_degrees, 1, '°')}`);
281
355
  }
282
356
  return [{ type: 'text', text: lines.join('\n') }];
283
357
  },