@cyanheads/noaa-spaceweather-mcp-server 0.1.13 → 0.2.0
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.
- package/AGENTS.md +6 -4
- package/CLAUDE.md +6 -4
- package/README.md +26 -17
- package/changelog/0.1.x/0.1.14.md +32 -0
- package/changelog/0.2.x/0.2.0.md +21 -0
- package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts +19 -1
- package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-alerts.tool.js +281 -41
- package/dist/mcp-server/tools/definitions/get-alerts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts +9 -1
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js +91 -52
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts +27 -8
- package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-conditions.tool.js +234 -38
- package/dist/mcp-server/tools/definitions/get-conditions.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.js +21 -6
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts +32 -2
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js +243 -39
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts +17 -1
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js +150 -21
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +111 -14
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/services/space-weather/space-weather-service.d.ts +76 -3
- package/dist/services/space-weather/space-weather-service.d.ts.map +1 -1
- package/dist/services/space-weather/space-weather-service.js +539 -82
- package/dist/services/space-weather/space-weather-service.js.map +1 -1
- package/dist/services/space-weather/types.d.ts +177 -21
- package/dist/services/space-weather/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/server.json +3 -3
|
@@ -15,28 +15,172 @@ const ScaleSummarySchema = z
|
|
|
15
15
|
label: z.string().describe('NOAA scale string, e.g. "G2", "R1", "S0".'),
|
|
16
16
|
})
|
|
17
17
|
.describe('Current level and label for one NOAA storm scale category.');
|
|
18
|
+
/**
|
|
19
|
+
* SWPC issues no R or S *level* for a future day — it issues a probability. So the
|
|
20
|
+
* forecast entries carry a nullable scale alongside the probabilities, while `today`
|
|
21
|
+
* and `forecast[].G` keep {@link ScaleSummarySchema}: those do carry a real level.
|
|
22
|
+
* The R/S asymmetry is upstream's — two probabilities for R, one for S.
|
|
23
|
+
*/
|
|
24
|
+
const RadioForecastSchema = z
|
|
25
|
+
.object({
|
|
26
|
+
scale: z
|
|
27
|
+
.number()
|
|
28
|
+
.nullable()
|
|
29
|
+
.describe('R-scale level 0–5, or null — SWPC forecasts a radio-blackout probability for a future day rather than a level.'),
|
|
30
|
+
text: z
|
|
31
|
+
.string()
|
|
32
|
+
.nullable()
|
|
33
|
+
.describe('Human-readable R-scale descriptor, or null when no level was issued.'),
|
|
34
|
+
label: z
|
|
35
|
+
.string()
|
|
36
|
+
.nullable()
|
|
37
|
+
.describe('NOAA scale string, e.g. "R1", or null when no level was issued.'),
|
|
38
|
+
minorProbPercent: z
|
|
39
|
+
.number()
|
|
40
|
+
.nullable()
|
|
41
|
+
.describe('Probability (%) of an R1–R2 minor-to-moderate radio blackout on this day, or null when SWPC issued none.'),
|
|
42
|
+
majorProbPercent: z
|
|
43
|
+
.number()
|
|
44
|
+
.nullable()
|
|
45
|
+
.describe('Probability (%) of an R3 or greater strong radio blackout on this day, or null when SWPC issued none.'),
|
|
46
|
+
})
|
|
47
|
+
.describe('Forecast radio blackout outlook for one day — a level, a probability, or neither.');
|
|
48
|
+
const RadiationForecastSchema = z
|
|
49
|
+
.object({
|
|
50
|
+
scale: z
|
|
51
|
+
.number()
|
|
52
|
+
.nullable()
|
|
53
|
+
.describe('S-scale level 0–5, or null — SWPC forecasts a radiation-storm probability for a future day rather than a level.'),
|
|
54
|
+
text: z
|
|
55
|
+
.string()
|
|
56
|
+
.nullable()
|
|
57
|
+
.describe('Human-readable S-scale descriptor, or null when no level was issued.'),
|
|
58
|
+
label: z
|
|
59
|
+
.string()
|
|
60
|
+
.nullable()
|
|
61
|
+
.describe('NOAA scale string, e.g. "S1", or null when no level was issued.'),
|
|
62
|
+
probPercent: z
|
|
63
|
+
.number()
|
|
64
|
+
.nullable()
|
|
65
|
+
.describe('Probability (%) of an S1 or greater solar radiation storm on this day, or null when SWPC issued none.'),
|
|
66
|
+
})
|
|
67
|
+
.describe('Forecast solar radiation storm outlook for one day — a level, a probability, or neither.');
|
|
18
68
|
const ForecastPeriodSchema = z
|
|
19
69
|
.object({
|
|
20
|
-
date: z.string().describe('Forecast date string.'),
|
|
21
|
-
G: ScaleSummarySchema.describe('Geomagnetic storm scale for this day.'),
|
|
22
|
-
R:
|
|
23
|
-
S:
|
|
70
|
+
date: z.string().describe('Forecast date string, e.g. "2026-06-04".'),
|
|
71
|
+
G: ScaleSummarySchema.describe('Geomagnetic storm scale forecast for this day.'),
|
|
72
|
+
R: RadioForecastSchema.describe('Radio blackout outlook for this day.'),
|
|
73
|
+
S: RadiationForecastSchema.describe('Solar radiation storm outlook for this day.'),
|
|
74
|
+
})
|
|
75
|
+
.describe('One day of the NOAA scale forecast series.');
|
|
76
|
+
const DiscussionSchema = z
|
|
77
|
+
.object({
|
|
78
|
+
issued: z
|
|
79
|
+
.string()
|
|
80
|
+
.nullable()
|
|
81
|
+
.describe('ISO 8601 UTC time the discussion was issued, from the product\'s ":Issued:" line, e.g. "2026-06-04T12:30:00Z". Null when the product carries no such line.'),
|
|
82
|
+
sections: z
|
|
83
|
+
.array(z
|
|
84
|
+
.object({
|
|
85
|
+
topic: z
|
|
86
|
+
.string()
|
|
87
|
+
.describe('Section heading, e.g. "Solar Activity", "Energetic Particle", "Solar Wind", "Geospace".'),
|
|
88
|
+
summary: z
|
|
89
|
+
.string()
|
|
90
|
+
.nullable()
|
|
91
|
+
.describe('Past-24 h summary text, or null when the section carries no ".24 hr Summary..." text.'),
|
|
92
|
+
forecast: z
|
|
93
|
+
.string()
|
|
94
|
+
.nullable()
|
|
95
|
+
.describe('Forecast text for the next 3 days, or null when the section carries no ".Forecast..." block.'),
|
|
96
|
+
})
|
|
97
|
+
.describe("One topic section of the discussion — its heading and the forecaster's text."))
|
|
98
|
+
.describe('One entry per topic section, in product order.'),
|
|
24
99
|
})
|
|
25
|
-
.describe('
|
|
100
|
+
.describe("SWPC Forecast Discussion — the forecaster's narrative behind the storm scales. Null when include_discussion is false.");
|
|
101
|
+
// ── Normalization helpers ───────────────────────────────────────────────────
|
|
102
|
+
/** Join the present fragments of a phrase, so an absent descriptor leaves no gap. */
|
|
103
|
+
function joinWords(words) {
|
|
104
|
+
return words.filter((word) => Boolean(word)).join(' ');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Map a level-carrying entry onto {@link ScaleSummarySchema}, which declares `scale` as
|
|
108
|
+
* a plain number: today's period and every forecast G entry do carry a real `Scale`
|
|
109
|
+
* upstream.
|
|
110
|
+
*
|
|
111
|
+
* A null one is not resolved to 0. That is the claim #23 removed from the forecast R/S
|
|
112
|
+
* — "level 0, no storm" is a different statement from "SWPC issued no level" — and it
|
|
113
|
+
* would read the same way here, on a surface with no probability to fall back to. The
|
|
114
|
+
* period instead reports the shape break it is, on the reason the tool already declares
|
|
115
|
+
* for a feed that answers without its documented shape.
|
|
116
|
+
*/
|
|
117
|
+
function observedScale(entry, period, fail) {
|
|
118
|
+
if (entry.scale === null)
|
|
119
|
+
throw fail(`SWPC scales feed issued no ${entry.category} level for the ${period} period.`);
|
|
120
|
+
return {
|
|
121
|
+
scale: entry.scale,
|
|
122
|
+
text: entry.text ?? '',
|
|
123
|
+
label: `${entry.category}${entry.scale}`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Map the level half of a forecast R/S entry, preserving a null SWPC issued no level
|
|
128
|
+
* for. `label` is null in lockstep with `scale` — there is no "R" string to build
|
|
129
|
+
* without a number.
|
|
130
|
+
*/
|
|
131
|
+
function forecastLevel(entry) {
|
|
132
|
+
return {
|
|
133
|
+
scale: entry.scale,
|
|
134
|
+
text: entry.text,
|
|
135
|
+
label: entry.scale === null ? null : `${entry.category}${entry.scale}`,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Render one forecast R/S cell for `format()`.
|
|
140
|
+
*
|
|
141
|
+
* The level and the probabilities render independently. Gating the probabilities on a
|
|
142
|
+
* null level would leave them unrendered for a schema-valid combination — a day with
|
|
143
|
+
* both — so a probability is shown whenever SWPC issued one. A day upstream issued
|
|
144
|
+
* neither a level nor a probability for reads "—" rather than claiming level 0.
|
|
145
|
+
*/
|
|
146
|
+
function forecastCell(category, entry, probabilities) {
|
|
147
|
+
const level = joinWords([
|
|
148
|
+
entry.scale === null ? entry.label : `${entry.label ?? category} (scale ${entry.scale})`,
|
|
149
|
+
// "none" alongside an explicit level 0 adds nothing.
|
|
150
|
+
entry.text && entry.text.toLowerCase() !== 'none' ? entry.text : null,
|
|
151
|
+
]);
|
|
152
|
+
const chances = probabilities
|
|
153
|
+
.filter((probability) => probability[0] !== null)
|
|
154
|
+
.map(([percent, of]) => `${percent}% ${of}`)
|
|
155
|
+
.join(', ');
|
|
156
|
+
return `${category}: ${[level, chances].filter(Boolean).join(' · ') || '—'}`;
|
|
157
|
+
}
|
|
158
|
+
/** The "G2 moderate geomagnetic storm" fragment for an in-progress storm, else null. */
|
|
159
|
+
function stormPhrase(entry, phenomenon) {
|
|
160
|
+
if (entry.scale === null || entry.scale < 1)
|
|
161
|
+
return null;
|
|
162
|
+
return joinWords([`${entry.category}${entry.scale}`, entry.text?.toLowerCase(), phenomenon]);
|
|
163
|
+
}
|
|
26
164
|
// ── Tool ────────────────────────────────────────────────────────────────────
|
|
27
165
|
export const getConditions = tool('noaa_spaceweather_get_conditions', {
|
|
28
166
|
title: 'Get Space Weather Conditions',
|
|
29
167
|
description: 'Current space-weather snapshot: NOAA R/S/G storm scales (today + 3-day forecast), latest Kp ' +
|
|
30
168
|
'index with its G-scale equivalent and aurora-visibility latitude, and a plain-language status ' +
|
|
31
|
-
'summary.
|
|
169
|
+
'summary. Optionally includes the SWPC forecast discussion explaining what is driving the ' +
|
|
170
|
+
'forecast. The quickest way to answer "is anything happening right now?" — use before deciding ' +
|
|
32
171
|
'whether to drill into solar wind (noaa_spaceweather_get_solar_wind), aurora ' +
|
|
33
172
|
'(noaa_spaceweather_get_aurora_forecast), or alert details (noaa_spaceweather_get_alerts).',
|
|
34
173
|
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
35
|
-
input: z.object({
|
|
174
|
+
input: z.object({
|
|
175
|
+
include_discussion: z
|
|
176
|
+
.boolean()
|
|
177
|
+
.default(false)
|
|
178
|
+
.describe("Also fetch SWPC's forecaster-written Forecast Discussion, which explains why the forecast looks the way it does (CME versus coronal-hole stream, expected arrival). Costs one extra upstream request."),
|
|
179
|
+
}),
|
|
36
180
|
output: z.object({
|
|
37
181
|
observedAt: z
|
|
38
182
|
.string()
|
|
39
|
-
.describe('UTC date and time of the NOAA scales data period this snapshot reflects, e.g. "2026-06-
|
|
183
|
+
.describe('ISO 8601 UTC date and time of the NOAA scales data period this snapshot reflects, e.g. "2026-06-04T15:00:00Z".'),
|
|
40
184
|
currentKp: z.number().describe('Latest observed planetary K-index (0–9).'),
|
|
41
185
|
currentGScale: z.number().describe('NOAA G-scale equivalent for current Kp (0–5).'),
|
|
42
186
|
auroraLatitude: z
|
|
@@ -49,24 +193,40 @@ export const getConditions = tool('noaa_spaceweather_get_conditions', {
|
|
|
49
193
|
S: ScaleSummarySchema.describe("Today's solar radiation storm scale."),
|
|
50
194
|
})
|
|
51
195
|
.describe('Current observed NOAA storm scales for today.'),
|
|
52
|
-
forecast: z
|
|
196
|
+
forecast: z
|
|
197
|
+
.array(ForecastPeriodSchema)
|
|
198
|
+
.describe("SWPC's 3-day NOAA scale forecast, oldest first. The series starts with today — the same calendar day as observedAt — and covers the next two days."),
|
|
53
199
|
summary: z
|
|
54
200
|
.string()
|
|
55
201
|
.describe('Plain-language status summary suitable for display, e.g. "Quiet conditions" or "G2 moderate geomagnetic storm in progress."'),
|
|
202
|
+
discussion: DiscussionSchema.nullable().describe('SWPC Forecast Discussion when include_discussion is true, otherwise null.'),
|
|
56
203
|
}),
|
|
57
204
|
errors: [
|
|
58
205
|
{
|
|
59
206
|
reason: 'feed_unavailable',
|
|
60
207
|
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
61
|
-
when: 'SWPC
|
|
208
|
+
when: 'SWPC feed returns 5xx or 429, times out, or answers with a body that is not parseable JSON. Retried before failing.',
|
|
62
209
|
retryable: true,
|
|
63
210
|
recovery: 'Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.',
|
|
64
211
|
},
|
|
212
|
+
{
|
|
213
|
+
reason: 'feed_moved',
|
|
214
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
215
|
+
when: 'SWPC feed path returns a permanent 4xx (404, 410, 401, 403), or a feed answers without the shape it is documented to have — the scales feed no longer carrying its "0" (today) period, or the forecast discussion carrying no topic section. Fails in one attempt.',
|
|
216
|
+
retryable: false,
|
|
217
|
+
recovery: 'Retrying will not help — the SWPC feed path no longer resolves or no longer has the expected shape; the feed URL needs updating against SWPC current inventory.',
|
|
218
|
+
},
|
|
65
219
|
],
|
|
66
|
-
async handler(
|
|
67
|
-
ctx.log.info('Fetching current space weather conditions'
|
|
220
|
+
async handler(input, ctx) {
|
|
221
|
+
ctx.log.info('Fetching current space weather conditions', {
|
|
222
|
+
includeDiscussion: input.include_discussion,
|
|
223
|
+
});
|
|
68
224
|
const svc = getSpaceWeatherService();
|
|
69
|
-
const [scales, kpObs] = await Promise.all([
|
|
225
|
+
const [scales, kpObs, discussion] = await Promise.all([
|
|
226
|
+
svc.getNoaaScales(ctx),
|
|
227
|
+
svc.getKpObserved(ctx),
|
|
228
|
+
input.include_discussion ? svc.getForecastDiscussion(ctx) : null,
|
|
229
|
+
]);
|
|
70
230
|
// Latest Kp is the last element of the observed array
|
|
71
231
|
const latestKp = kpObs.length > 0 ? kpObs[kpObs.length - 1] : null;
|
|
72
232
|
const currentKp = latestKp?.kp ?? 0;
|
|
@@ -74,13 +234,11 @@ export const getConditions = tool('noaa_spaceweather_get_conditions', {
|
|
|
74
234
|
const auroraLatitude = latestKp?.auroraLatitude ?? 'No significant aurora expected at mid-latitudes';
|
|
75
235
|
const today = scales.today;
|
|
76
236
|
// Build summary — incorporate both current conditions and notable forecast activity.
|
|
77
|
-
const parts = [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (today.S.scale >= 1)
|
|
83
|
-
parts.push(`S${today.S.scale} ${today.S.text.toLowerCase()} solar radiation storm`);
|
|
237
|
+
const parts = [
|
|
238
|
+
stormPhrase(today.G, 'geomagnetic storm'),
|
|
239
|
+
stormPhrase(today.R, 'radio blackout'),
|
|
240
|
+
stormPhrase(today.S, 'solar radiation storm'),
|
|
241
|
+
].filter((phrase) => phrase !== null);
|
|
84
242
|
let summary;
|
|
85
243
|
if (parts.length > 0) {
|
|
86
244
|
summary =
|
|
@@ -88,37 +246,50 @@ export const getConditions = tool('noaa_spaceweather_get_conditions', {
|
|
|
88
246
|
' in progress.';
|
|
89
247
|
}
|
|
90
248
|
else {
|
|
91
|
-
// Check forecast for upcoming elevated activity —
|
|
92
|
-
|
|
93
|
-
|
|
249
|
+
// Check the forecast for upcoming elevated activity — the highest G-scale day.
|
|
250
|
+
// The descriptor rides along with the peak instead of being looked up by date
|
|
251
|
+
// afterwards: the series opens on today, so a date does not identify a period.
|
|
252
|
+
let peak = null;
|
|
94
253
|
for (const p of scales.forecast) {
|
|
95
|
-
if (p.G.scale >
|
|
96
|
-
|
|
97
|
-
peakDate = p.date;
|
|
254
|
+
if (p.G.scale !== null && p.G.scale > (peak?.scale ?? 0)) {
|
|
255
|
+
peak = { date: p.date, scale: p.G.scale, text: p.G.text };
|
|
98
256
|
}
|
|
99
257
|
}
|
|
258
|
+
// The series starts with today, so naming its date would read as a future day.
|
|
259
|
+
const when = peak === null || peak.date === today.date ? 'today' : peak.date;
|
|
100
260
|
summary =
|
|
101
|
-
|
|
102
|
-
?
|
|
103
|
-
:
|
|
261
|
+
peak === null
|
|
262
|
+
? 'Quiet conditions — no significant storms active.'
|
|
263
|
+
: `Quiet now — ${joinWords([`G${peak.scale}`, peak.text?.toLowerCase(), 'geomagnetic storm'])} forecast for ${when}.`;
|
|
104
264
|
}
|
|
265
|
+
/** A missing level is a feed shape break — see {@link observedScale}. */
|
|
266
|
+
const failOnMissingLevel = (message) => ctx.fail('feed_moved', message, ctx.recoveryFor('feed_moved'));
|
|
105
267
|
return {
|
|
106
|
-
observedAt:
|
|
268
|
+
observedAt: today.observedAt,
|
|
107
269
|
currentKp,
|
|
108
270
|
currentGScale,
|
|
109
271
|
auroraLatitude,
|
|
110
272
|
today: {
|
|
111
|
-
G:
|
|
112
|
-
R:
|
|
113
|
-
S:
|
|
273
|
+
G: observedScale(today.G, 'today', failOnMissingLevel),
|
|
274
|
+
R: observedScale(today.R, 'today', failOnMissingLevel),
|
|
275
|
+
S: observedScale(today.S, 'today', failOnMissingLevel),
|
|
114
276
|
},
|
|
115
277
|
forecast: scales.forecast.map((p) => ({
|
|
116
278
|
date: p.date,
|
|
117
|
-
G:
|
|
118
|
-
R: {
|
|
119
|
-
|
|
279
|
+
G: observedScale(p.G, `${p.date} forecast`, failOnMissingLevel),
|
|
280
|
+
R: {
|
|
281
|
+
...forecastLevel(p.R),
|
|
282
|
+
minorProbPercent: p.R.minorProb,
|
|
283
|
+
majorProbPercent: p.R.majorProb,
|
|
284
|
+
},
|
|
285
|
+
S: {
|
|
286
|
+
...forecastLevel(p.S),
|
|
287
|
+
// SWPC gives S a single "Prob"; the service parks it in minorProb.
|
|
288
|
+
probPercent: p.S.minorProb,
|
|
289
|
+
},
|
|
120
290
|
})),
|
|
121
291
|
summary,
|
|
292
|
+
discussion,
|
|
122
293
|
};
|
|
123
294
|
},
|
|
124
295
|
format: (result) => {
|
|
@@ -137,9 +308,34 @@ export const getConditions = tool('noaa_spaceweather_get_conditions', {
|
|
|
137
308
|
lines.push(`- **Solar Radiation (S):** ${result.today.S.label} (scale ${result.today.S.scale}) ${scaleText(result.today.S.text)}`);
|
|
138
309
|
if (result.forecast.length > 0) {
|
|
139
310
|
lines.push('');
|
|
140
|
-
lines.push('### 3-Day Forecast');
|
|
311
|
+
lines.push('### 3-Day Forecast (starts today)');
|
|
141
312
|
for (const day of result.forecast) {
|
|
142
|
-
|
|
313
|
+
const cells = [
|
|
314
|
+
`${day.G.label} (scale ${day.G.scale}) ${scaleText(day.G.text)}`,
|
|
315
|
+
forecastCell('R', day.R, [
|
|
316
|
+
[day.R.minorProbPercent, 'R1–R2'],
|
|
317
|
+
[day.R.majorProbPercent, 'R3+'],
|
|
318
|
+
]),
|
|
319
|
+
forecastCell('S', day.S, [[day.S.probPercent, 'S1+']]),
|
|
320
|
+
];
|
|
321
|
+
lines.push(`**${day.date}:** ${cells.join(' | ')}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (result.discussion) {
|
|
325
|
+
lines.push('');
|
|
326
|
+
lines.push('### SWPC Forecast Discussion');
|
|
327
|
+
lines.push(result.discussion.issued === null
|
|
328
|
+
? '_Issue time not stated in the product._'
|
|
329
|
+
: `_Issued ${result.discussion.issued}_`);
|
|
330
|
+
for (const section of result.discussion.sections) {
|
|
331
|
+
lines.push('');
|
|
332
|
+
lines.push(`**${section.topic}**`);
|
|
333
|
+
if (section.summary)
|
|
334
|
+
lines.push(`_Past 24 h:_ ${section.summary}`);
|
|
335
|
+
if (section.forecast)
|
|
336
|
+
lines.push(`_Forecast:_ ${section.forecast}`);
|
|
337
|
+
if (!section.summary && !section.forecast)
|
|
338
|
+
lines.push('_No text in this section._');
|
|
143
339
|
}
|
|
144
340
|
}
|
|
145
341
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-conditions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-conditions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAE3F,+EAA+E;AAE/E,MAAM,kBAAkB,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACpD,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CAAC,0EAA0E,CAAC;IACvF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACxE,CAAC;KACD,QAAQ,CAAC,4DAA4D,CAAC,CAAC;AAE1E,MAAM,oBAAoB,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CA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SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CACpN,CAAC;YACJ,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":"get-conditions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-conditions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAG3F,+EAA+E;AAE/E,MAAM,kBAAkB,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACpD,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CAAC,0EAA0E,CAAC;IACvF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACxE,CAAC;KACD,QAAQ,CAAC,4DAA4D,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,gHAAgH,CACjH;IACH,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sEAAsE,CAAC;IACnF,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iEAAiE,CAAC;IAC9E,gBAAgB,EAAE,CAAC;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p-ts-core").ToolDefinition
|
|
|
29
29
|
}, z.core.$strip>, readonly [{
|
|
30
30
|
readonly reason: "feed_unavailable";
|
|
31
31
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
32
|
-
readonly when: "SWPC
|
|
32
|
+
readonly when: "SWPC feed returns 5xx or 429, times out, or answers with a body that is not parseable JSON. Retried before failing.";
|
|
33
33
|
readonly retryable: true;
|
|
34
34
|
readonly recovery: "Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.";
|
|
35
|
+
}, {
|
|
36
|
+
readonly reason: "feed_moved";
|
|
37
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
38
|
+
readonly when: "SWPC feed path returns a permanent 4xx (404, 410, 401, 403). Fails in one attempt.";
|
|
39
|
+
readonly retryable: false;
|
|
40
|
+
readonly recovery: "Retrying will not help — the SWPC feed path no longer resolves or no longer has the expected shape; the feed URL needs updating against SWPC current inventory.";
|
|
35
41
|
}], undefined>;
|
|
36
42
|
//# sourceMappingURL=get-kp-index.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-kp-index.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-kp-index.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-kp-index.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-kp-index.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0CjE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwIrB,CAAC"}
|
|
@@ -9,9 +9,13 @@ const KpObsSchema = z
|
|
|
9
9
|
.object({
|
|
10
10
|
timeTag: z.string().describe('ISO 8601 3-hour interval time tag.'),
|
|
11
11
|
kp: z.number().describe('Kp index value 0–9.'),
|
|
12
|
-
gScale: z
|
|
12
|
+
gScale: z
|
|
13
|
+
.number()
|
|
14
|
+
.describe('NOAA G-scale equivalent (0–5). Each level starts at its "minus" third — G1 at Kp 4.67, G2 at 5.67, G3 at 6.67, G4 at 7.67 (through 8.67), G5 at 9.'),
|
|
13
15
|
gLabel: z.string().describe('NOAA G-scale label, e.g. "G0", "G3".'),
|
|
14
|
-
auroraLatitude: z
|
|
16
|
+
auroraLatitude: z
|
|
17
|
+
.string()
|
|
18
|
+
.describe('Aurora visibility guidance for this Kp level, in geomagnetic latitude.'),
|
|
15
19
|
})
|
|
16
20
|
.describe('One observed Kp 3-hour interval reading.');
|
|
17
21
|
const KpForecastSchema = z
|
|
@@ -25,7 +29,9 @@ const KpForecastSchema = z
|
|
|
25
29
|
.string()
|
|
26
30
|
.nullable()
|
|
27
31
|
.describe('NOAA scale string, e.g. "G1", null when not available.'),
|
|
28
|
-
gScale: z
|
|
32
|
+
gScale: z
|
|
33
|
+
.number()
|
|
34
|
+
.describe('NOAA G-scale equivalent (0–5) derived from Kp, on the same minus-third band floors SWPC uses — it agrees with noaaScale when the feed states one.'),
|
|
29
35
|
gLabel: z.string().describe('NOAA G-scale label, e.g. "G0", "G3".'),
|
|
30
36
|
})
|
|
31
37
|
.describe('One forward-looking Kp forecast interval (estimated or predicted).');
|
|
@@ -33,8 +39,10 @@ export const getKpIndex = tool('noaa_spaceweather_get_kp_index', {
|
|
|
33
39
|
title: 'Get Kp Index',
|
|
34
40
|
description: 'Planetary K-index (0–9 geomagnetic activity scale) — recent observed 3-hour values with their ' +
|
|
35
41
|
'NOAA G-scale equivalents and aurora-latitude guidance, plus the 3-day Kp forecast series. ' +
|
|
36
|
-
'Kp is the primary driver of aurora visibility and geomagnetic storm severity
|
|
37
|
-
'
|
|
42
|
+
'Kp is the primary driver of aurora visibility and geomagnetic storm severity. SWPC reports Kp ' +
|
|
43
|
+
'in thirds and starts each G level at that level’s "minus" value: Kp 4.67 (5−) is G1, Kp 6.67 ' +
|
|
44
|
+
'(7−) is G3 (aurora to ~50° geomagnetic), Kp 8.67 (9−) is still G4, and only Kp 9 is G5 extreme. ' +
|
|
45
|
+
'Use noaa_spaceweather_get_conditions for a ' +
|
|
38
46
|
'combined snapshot including storm scales; use this tool when you need the Kp time series or ' +
|
|
39
47
|
'forecast detail.',
|
|
40
48
|
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
@@ -65,10 +73,17 @@ export const getKpIndex = tool('noaa_spaceweather_get_kp_index', {
|
|
|
65
73
|
{
|
|
66
74
|
reason: 'feed_unavailable',
|
|
67
75
|
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
68
|
-
when: 'SWPC
|
|
76
|
+
when: 'SWPC feed returns 5xx or 429, times out, or answers with a body that is not parseable JSON. Retried before failing.',
|
|
69
77
|
retryable: true,
|
|
70
78
|
recovery: 'Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.',
|
|
71
79
|
},
|
|
80
|
+
{
|
|
81
|
+
reason: 'feed_moved',
|
|
82
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
83
|
+
when: 'SWPC feed path returns a permanent 4xx (404, 410, 401, 403). Fails in one attempt.',
|
|
84
|
+
retryable: false,
|
|
85
|
+
recovery: 'Retrying will not help — the SWPC feed path no longer resolves or no longer has the expected shape; the feed URL needs updating against SWPC current inventory.',
|
|
86
|
+
},
|
|
72
87
|
],
|
|
73
88
|
async handler(input, ctx) {
|
|
74
89
|
ctx.log.info('Fetching Kp index', { window_days: input.window_days });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-kp-index.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-kp-index.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OA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K,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC3B,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAM,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACrD,KAAK,CAAC,IAAI,CACR,KAAK,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,KAAK,KAAK,CAAC,CAAC,QAAQ,GAAG,CACzF,CAAC;YACJ,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"}
|
|
@@ -6,19 +6,41 @@ import { z } from '@cyanheads/mcp-ts-core';
|
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
export declare const getSolarActivity: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
8
|
include_regions: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
flare_hours: z.ZodDefault<z.ZodNumber>;
|
|
9
10
|
}, z.core.$strip>, z.ZodObject<{
|
|
10
11
|
latestXray: z.ZodNullable<z.ZodObject<{
|
|
11
12
|
timeTag: z.ZodString;
|
|
12
13
|
fluxWm2: z.ZodString;
|
|
14
|
+
fluxWm2Value: z.ZodNumber;
|
|
13
15
|
flareClass: z.ZodString;
|
|
16
|
+
flareClassFull: z.ZodNullable<z.ZodString>;
|
|
14
17
|
satellite: z.ZodNumber;
|
|
15
18
|
}, z.core.$strip>>;
|
|
16
19
|
recentXray: z.ZodArray<z.ZodObject<{
|
|
17
20
|
timeTag: z.ZodString;
|
|
18
21
|
fluxWm2: z.ZodString;
|
|
22
|
+
fluxWm2Value: z.ZodNumber;
|
|
19
23
|
flareClass: z.ZodString;
|
|
24
|
+
flareClassFull: z.ZodNullable<z.ZodString>;
|
|
20
25
|
satellite: z.ZodNumber;
|
|
21
26
|
}, z.core.$strip>>;
|
|
27
|
+
recentFlares: z.ZodArray<z.ZodObject<{
|
|
28
|
+
beginTime: z.ZodString;
|
|
29
|
+
maxTime: z.ZodString;
|
|
30
|
+
endTime: z.ZodNullable<z.ZodString>;
|
|
31
|
+
beginClass: z.ZodString;
|
|
32
|
+
maxClass: z.ZodString;
|
|
33
|
+
endClass: z.ZodNullable<z.ZodString>;
|
|
34
|
+
peakFluxWm2: z.ZodNumber;
|
|
35
|
+
rScale: z.ZodNumber;
|
|
36
|
+
satellite: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
f107: z.ZodNullable<z.ZodObject<{
|
|
39
|
+
observedTime: z.ZodString;
|
|
40
|
+
fluxSfu: z.ZodNumber;
|
|
41
|
+
ninetyDayMeanSfu: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
reportingSchedule: z.ZodString;
|
|
43
|
+
}, z.core.$strip>>;
|
|
22
44
|
probabilities: z.ZodArray<z.ZodObject<{
|
|
23
45
|
date: z.ZodString;
|
|
24
46
|
cClass1Day: z.ZodNumber;
|
|
@@ -55,8 +77,16 @@ export declare const getSolarActivity: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
55
77
|
}, z.core.$strip>, readonly [{
|
|
56
78
|
readonly reason: "feed_unavailable";
|
|
57
79
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
58
|
-
readonly when: "SWPC
|
|
80
|
+
readonly when: "SWPC feed returns 5xx or 429, times out, or answers with a body that is not parseable JSON. Retried before failing.";
|
|
59
81
|
readonly retryable: true;
|
|
60
82
|
readonly recovery: "Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.";
|
|
61
|
-
}
|
|
83
|
+
}, {
|
|
84
|
+
readonly reason: "feed_moved";
|
|
85
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
86
|
+
readonly when: "SWPC feed path returns a permanent 4xx (404, 410, 401, 403). Fails in one attempt.";
|
|
87
|
+
readonly retryable: false;
|
|
88
|
+
readonly recovery: "Retrying will not help — the SWPC feed path no longer resolves or no longer has the expected shape; the feed URL needs updating against SWPC current inventory.";
|
|
89
|
+
}], {
|
|
90
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}>;
|
|
62
92
|
//# sourceMappingURL=get-solar-activity.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-solar-activity.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-solar-activity.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-solar-activity.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-solar-activity.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAuQjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqT3B,CAAC"}
|