@cyanheads/astronomy-mcp-server 0.4.1 → 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 (57) hide show
  1. package/AGENTS.md +9 -9
  2. package/CLAUDE.md +9 -9
  3. package/Dockerfile +3 -3
  4. package/README.md +13 -9
  5. package/changelog/0.4.x/0.4.2.md +37 -0
  6. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js +1 -1
  7. package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js.map +1 -1
  8. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts +31 -4
  9. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts.map +1 -1
  10. package/dist/mcp-server/tools/definitions/find-events.tool.js +97 -23
  11. package/dist/mcp-server/tools/definitions/find-events.tool.js.map +1 -1
  12. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts +29 -7
  13. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts.map +1 -1
  14. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js +216 -44
  15. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js +1 -0
  18. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts +49 -2
  20. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js +85 -43
  22. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts +27 -3
  24. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js +95 -21
  26. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/get-sky-position.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js +1 -0
  29. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/list-visible.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/list-visible.tool.js +1 -0
  32. package/dist/mcp-server/tools/definitions/list-visible.tool.js.map +1 -1
  33. package/dist/services/ephemeris/ephemeris-service.d.ts +78 -14
  34. package/dist/services/ephemeris/ephemeris-service.d.ts.map +1 -1
  35. package/dist/services/ephemeris/ephemeris-service.js +374 -97
  36. package/dist/services/ephemeris/ephemeris-service.js.map +1 -1
  37. package/dist/services/ephemeris/iso-time.d.ts +2 -2
  38. package/dist/services/ephemeris/iso-time.js +5 -5
  39. package/dist/services/ephemeris/types.d.ts +42 -1
  40. package/dist/services/ephemeris/types.d.ts.map +1 -1
  41. package/dist/services/ephemeris/types.js +16 -0
  42. package/dist/services/ephemeris/types.js.map +1 -1
  43. package/dist/services/horizons/horizons-service.d.ts +25 -3
  44. package/dist/services/horizons/horizons-service.d.ts.map +1 -1
  45. package/dist/services/horizons/horizons-service.js +154 -15
  46. package/dist/services/horizons/horizons-service.js.map +1 -1
  47. package/dist/services/horizons/types.d.ts +8 -4
  48. package/dist/services/horizons/types.d.ts.map +1 -1
  49. package/dist/services/satellite/satellite-service.d.ts +48 -10
  50. package/dist/services/satellite/satellite-service.d.ts.map +1 -1
  51. package/dist/services/satellite/satellite-service.js +215 -102
  52. package/dist/services/satellite/satellite-service.js.map +1 -1
  53. package/dist/services/satellite/types.d.ts +36 -2
  54. package/dist/services/satellite/types.d.ts.map +1 -1
  55. package/dist/services/satellite/types.js.map +1 -1
  56. package/package.json +6 -6
  57. package/server.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"find-events.tool.js","sourceRoot":"","sources":["../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C,0BAA0B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjF,CAAC;QACH,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"}
1
+ {"version":3,"file":"find-events.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/find-events.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;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,GAAG,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,WAAW,EAEX,eAAe,GAChB,MAAM,+BAA+B,CAAC;AAEvC,2FAA2F;AAC3F,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,4DAA4D;AAC5D,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,wBAAwB,GAAG,EAAE,GAAG,UAAU,CAAC;AAEjD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAY;IACrC,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,gBAAgB;CACjB,CAAC,CAAC;AAEH,wFAAwF;AACxF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAY,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MA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,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,CACtF,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAC/D,CAAC;gBACF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;oBAAE,KAAK,CAAC,IAAI,CAAC,0BAA0B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjF,CAAC;QACH,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"}
@@ -43,23 +43,28 @@ export declare const getEphemerisTool: import("@cyanheads/mcp-ts-core").ToolDefi
43
43
  }, z.core.$strip>, readonly [{
44
44
  readonly reason: "invalid_time";
45
45
  readonly code: JsonRpcErrorCode.InvalidParams;
46
- readonly when: "The start or stop timestamp is not a parseable ISO 8601 instant, or names a calendar date that does not exist (e.g. 2026-02-30).";
47
- readonly recovery: "Pass start and stop as ISO 8601 UTC timestamps naming real calendar dates, e.g. 2024-01-01T00:00:00Z, then retry.";
46
+ readonly when: "The start or stop timestamp is not a parseable ISO 8601 instant, names a calendar date that does not exist (e.g. 2026-02-30), or falls outside years 0100 through 9999, the calendar years JPL Horizons reads.";
47
+ readonly recovery: "Pass start and stop as ISO 8601 UTC timestamps naming real calendar dates in years 0100 through 9999, e.g. 2024-01-01T00:00:00Z, then retry.";
48
48
  }, {
49
49
  readonly reason: "invalid_time_range";
50
50
  readonly code: JsonRpcErrorCode.InvalidParams;
51
- readonly when: "The resolved stop instant is at or before the resolved start instant.";
52
- readonly recovery: "Pass a stop that is later than start, or omit stop for a 24-hour span, then retry.";
51
+ readonly when: "The resolved stop instant is before the resolved start instant.";
52
+ readonly recovery: "Pass a stop at or after start — equal for a single instant — or omit stop for a 24-hour span, then retry.";
53
53
  }, {
54
54
  readonly reason: "incomplete_observer";
55
55
  readonly code: JsonRpcErrorCode.InvalidParams;
56
56
  readonly when: "Exactly one of latitude and longitude was supplied.";
57
57
  readonly recovery: "Supply latitude and longitude together for a topocentric ephemeris, or omit both for a geocentric one.";
58
+ }, {
59
+ readonly reason: "invalid_elevation";
60
+ readonly code: JsonRpcErrorCode.InvalidParams;
61
+ readonly when: "An observer (latitude and longitude) was supplied with an elevation of -20000 m or less, or 40000000 m or more — outside the observer altitudes JPL Horizons accepts.";
62
+ readonly recovery: "Pass elevation in meters greater than -20000 and less than 40000000, or omit latitude and longitude for a geocentric ephemeris, which ignores elevation.";
58
63
  }, {
59
64
  readonly reason: "invalid_step";
60
65
  readonly code: JsonRpcErrorCode.InvalidParams;
61
- readonly when: "The step is not a positive count followed by a unit of m, h, d, mo, or y.";
62
- readonly recovery: "Pass step as a count plus m, h, d, mo, or y — for example \"10m\", \"1h\", or \"1d\" — then retry.";
66
+ readonly when: "The step is not a positive count followed by a unit of m, h, d, mo, or y, its count is past 2147483647, or Horizons reports it longer than the span of data it holds for the target.";
67
+ readonly recovery: "Pass step as a count up to 2147483647 plus m, h, d, mo, or y — for example \"10m\", \"1h\", or \"1d\" — and shorter than the span of data Horizons holds for the target, then retry.";
63
68
  }, {
64
69
  readonly reason: "time_out_of_range";
65
70
  readonly code: JsonRpcErrorCode.InvalidParams;
@@ -69,8 +74,25 @@ export declare const getEphemerisTool: import("@cyanheads/mcp-ts-core").ToolDefi
69
74
  }, {
70
75
  readonly reason: "body_not_found";
71
76
  readonly code: JsonRpcErrorCode.NotFound;
72
- readonly when: "JPL Horizons has no match for the designation, or the designation is ambiguous (a bare comet name matches multiple apparition records).";
77
+ readonly when: "JPL Horizons has no match for the designation, the designation is ambiguous (a bare comet name matches multiple apparition records), it contains an apostrophe, which the Horizons search cannot match (e.g. \"6P/d'Arrest\"), or it contains a character outside printable ASCII, which Horizons refuses (e.g. \"Šteins\", \"6P/d’Arrest\").";
73
78
  readonly recovery: "Use a record-resolving form: a numbered asteroid as \"<number>;\" (e.g. \"433;\"), a periodic comet as \"DES=<designation>;CAP\" (e.g. \"DES=1P;CAP\"), or a spacecraft as its negative SPK-ID. Verify the designation at ssd.jpl.nasa.gov/tools/sbdb_lookup.html.";
79
+ }, {
80
+ readonly reason: "ambiguous_designation";
81
+ readonly code: JsonRpcErrorCode.InvalidParams;
82
+ readonly when: "A major-body or spacecraft name matches several Horizons bodies (e.g. \"Mars\" matches the planet, its barycenter, and spacecraft). The message lists the candidates with their ID numbers, at most 20, and names the total when there are more.";
83
+ readonly recovery: "Re-call with designation set to the ID number of the intended body from the listed candidates — e.g. \"499\" for the planet Mars — or a more specific name when it is not listed.";
84
+ readonly thrownBy: "service";
85
+ }, {
86
+ readonly reason: "observer_is_target";
87
+ readonly code: JsonRpcErrorCode.InvalidParams;
88
+ readonly when: "The designation resolves to Earth (e.g. \"399\"), the body every request here observes from.";
89
+ readonly recovery: "Choose a target other than Earth: this tool observes from Earth, geocentric or from the supplied latitude and longitude, and Horizons computes no ephemeris of the observer’s own body.";
90
+ readonly thrownBy: "service";
91
+ }, {
92
+ readonly reason: "request_rejected";
93
+ readonly code: JsonRpcErrorCode.InvalidParams;
94
+ readonly when: "JPL Horizons refused a request parameter value with HTTP 400 — the same answer on every attempt. The message names the input that parameter carries.";
95
+ readonly recovery: "Horizons refuses this request the same way on every attempt, so do not retry it unchanged: correct the input the message names — the designation as a record-resolving form such as \"433;\", or the start, stop, step, or observer coordinates — then call again.";
74
96
  readonly thrownBy: "service";
75
97
  }, {
76
98
  readonly reason: "horizons_unavailable";
@@ -1 +1 @@
1
- {"version":3,"file":"get-ephemeris.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ephemeris.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAyEjE,eAAO,MAAM,eAAe;;;;;;;;;;;;iBAoC1B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgR3B,CAAC"}
1
+ {"version":3,"file":"get-ephemeris.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ephemeris.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAuIjE,eAAO,MAAM,eAAe;;;;;;;;;;;;iBAoC1B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAya3B,CAAC"}
@@ -11,6 +11,21 @@ import { parseIsoInstant } from '../../../services/ephemeris/iso-time.js';
11
11
  import { getHorizonsService } from '../../../services/horizons/horizons-service.js';
12
12
  /** Inline ephemeris-row cap disclosed via enrichment — mirrors HorizonsService MAX_ROWS. */
13
13
  const INLINE_ROW_CAP = 200;
14
+ /**
15
+ * The calendar years JPL Horizons reads from the ISO 8601 date this tool sends, measured
16
+ * against its START_TIME parser. An expanded year past 9999 comes back "Cannot interpret
17
+ * date", a negative one is refused in favor of BC notation, and a year below 0100 is read
18
+ * as a two-digit year — `0099` as 1999 — so the request would answer for a different
19
+ * instant without saying so.
20
+ */
21
+ const MIN_HORIZONS_YEAR = 100;
22
+ const MAX_HORIZONS_YEAR = 9999;
23
+ /**
24
+ * The open range of observer altitudes Horizons accepts, in meters: it answers "Observer
25
+ * geodetic altitude must be MORE than -20 km" and "LESS than 40000 km" outside it.
26
+ */
27
+ const MIN_OBSERVER_ELEVATION_M = -20_000;
28
+ const MAX_OBSERVER_ELEVATION_M = 40_000_000;
14
29
  /**
15
30
  * Accepted `step` shape: a positive count followed by one of Horizons' step units —
16
31
  * m (minutes), h (hours), d (days), mo (months), y (years). `mo` precedes `m` in the
@@ -22,54 +37,93 @@ const INLINE_ROW_CAP = 200;
22
37
  * truncation notice has to advance the last returned instant by exactly one step.
23
38
  */
24
39
  const STEP_PATTERN = /^([1-9]\d*) ?(mo|[mhdy])$/i;
40
+ /**
41
+ * The largest step count Horizons reads: a count past a signed 32-bit integer comes back
42
+ * "Cannot read numeric value", whatever the unit.
43
+ */
44
+ const MAX_STEP_COUNT = 2_147_483_647;
25
45
  /** Milliseconds in one unit of each fixed-duration step. */
26
46
  const FIXED_STEP_MS = { m: 60_000, h: 3_600_000, d: 86_400_000 };
27
47
  /**
28
- * How many whole steps to try before giving up on a calendar advance. Horizons skips a
29
- * calendar period that has no such day of the month rather than rolling into the next
30
- * one, so a series on the 31st passes over several periods in a row, and a Feb-29 year
31
- * series passes over three — seven when a non-leap century year falls in the run.
48
+ * How many single months or years a calendar advance moves past a period that lacks the
49
+ * day of the month. A month step needs at most one — the month after any 30-day month or
50
+ * February has 31 days — and a Feb-29 year step at most seven, when a non-leap century
51
+ * year falls in the run (2097 to 2104).
32
52
  */
33
- const MAX_CALENDAR_STEPS = 48;
53
+ const MAX_CALENDAR_SLIDES = 7;
34
54
  /** Split a `step` into its count and unit, or undefined when it is not one this tool accepts. */
35
55
  function parseStep(step) {
36
56
  const match = STEP_PATTERN.exec(step);
37
57
  if (!match?.[1] || !match[2])
38
58
  return undefined;
39
- return { count: Number(match[1]), unit: match[2].toLowerCase() };
59
+ const count = Number(match[1]);
60
+ if (count > MAX_STEP_COUNT)
61
+ return undefined;
62
+ return { count, unit: match[2].toLowerCase() };
40
63
  }
41
64
  /**
42
- * The instant exactly one `step` after `instant`.
65
+ * The row Horizons prints one `step` after the row at `instant`, or undefined when that
66
+ * instant cannot be computed (it leaves the `Date` range).
43
67
  *
44
68
  * Minute, hour, and day steps are fixed durations. Month and year steps are calendar
45
69
  * stepping: per Horizons' API documentation the output "will follow the calendar based
46
70
  * on the starting date", and a period that does not carry that day of the month
47
- * produces no row at all — "if a start date on the 31st is requested, output will only
48
- * occur for months having 31 days". A plain field increment is wrong there twice over,
49
- * because JavaScript rolls Jan 31 forward into Mar 3: an instant Horizons would never
50
- * print, and one that shifts every later row off the series the caller asked for.
51
- * Advancing by whole steps until the day of the month survives applies Horizons' own
52
- * rule, so the continuation lands on the next row of the same series.
71
+ * produces no row — "if a start date on the 31st is requested, output will only occur
72
+ * for months having 31 days". A plain field increment is wrong there, because
73
+ * JavaScript rolls Jan 31 forward into Mar 3, an instant Horizons never prints. Horizons
74
+ * advances the step count from the previous row and, when that lands on a missing day,
75
+ * moves on one month or year at a time until the day exists — 5mo from Jan 31 prints
76
+ * Jul 31, 3y from 2024-02-29 prints 2028-02-29 — and the next row steps from there.
77
+ * Skipping whole steps instead agrees only at a count of one and otherwise resumes a
78
+ * page past rows Horizons would have printed.
53
79
  */
54
80
  function nextStepInstant(instant, step) {
55
81
  const from = new Date(instant);
56
82
  if (Number.isNaN(from.getTime()))
57
83
  return undefined;
58
84
  if (step.unit === 'm' || step.unit === 'h' || step.unit === 'd') {
59
- return new Date(from.getTime() + step.count * FIXED_STEP_MS[step.unit]).toISOString();
85
+ const next = new Date(from.getTime() + step.count * FIXED_STEP_MS[step.unit]);
86
+ return Number.isNaN(next.getTime()) ? undefined : next.toISOString();
60
87
  }
61
88
  const dayOfMonth = from.getUTCDate();
62
- for (let steps = 1; steps <= MAX_CALENDAR_STEPS; steps++) {
89
+ for (let slide = 0; slide <= MAX_CALENDAR_SLIDES; slide++) {
63
90
  const next = new Date(from.getTime());
64
91
  if (step.unit === 'mo')
65
- next.setUTCMonth(next.getUTCMonth() + step.count * steps);
92
+ next.setUTCMonth(next.getUTCMonth() + step.count + slide);
66
93
  else
67
- next.setUTCFullYear(next.getUTCFullYear() + step.count * steps);
94
+ next.setUTCFullYear(next.getUTCFullYear() + step.count + slide);
68
95
  if (next.getUTCDate() === dayOfMonth)
69
96
  return next.toISOString();
70
97
  }
71
98
  return undefined;
72
99
  }
100
+ /**
101
+ * The STOP_TIME to send for one page: the series' 201st instant — one row past the inline
102
+ * cap — when that comes before the requested stop, otherwise the requested stop.
103
+ *
104
+ * Horizons prints every row through STOP_TIME and refuses outright, with no ephemeris
105
+ * block, a span projecting past its undocumented output-line ceiling (90,024 rows when
106
+ * measured), so sending the whole span both downloaded rows the page never shows and
107
+ * failed long spans at fine steps. The extra row past the cap is what tells the parse the
108
+ * series continues. The walk stops at the requested stop, and a step it cannot advance
109
+ * leaves the request as asked.
110
+ */
111
+ function pageStop(start, stop, step) {
112
+ const stopMs = new Date(stop).getTime();
113
+ let instant = start;
114
+ for (let row = 1; row <= INLINE_ROW_CAP; row++) {
115
+ instant = nextStepInstant(instant, step);
116
+ if (instant === undefined || new Date(instant).getTime() >= stopMs) {
117
+ return { stop, bounded: false };
118
+ }
119
+ }
120
+ return { stop: instant, bounded: true };
121
+ }
122
+ /** Whether an instant falls in a calendar year Horizons reads as written. */
123
+ function isHorizonsYear(instant) {
124
+ const year = instant.getUTCFullYear();
125
+ return year >= MIN_HORIZONS_YEAR && year <= MAX_HORIZONS_YEAR;
126
+ }
73
127
  export const EphemerisOutput = z.object({
74
128
  designation: z.string().describe('The body designation echoed from the request.'),
75
129
  target_name: z
@@ -101,13 +155,13 @@ export const EphemerisOutput = z.object({
101
155
  });
102
156
  export const getEphemerisTool = tool('astronomy_get_ephemeris', {
103
157
  title: 'astronomy-mcp-server: get small-body ephemeris',
104
- description: 'Fetch a time-series ephemeris for a small body (asteroid or comet) or spacecraft from JPL Horizons — RA/Dec, distance, and apparent magnitude over a span, optionally with observer-relative altitude/azimuth. This covers objects the in-process major-body set cannot. The designation is passed to Horizons verbatim, so it must be in a form Horizons resolves to a single record: a numbered asteroid takes a trailing-semicolon record lookup (e.g. "433;" for Eros, "1;" for Ceres), and a periodic comet takes the DES + closest-apparition form (e.g. "DES=1P;CAP" for Halley). Spacecraft take their negative SPK-ID. Anything else goes through the Horizons name search: a bare name matching nothing (e.g. "433 Eros") or several records (e.g. "1P/Halley") is rejected, but one matching a single object succeeds even when that object is not the one meant — "Eros" resolves to Kerberos, a moon of Pluto — so compare `target_name`, the object Horizons resolved, with the one intended. `start` and `stop` are ISO 8601 UTC and `stop` must be after `start`; `step` is a count plus a unit of m, h, d, mo, or y, such as "1d", "1h", or "10m". Supplying observer latitude/longitude yields topocentric coordinates and adds alt/az — supply both or neither. This is a gated, network-backed extension (JPL Horizons is keyless but rate-limited and best-effort); large spans truncate inline at 200 rows, and the truncation notice names the exact `start` to resume from — one step past the last row returned, because Horizons includes the start instant in its output — so re-calling from there continues the series without repeating a sample. Splitting the range into smaller adjacent spans works too; keep the same step either way so no sample is lost.',
158
+ description: 'Fetch a time-series ephemeris for a small body (asteroid or comet) or spacecraft from JPL Horizons — RA/Dec, distance, and apparent magnitude over a span, optionally with observer-relative altitude/azimuth. This covers objects the in-process major-body set cannot. The designation is passed to Horizons verbatim, so it must be in a form Horizons resolves to a single record: a numbered asteroid takes a trailing-semicolon record lookup (e.g. "433;" for Eros, "1;" for Ceres), and a periodic comet takes the DES + closest-apparition form (e.g. "DES=1P;CAP" for Halley). Spacecraft take their negative SPK-ID. Anything else goes through the Horizons name search: a bare name matching nothing (e.g. "433 Eros") or several records (e.g. "1P/Halley") is rejected, but one matching a single object succeeds even when that object is not the one meant — "Eros" resolves to Kerberos, a moon of Pluto — so compare `target_name`, the object Horizons resolved, with the one intended. A major-body name matching several bodies (e.g. "Mars") is rejected with the ID number of each body it matched — pass one, such as "499" for the planet. `start` and `stop` are ISO 8601 UTC dates in the Gregorian calendar, extended before 1582, in years 0100 through 9999; `stop` must not be before `start`, and a `stop` equal to `start` returns the single row at that instant. `step` is a count plus a unit of m, h, d, mo, or y, such as "1d", "1h", or "10m". Supplying observer latitude/longitude yields topocentric coordinates and adds alt/az — supply both or neither. This is a gated, network-backed extension (JPL Horizons is keyless but rate-limited and best-effort); large spans truncate inline at 200 rows, and the truncation notice names the exact `start` to resume from — one step past the last row returned, because Horizons includes the start instant in its output — so re-calling from there continues the series without repeating a sample. Splitting the range into smaller adjacent spans works too; keep the same step either way so no sample is lost.',
105
159
  annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
106
160
  input: z.object({
107
161
  designation: z
108
162
  .string()
109
- .min(1)
110
- .describe('JPL Horizons target, passed verbatim — use a form that resolves to one record. Numbered asteroid: trailing-semicolon record lookup, e.g. "433;" (Eros), "1;" (Ceres). Periodic comet: DES + closest-apparition flag, e.g. "DES=1P;CAP" (Halley), "DES=2P;CAP" (Encke). Spacecraft: negative SPK-ID, e.g. "-48" (Hubble). A bare name like "433 Eros" (no match) or "1P/Halley" (several records) is rejected, but one matching a single object succeeds even when it is not the object meant — check `target_name` in the result. Look up designations at ssd.jpl.nasa.gov/tools/sbdb_lookup.html.'),
163
+ .regex(/\S/, 'designation must not be blank.')
164
+ .describe('JPL Horizons target, passed verbatim — use a form that resolves to one record. Numbered asteroid: trailing-semicolon record lookup, e.g. "433;" (Eros), "1;" (Ceres). Periodic comet: DES + closest-apparition flag, e.g. "DES=1P;CAP" (Halley), "DES=2P;CAP" (Encke). Spacecraft: negative SPK-ID, e.g. "-48" (Hubble). A bare name like "433 Eros" (no match) or "1P/Halley" (several records) is rejected, and "Mars" (several major bodies) is rejected with their ID numbers listed — the planet is "499" — but one matching a single object succeeds even when it is not the object meant — check `target_name` in the result. Earth ("399") is rejected, being the body the observer is on, and so is a name containing an apostrophe, which the Horizons search cannot match — "6P/d\'Arrest" resolves as "DES=6P;CAP" — or any character outside printable ASCII, which Horizons refuses, such as an accent or a typographic apostrophe — "Šteins" resolves as "2867;". Look up designations at ssd.jpl.nasa.gov/tools/sbdb_lookup.html.'),
111
165
  latitude: z
112
166
  .number()
113
167
  .min(-90)
@@ -123,23 +177,25 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
123
177
  elevation: z
124
178
  .number()
125
179
  .default(0)
126
- .describe('Observer elevation in meters above sea level. Default 0.'),
180
+ .describe('Observer elevation in meters above sea level. Default 0. With latitude and longitude it must be greater than -20000 and less than 40000000 — the observer altitudes Horizons accepts; a geocentric request ignores it.'),
127
181
  start: z
128
182
  .string()
129
183
  .optional()
130
- .describe('Ephemeris start as an ISO 8601 UTC string, e.g. "2024-01-01T00:00:00Z". Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.'),
184
+ .describe('Ephemeris start as an ISO 8601 UTC string, e.g. "2024-01-01T00:00:00Z", in years 0100 through 9999 — the calendar years JPL Horizons reads. Dates are Gregorian, extended before 1582. Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.'),
131
185
  stop: z
132
186
  .string()
133
187
  .optional()
134
- .describe('Ephemeris stop as an ISO 8601 UTC string, and must be later than start. Defaults to 24 hours after start. A value with no zone designator is read as UTC, not the local zone of the server process.'),
188
+ .describe('Ephemeris stop as an ISO 8601 UTC string in years 0100 through 9999, at or after start — equal to start returns the single row at that instant. Defaults to 24 hours after start. A value with no zone designator is read as UTC, not the local zone of the server process.'),
135
189
  step: z
136
190
  .string()
137
191
  .default('1h')
138
- .describe('Step size as a positive count plus a unit of m (minutes), h (hours), d (days), mo (months), or y (years), e.g. "10m", "1h", "1d". Default "1h".'),
192
+ .describe('Step size as a positive count up to 2147483647 plus a unit of m (minutes), h (hours), d (days), mo (months), or y (years), e.g. "10m", "1h", "1d". Default "1h".'),
139
193
  }),
140
194
  output: EphemerisOutput,
141
195
  enrichment: {
142
- truncated: z.boolean().describe('True when Horizons returned more rows than the inline cap.'),
196
+ truncated: z
197
+ .boolean()
198
+ .describe('True when the requested span continues past the returned rows; the notice names the start to resume from.'),
143
199
  shown: z.number().describe('Number of ephemeris rows returned.'),
144
200
  cap: z.number().describe('The inline row cap that was applied.'),
145
201
  dropped: z
@@ -155,14 +211,14 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
155
211
  {
156
212
  reason: 'invalid_time',
157
213
  code: JsonRpcErrorCode.InvalidParams,
158
- when: 'The start or stop timestamp is not a parseable ISO 8601 instant, or names a calendar date that does not exist (e.g. 2026-02-30).',
159
- recovery: 'Pass start and stop as ISO 8601 UTC timestamps naming real calendar dates, e.g. 2024-01-01T00:00:00Z, then retry.',
214
+ when: 'The start or stop timestamp is not a parseable ISO 8601 instant, names a calendar date that does not exist (e.g. 2026-02-30), or falls outside years 0100 through 9999, the calendar years JPL Horizons reads.',
215
+ recovery: 'Pass start and stop as ISO 8601 UTC timestamps naming real calendar dates in years 0100 through 9999, e.g. 2024-01-01T00:00:00Z, then retry.',
160
216
  },
161
217
  {
162
218
  reason: 'invalid_time_range',
163
219
  code: JsonRpcErrorCode.InvalidParams,
164
- when: 'The resolved stop instant is at or before the resolved start instant.',
165
- recovery: 'Pass a stop that is later than start, or omit stop for a 24-hour span, then retry.',
220
+ when: 'The resolved stop instant is before the resolved start instant.',
221
+ recovery: 'Pass a stop at or after start — equal for a single instant — or omit stop for a 24-hour span, then retry.',
166
222
  },
167
223
  {
168
224
  reason: 'incomplete_observer',
@@ -170,11 +226,18 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
170
226
  when: 'Exactly one of latitude and longitude was supplied.',
171
227
  recovery: 'Supply latitude and longitude together for a topocentric ephemeris, or omit both for a geocentric one.',
172
228
  },
229
+ {
230
+ reason: 'invalid_elevation',
231
+ code: JsonRpcErrorCode.InvalidParams,
232
+ when: 'An observer (latitude and longitude) was supplied with an elevation of -20000 m or less, or 40000000 m or more — outside the observer altitudes JPL Horizons accepts.',
233
+ recovery: 'Pass elevation in meters greater than -20000 and less than 40000000, or omit latitude and longitude for a geocentric ephemeris, which ignores elevation.',
234
+ },
173
235
  {
174
236
  reason: 'invalid_step',
175
237
  code: JsonRpcErrorCode.InvalidParams,
176
- when: 'The step is not a positive count followed by a unit of m, h, d, mo, or y.',
177
- recovery: 'Pass step as a count plus m, h, d, mo, or y — for example "10m", "1h", or "1d" — then retry.',
238
+ when: 'The step is not a positive count followed by a unit of m, h, d, mo, or y, its count is past 2147483647, or Horizons reports it longer than the span of data it holds for the target.',
239
+ // Verbatim the hint HorizonsService throws with for a step longer than the target's data.
240
+ recovery: 'Pass step as a count up to 2147483647 plus m, h, d, mo, or y — for example "10m", "1h", or "1d" — and shorter than the span of data Horizons holds for the target, then retry.',
178
241
  },
179
242
  {
180
243
  reason: 'time_out_of_range',
@@ -187,8 +250,31 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
187
250
  {
188
251
  reason: 'body_not_found',
189
252
  code: JsonRpcErrorCode.NotFound,
190
- when: 'JPL Horizons has no match for the designation, or the designation is ambiguous (a bare comet name matches multiple apparition records).',
253
+ when: 'JPL Horizons has no match for the designation, the designation is ambiguous (a bare comet name matches multiple apparition records), it contains an apostrophe, which the Horizons search cannot match (e.g. "6P/d\'Arrest"), or it contains a character outside printable ASCII, which Horizons refuses (e.g. "Šteins", "6P/d’Arrest").',
191
254
  recovery: 'Use a record-resolving form: a numbered asteroid as "<number>;" (e.g. "433;"), a periodic comet as "DES=<designation>;CAP" (e.g. "DES=1P;CAP"), or a spacecraft as its negative SPK-ID. Verify the designation at ssd.jpl.nasa.gov/tools/sbdb_lookup.html.',
255
+ },
256
+ {
257
+ reason: 'ambiguous_designation',
258
+ code: JsonRpcErrorCode.InvalidParams,
259
+ when: 'A major-body or spacecraft name matches several Horizons bodies (e.g. "Mars" matches the planet, its barycenter, and spacecraft). The message lists the candidates with their ID numbers, at most 20, and names the total when there are more.',
260
+ // Verbatim the hint HorizonsService throws with.
261
+ recovery: 'Re-call with designation set to the ID number of the intended body from the listed candidates — e.g. "499" for the planet Mars — or a more specific name when it is not listed.',
262
+ thrownBy: 'service',
263
+ },
264
+ {
265
+ reason: 'observer_is_target',
266
+ code: JsonRpcErrorCode.InvalidParams,
267
+ when: 'The designation resolves to Earth (e.g. "399"), the body every request here observes from.',
268
+ // Verbatim the hint HorizonsService throws with.
269
+ recovery: 'Choose a target other than Earth: this tool observes from Earth, geocentric or from the supplied latitude and longitude, and Horizons computes no ephemeris of the observer’s own body.',
270
+ thrownBy: 'service',
271
+ },
272
+ {
273
+ reason: 'request_rejected',
274
+ code: JsonRpcErrorCode.InvalidParams,
275
+ when: 'JPL Horizons refused a request parameter value with HTTP 400 — the same answer on every attempt. The message names the input that parameter carries.',
276
+ // Verbatim the hint HorizonsService throws with.
277
+ recovery: 'Horizons refuses this request the same way on every attempt, so do not retry it unchanged: correct the input the message names — the designation as a record-resolving form such as "433;", or the start, stop, step, or observer coordinates — then call again.',
192
278
  thrownBy: 'service',
193
279
  },
194
280
  {
@@ -208,7 +294,7 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
208
294
  * that does not exist rolls silently forward into the next month. Shares the calendar
209
295
  * check with the core resolveTime() but deliberately not the method itself — JPL
210
296
  * Horizons covers historical and future epochs far outside its 1900–2100 high-accuracy
211
- * span, so this tool rejects unparseable and impossible dates, never a year.
297
+ * span, so the only years this tool rejects are the ones Horizons cannot read (below).
212
298
  */
213
299
  const startInstant = input.start === undefined ? new Date() : parseIsoInstant(input.start);
214
300
  if (startInstant === undefined) {
@@ -235,8 +321,53 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
235
321
  */
236
322
  const start = startInstant.toISOString();
237
323
  const stop = stopInstant.toISOString();
238
- if (stopInstant.getTime() <= startInstant.getTime()) {
239
- throw ctx.fail('invalid_time_range', `stop "${stop}" is not after start "${start}".`);
324
+ /**
325
+ * The year check runs on the instants actually sent, so a default stop carried past
326
+ * 9999 by the 24-hour span is caught the same as one the caller wrote — and the
327
+ * message says it is the default, since the caller never passed it. Sending either
328
+ * would cost an upstream request to learn nothing, or — below 0100 — answer for a
329
+ * different century.
330
+ */
331
+ const stopNote = input.stop === undefined ? ' (the default, 24 hours after start)' : '';
332
+ for (const [name, instant, iso, note] of [
333
+ ['start', startInstant, start, ''],
334
+ ['stop', stopInstant, stop, stopNote],
335
+ ]) {
336
+ if (!isHorizonsYear(instant)) {
337
+ throw ctx.fail('invalid_time', `${name} "${iso}"${note} is outside years 0100 through 9999, the calendar years JPL Horizons reads.`);
338
+ }
339
+ }
340
+ if (stopInstant.getTime() < startInstant.getTime()) {
341
+ throw ctx.fail('invalid_time_range', `stop "${stop}" is before start "${start}".`);
342
+ }
343
+ /**
344
+ * A stop equal to start asks for the single row at that instant — the continuation a
345
+ * span of exactly 201 rows advertises, whose last row sits on its stop. Horizons refuses
346
+ * START_TIME equal to STOP_TIME ("Bad dates"), so the request closes one millisecond
347
+ * later, a window holding the start row and no other. The last millisecond of 9999 has
348
+ * no readable instant after it.
349
+ */
350
+ const singleInstant = stopInstant.getTime() === startInstant.getTime();
351
+ const closingStop = singleInstant ? new Date(startInstant.getTime() + 1) : stopInstant;
352
+ if (!isHorizonsYear(closingStop)) {
353
+ throw ctx.fail('invalid_time', `start and stop "${start}" leave no later instant in year 9999 to close the request, the last calendar year JPL Horizons reads.`);
354
+ }
355
+ /**
356
+ * Horizons reads COMMAND inside single quotes with no escape for one within it, so an
357
+ * apostrophe ends the designation early and the search runs on the text before it.
358
+ * Sent unquoted, the whole name reaches the search and still matches nothing. No form
359
+ * of the name reaches the object; its designation form resolves instead.
360
+ */
361
+ if (input.designation.includes("'")) {
362
+ throw ctx.fail('body_not_found', `Designation "${input.designation}" contains an apostrophe, which the JPL Horizons search cannot match. Use a record-resolving form instead, such as "DES=6P;CAP" for 6P/d'Arrest.`);
363
+ }
364
+ /**
365
+ * Horizons refuses any COMMAND character outside printable ASCII with HTTP 400 — an
366
+ * accented name, a typographic apostrophe, a control character — so no spelling with one
367
+ * reaches the search; the object's number or designation form does.
368
+ */
369
+ if (/[^\x20-\x7e]/.test(input.designation)) {
370
+ throw ctx.fail('body_not_found', `Designation "${input.designation}" contains a character outside printable ASCII, the only characters JPL Horizons accepts. Use a record-resolving form instead, such as "2867;" for the asteroid 2867 Šteins or "DES=6P;CAP" for the comet 6P/d'Arrest.`);
240
371
  }
241
372
  /**
242
373
  * A lone coordinate used to fall through to a geocentric query, silently dropping
@@ -248,18 +379,61 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
248
379
  if (hasLatitude !== hasLongitude) {
249
380
  throw ctx.fail('incomplete_observer', `Observer ${hasLatitude ? 'latitude' : 'longitude'} was supplied without ${hasLatitude ? 'longitude' : 'latitude'}.`);
250
381
  }
382
+ /**
383
+ * Horizons refuses an observer altitude of -20 km or less, or 40,000 km or more. The
384
+ * range binds only a topocentric request — elevation places an observer, and a
385
+ * geocentric request has none — so it is checked here rather than in the schema,
386
+ * which would also reject geocentric calls that never send it.
387
+ */
388
+ if (hasLatitude &&
389
+ (input.elevation <= MIN_OBSERVER_ELEVATION_M || input.elevation >= MAX_OBSERVER_ELEVATION_M)) {
390
+ throw ctx.fail('invalid_elevation', `Observer elevation ${input.elevation} m is outside the range JPL Horizons accepts for an observer: more than ${MIN_OBSERVER_ELEVATION_M} and less than ${MAX_OBSERVER_ELEVATION_M} meters.`);
391
+ }
251
392
  const step = parseStep(input.step);
252
393
  if (!step) {
253
- throw ctx.fail('invalid_step', `Invalid step "${input.step}". Expected a positive count plus m, h, d, mo, or y, e.g. "10m".`);
394
+ throw ctx.fail('invalid_step', `Invalid step "${input.step}". Expected a positive count up to 2147483647 plus m, h, d, mo, or y, e.g. "10m".`);
254
395
  }
255
396
  const observer = input.latitude !== undefined && input.longitude !== undefined
256
397
  ? { latitude: input.latitude, longitude: input.longitude, elevation: input.elevation }
257
398
  : undefined;
258
- const result = await svc.ephemeris(input.designation, start, stop, input.step, ctx, observer);
399
+ const page = singleInstant
400
+ ? { stop: closingStop.toISOString(), bounded: false }
401
+ : pageStop(start, stop, step);
402
+ const result = await svc.ephemeris(input.designation, start, page.stop, input.step, ctx, observer);
403
+ /**
404
+ * A single-instant request returns at most the row at `start`. Horizons closes some
405
+ * year-step spans with an extra row at STOP_TIME when the next on-series instant falls
406
+ * past it, and STOP_TIME here is the 1 ms closing instant, not a sample the caller asked for.
407
+ */
408
+ const points = singleInstant ? result.points.filter((p) => p.timeUtc === start) : result.points;
259
409
  ctx.log.info('Fetched Horizons ephemeris', {
260
410
  designation: input.designation,
261
- points: result.points.length,
411
+ points: points.length,
262
412
  });
413
+ /**
414
+ * The service marks a page truncated when it sees a row past the cap. Under a bounded
415
+ * stop that row is the last one requested, so a dropped row leaves the cap unreached
416
+ * with nothing after it — yet the series still continues whenever one step past the
417
+ * last point lies inside the requested span.
418
+ */
419
+ const endsAt = points.at(-1)?.timeUtc;
420
+ const nextRow = endsAt === undefined ? undefined : nextStepInstant(endsAt, step);
421
+ const truncated = result.truncated ||
422
+ (page.bounded &&
423
+ nextRow !== undefined &&
424
+ new Date(nextRow).getTime() <= stopInstant.getTime());
425
+ /**
426
+ * Every advertised continuation has to be a call that succeeds, so a page that ends
427
+ * inside the span never resumes past its stop. One step past the last row computes
428
+ * beyond the stop only when the omitted row is one Horizons prints at STOP_TIME off the
429
+ * series — a year step closes with a row on its stop date when the next on-series
430
+ * instant falls past it — and that row is exactly the single instant a resume at the
431
+ * stop returns.
432
+ */
433
+ const endsInside = endsAt !== undefined && new Date(endsAt).getTime() < stopInstant.getTime();
434
+ const resumeFrom = endsInside && nextRow !== undefined && new Date(nextRow).getTime() > stopInstant.getTime()
435
+ ? stop
436
+ : nextRow;
263
437
  /**
264
438
  * `truncated`/`shown`/`cap` are required, so every call populates them or the
265
439
  * effective-output parse fails; INLINE_ROW_CAP mirrors the service's MAX_ROWS.
@@ -273,7 +447,7 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
273
447
  * the earlier.
274
448
  */
275
449
  const caveats = [];
276
- if (result.truncated) {
450
+ if (truncated) {
277
451
  /**
278
452
  * A truncated result is a full page, so its last row is where the returned series
279
453
  * ends. Horizons' START_TIME is inclusive of the first output row, so a caller who
@@ -281,16 +455,14 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
281
455
  * the pages are concatenated. Advertise the instant one step past it instead, so
282
456
  * the continuation picks up the next sample of the same series.
283
457
  */
284
- const endsAt = result.points.at(-1)?.timeUtc;
285
- const resumeFrom = endsAt === undefined ? undefined : nextStepInstant(endsAt, step);
286
458
  caveats.push(`Capped at ${INLINE_ROW_CAP} rows${endsAt ? `, ending at ${endsAt}` : ''}. To retrieve the omitted samples, re-call with start set to ${resumeFrom ?? 'one step past that instant'} — Horizons includes the start instant in its output, so resuming at the last row returned repeats it — or split the requested range into smaller adjacent spans; keep the same step either way and repeat until truncated is false. Widening the step is not equivalent — it discards samples the original range asked for.`);
287
459
  }
288
460
  if (result.dropped > 0) {
289
461
  caveats.push(`Dropped ${result.dropped} of the rows Horizons returned — no usable time, position, or distance — so this series is shorter than the requested step count and has a gap where each dropped row would have been.`);
290
462
  }
291
463
  ctx.enrich({
292
- truncated: result.truncated,
293
- shown: result.points.length,
464
+ truncated,
465
+ shown: points.length,
294
466
  cap: INLINE_ROW_CAP,
295
467
  ...(result.dropped > 0 ? { dropped: result.dropped } : {}),
296
468
  });
@@ -299,7 +471,7 @@ export const getEphemerisTool = tool('astronomy_get_ephemeris', {
299
471
  const out = {
300
472
  designation: result.designation,
301
473
  ...(result.targetName ? { target_name: result.targetName } : {}),
302
- points: result.points.map((p) => ({
474
+ points: points.map((p) => ({
303
475
  time_utc: p.timeUtc,
304
476
  ra_hours: p.raHours,
305
477
  dec_degrees: p.decDegrees,