@cyanheads/noaa-spaceweather-mcp-server 0.5.0 → 0.6.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 -5
- package/CLAUDE.md +6 -5
- package/README.md +10 -9
- package/changelog/0.6.x/0.6.0.md +41 -0
- package/changelog/template.md +10 -8
- package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-alerts.tool.js +31 -32
- 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 +2 -2
- 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 +19 -22
- 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 +16 -14
- package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-conditions.tool.js +56 -47
- 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 +8 -5
- 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 +64 -42
- 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 +23 -16
- 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 +151 -64
- 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 +2 -2
- 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 +5 -28
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +105 -93
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/services/space-weather/kp-headline.d.ts +30 -0
- package/dist/services/space-weather/kp-headline.d.ts.map +1 -0
- package/dist/services/space-weather/kp-headline.js +39 -0
- package/dist/services/space-weather/kp-headline.js.map +1 -0
- package/dist/services/space-weather/space-weather-service.d.ts +36 -7
- package/dist/services/space-weather/space-weather-service.d.ts.map +1 -1
- package/dist/services/space-weather/space-weather-service.js +257 -98
- package/dist/services/space-weather/space-weather-service.js.map +1 -1
- package/dist/services/space-weather/types.d.ts +88 -32
- package/dist/services/space-weather/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/server.json +3 -3
- package/skills/noaa-spaceweather-guide/SKILL.md +8 -8
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { escapeMarkdownInline } from '@cyanheads/mcp-ts-core/utils';
|
|
8
|
+
import { kpHeadline, timeTagList } from '../../../services/space-weather/kp-headline.js';
|
|
8
9
|
import { getSpaceWeatherService, kpToGScale, } from '../../../services/space-weather/space-weather-service.js';
|
|
9
10
|
const KpObsSchema = z
|
|
10
11
|
.object({
|
|
@@ -30,14 +31,7 @@ const KpForecastSchema = z
|
|
|
30
31
|
.describe('One Kp forecast interval.');
|
|
31
32
|
export const getKpIndex = tool('noaa_spaceweather_get_kp_index', {
|
|
32
33
|
title: 'Get Kp Index',
|
|
33
|
-
description:
|
|
34
|
-
'NOAA G-scale equivalents and aurora-latitude guidance, plus the 3-day Kp forecast series. ' +
|
|
35
|
-
'Kp is the primary driver of aurora visibility and geomagnetic storm severity. SWPC reports Kp ' +
|
|
36
|
-
'in thirds and starts each G level at that level’s "minus" value: Kp 4.67 (5−) is G1, Kp 6.67 ' +
|
|
37
|
-
'(7−) is G3 (aurora to ~50° geomagnetic), Kp 8.67 (9−) is still G4, and only Kp 9 is G5 extreme. ' +
|
|
38
|
-
'Use noaa_spaceweather_get_conditions for a ' +
|
|
39
|
-
'combined snapshot including storm scales; use this tool when you need the Kp time series or ' +
|
|
40
|
-
'forecast detail.',
|
|
34
|
+
description: `Planetary K-index (0–9 geomagnetic activity scale) — recent observed 3-hour values with their NOAA G-scale equivalents and aurora-latitude guidance, plus the 3-day Kp forecast series. Kp is the primary driver of aurora visibility and geomagnetic storm severity. SWPC reports Kp in thirds and starts each G level at that level’s "minus" value: Kp 4.67 (5−) is G1, Kp 6.67 (7−) is G3 (aurora to ~50° geomagnetic), Kp 8.67 (9−) is still G4, and only Kp 9 is G5 extreme. Use noaa_spaceweather_get_conditions for a combined snapshot including storm scales; use this tool when you need the Kp time series or forecast detail.`,
|
|
41
35
|
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
42
36
|
input: z.object({
|
|
43
37
|
window_days: z
|
|
@@ -53,16 +47,29 @@ export const getKpIndex = tool('noaa_spaceweather_get_kp_index', {
|
|
|
53
47
|
forecast: z
|
|
54
48
|
.array(KpForecastSchema)
|
|
55
49
|
.describe('Kp forecast series: estimated and predicted entries, no observed history.'),
|
|
56
|
-
currentKp: z
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
currentKp: z
|
|
51
|
+
.number()
|
|
52
|
+
.nullable()
|
|
53
|
+
.describe('Latest observed Kp in the window; null when none has a value.'),
|
|
54
|
+
currentGScale: z.number().nullable().describe('G level (0–5) for currentKp.'),
|
|
55
|
+
auroraLatitude: z.string().nullable().describe('Aurora guidance for currentKp.'),
|
|
56
|
+
currentKpTimeTag: z
|
|
57
|
+
.string()
|
|
58
|
+
.nullable()
|
|
59
|
+
.describe('Start (ISO 8601 UTC) of the 3-hour bin currentKp is from.'),
|
|
60
|
+
kpUnavailableBins: z
|
|
61
|
+
.array(z.string())
|
|
62
|
+
.describe('Observed time tags in the window with no Kp value, oldest first.'),
|
|
63
|
+
forecastUnavailableBins: z
|
|
64
|
+
.array(z.string())
|
|
65
|
+
.describe('Forecast time tags with no Kp value, oldest first.'),
|
|
59
66
|
observedCount: z.number().describe('Entries in observed.'),
|
|
60
67
|
}),
|
|
61
68
|
errors: [
|
|
62
69
|
{
|
|
63
70
|
reason: 'feed_unavailable',
|
|
64
71
|
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
65
|
-
when: 'SWPC feed returns 5xx or 429, times out, or answers with a body that is not parseable JSON. Retried for up to 45 seconds in total before failing.',
|
|
72
|
+
when: 'SWPC feed returns a 5xx other than 501 or a 429, times out, or answers with a body that is not parseable JSON. Retried for up to 45 seconds in total before failing.',
|
|
66
73
|
retryable: true,
|
|
67
74
|
thrownBy: 'service',
|
|
68
75
|
recovery: 'Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.',
|
|
@@ -70,7 +77,7 @@ export const getKpIndex = tool('noaa_spaceweather_get_kp_index', {
|
|
|
70
77
|
{
|
|
71
78
|
reason: 'feed_moved',
|
|
72
79
|
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
73
|
-
when: 'SWPC feed path returns a permanent 4xx (404, 410, 401, 403). Fails in one attempt.',
|
|
80
|
+
when: 'SWPC feed path returns a permanent 4xx (404, 410, 401, 403), a 501, or a redirect the client cannot follow. Fails in one attempt.',
|
|
74
81
|
retryable: false,
|
|
75
82
|
thrownBy: 'service',
|
|
76
83
|
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.',
|
|
@@ -80,53 +87,64 @@ export const getKpIndex = tool('noaa_spaceweather_get_kp_index', {
|
|
|
80
87
|
ctx.log.info('Fetching Kp index', { window_days: input.window_days });
|
|
81
88
|
const svc = getSpaceWeatherService();
|
|
82
89
|
const [allObs, forecast] = await Promise.all([svc.getKpObserved(ctx), svc.getKpForecast(ctx)]);
|
|
83
|
-
// Slice to the requested window
|
|
84
|
-
//
|
|
85
|
-
// .
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
const latest = observed.length > 0 ? observed[observed.length - 1] : null;
|
|
92
|
-
const currentKp = latest?.kp ?? 0;
|
|
93
|
-
const currentGScale = latest?.gScale ?? 0;
|
|
94
|
-
const auroraLatitude = latest?.auroraLatitude ?? 'No significant aurora expected at mid-latitudes';
|
|
90
|
+
// Slice to the requested window, measured as elapsed time: local-calendar
|
|
91
|
+
// days (setDate) run 23 or 25 hours across a DST transition in the server's
|
|
92
|
+
// zone. Compare epochs, not raw ISO strings: Kp timeTags carry no fractional
|
|
93
|
+
// seconds while toISOString() always emits .mmm, so lexicographic >=
|
|
94
|
+
// disagrees with true chronology at the window boundary (#6).
|
|
95
|
+
const cutoffMs = Date.now() - input.window_days * 86_400_000;
|
|
96
|
+
const inWindow = allObs.filter((r) => new Date(r.timeTag).getTime() >= cutoffMs);
|
|
97
|
+
const { headline, measured } = kpHeadline(inWindow);
|
|
95
98
|
// Filter forecast to forward-looking entries only — the SWPC feed embeds historical
|
|
96
99
|
// "observed" readings alongside the actual forecast tail; including them contradicts
|
|
97
|
-
// the "forecast" label and misleads callers reading past Kp as predictions.
|
|
100
|
+
// the "forecast" label and misleads callers reading past Kp as predictions. A forward
|
|
101
|
+
// bin without a value is listed by time tag rather than forecast as Kp 0.
|
|
98
102
|
const forwardForecast = forecast.filter((r) => r.observed !== 'observed');
|
|
99
103
|
return {
|
|
100
|
-
observed:
|
|
104
|
+
observed: measured.map((r) => ({
|
|
101
105
|
timeTag: r.timeTag,
|
|
102
106
|
kp: r.kp,
|
|
103
107
|
gScale: r.gScale,
|
|
104
108
|
gLabel: `G${r.gScale}`,
|
|
105
109
|
auroraLatitude: r.auroraLatitude,
|
|
106
110
|
})),
|
|
107
|
-
forecast: forwardForecast.
|
|
111
|
+
forecast: forwardForecast.flatMap((r) => {
|
|
112
|
+
if (r.kp === null)
|
|
113
|
+
return [];
|
|
108
114
|
const gScale = kpToGScale(r.kp);
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
return [
|
|
116
|
+
{
|
|
117
|
+
timeTag: r.timeTag,
|
|
118
|
+
kp: r.kp,
|
|
119
|
+
observed: r.observed,
|
|
120
|
+
noaaScale: r.noaaScale,
|
|
121
|
+
gScale,
|
|
122
|
+
gLabel: `G${gScale}`,
|
|
123
|
+
},
|
|
124
|
+
];
|
|
117
125
|
}),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
observedCount: observed.length,
|
|
126
|
+
...headline,
|
|
127
|
+
forecastUnavailableBins: forwardForecast.filter((r) => r.kp === null).map((r) => r.timeTag),
|
|
128
|
+
observedCount: measured.length,
|
|
122
129
|
};
|
|
123
130
|
},
|
|
124
131
|
format: (result) => {
|
|
125
132
|
const lines = [];
|
|
126
133
|
lines.push('## Kp Index');
|
|
127
|
-
|
|
128
|
-
lines.push(
|
|
134
|
+
// Each headline field renders on its own, so a missing value never prints a number.
|
|
135
|
+
lines.push([
|
|
136
|
+
`**Current Kp:** ${result.currentKp ?? 'unavailable'}`,
|
|
137
|
+
result.currentGScale === null ? '' : ` (G${result.currentGScale})`,
|
|
138
|
+
result.currentKpTimeTag === null
|
|
139
|
+
? ''
|
|
140
|
+
: `, 3-hour bin from ${escapeMarkdownInline(result.currentKpTimeTag)}`,
|
|
141
|
+
].join(''));
|
|
142
|
+
if (result.auroraLatitude !== null)
|
|
143
|
+
lines.push(`**Aurora:** ${result.auroraLatitude}`);
|
|
129
144
|
lines.push(`**Observed readings:** ${result.observedCount}`);
|
|
145
|
+
if (result.kpUnavailableBins.length > 0) {
|
|
146
|
+
lines.push(`**Observed bins without a value:** ${timeTagList(result.kpUnavailableBins)}`);
|
|
147
|
+
}
|
|
130
148
|
if (result.observed.length > 0) {
|
|
131
149
|
lines.push('');
|
|
132
150
|
lines.push('### Recent Observed Values');
|
|
@@ -142,6 +160,10 @@ export const getKpIndex = tool('noaa_spaceweather_get_kp_index', {
|
|
|
142
160
|
lines.push(`- ${escapeMarkdownInline(r.timeTag)}: Kp ${r.kp} | G-scale ${r.gScale} (${r.gLabel})${scale} [${escapeMarkdownInline(r.observed)}]`);
|
|
143
161
|
}
|
|
144
162
|
}
|
|
163
|
+
if (result.forecastUnavailableBins.length > 0) {
|
|
164
|
+
lines.push('');
|
|
165
|
+
lines.push(`**Forecast bins without a value:** ${timeTagList(result.forecastUnavailableBins)}`);
|
|
166
|
+
}
|
|
145
167
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
146
168
|
},
|
|
147
169
|
});
|
|
@@ -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,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,sBAAsB,EACtB,UAAU,GACX,MAAM,mDAAmD,CAAC;AAE3D,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAClE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IACrF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC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MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,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,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3E,KAAK,CAAC,IAAI,CACR,KAAK,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,KAAK,KAAK,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CACrI,CAAC;YACJ,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,uBAAuB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CACR,sCAAsC,WAAW,CAAC,MAAM,CAAC,uBAAuB,CAAC,EAAE,CACpF,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -7,6 +7,7 @@ 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
9
|
flare_hours: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
include_source_region: z.ZodDefault<z.ZodBoolean>;
|
|
10
11
|
}, z.core.$strip>, z.ZodObject<{
|
|
11
12
|
latestXray: z.ZodNullable<z.ZodObject<{
|
|
12
13
|
timeTag: z.ZodString;
|
|
@@ -34,6 +35,12 @@ export declare const getSolarActivity: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
34
35
|
peakFluxWm2: z.ZodNullable<z.ZodNumber>;
|
|
35
36
|
rScale: z.ZodNullable<z.ZodNumber>;
|
|
36
37
|
satellite: z.ZodNumber;
|
|
38
|
+
sourceRegion: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
39
|
+
sourceRegionStatus: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
assigned: "assigned";
|
|
41
|
+
not_yet_edited: "not_yet_edited";
|
|
42
|
+
unassigned: "unassigned";
|
|
43
|
+
}>>;
|
|
37
44
|
}, z.core.$strip>>;
|
|
38
45
|
f107: z.ZodNullable<z.ZodObject<{
|
|
39
46
|
observedTime: z.ZodString;
|
|
@@ -43,14 +50,14 @@ export declare const getSolarActivity: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
43
50
|
}, z.core.$strip>>;
|
|
44
51
|
probabilities: z.ZodArray<z.ZodObject<{
|
|
45
52
|
date: z.ZodString;
|
|
46
|
-
cClass1Day: z.ZodNumber
|
|
47
|
-
cClassProbability: z.ZodNumber
|
|
48
|
-
mClass1Day: z.ZodNumber
|
|
49
|
-
mClassProbability: z.ZodNumber
|
|
50
|
-
xClass1Day: z.ZodNumber
|
|
51
|
-
xClassProbability: z.ZodNumber
|
|
52
|
-
protons1Day: z.ZodNumber
|
|
53
|
-
protonEventProbability: z.ZodNumber
|
|
53
|
+
cClass1Day: z.ZodNullable<z.ZodNumber>;
|
|
54
|
+
cClassProbability: z.ZodNullable<z.ZodNumber>;
|
|
55
|
+
mClass1Day: z.ZodNullable<z.ZodNumber>;
|
|
56
|
+
mClassProbability: z.ZodNullable<z.ZodNumber>;
|
|
57
|
+
xClass1Day: z.ZodNullable<z.ZodNumber>;
|
|
58
|
+
xClassProbability: z.ZodNullable<z.ZodNumber>;
|
|
59
|
+
protons1Day: z.ZodNullable<z.ZodNumber>;
|
|
60
|
+
protonEventProbability: z.ZodNullable<z.ZodNumber>;
|
|
54
61
|
}, z.core.$strip>>;
|
|
55
62
|
latestProton: z.ZodNullable<z.ZodObject<{
|
|
56
63
|
timeTag: z.ZodString;
|
|
@@ -58,8 +65,8 @@ export declare const getSolarActivity: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
58
65
|
sScale: z.ZodNumber;
|
|
59
66
|
energy: z.ZodString;
|
|
60
67
|
}, z.core.$strip>>;
|
|
61
|
-
sScale: z.ZodNumber
|
|
62
|
-
sScaleText: z.ZodString
|
|
68
|
+
sScale: z.ZodNullable<z.ZodNumber>;
|
|
69
|
+
sScaleText: z.ZodNullable<z.ZodString>;
|
|
63
70
|
activeRegions: z.ZodArray<z.ZodObject<{
|
|
64
71
|
region: z.ZodNumber;
|
|
65
72
|
location: z.ZodString;
|
|
@@ -72,24 +79,24 @@ export declare const getSolarActivity: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
72
79
|
cFlareCount: z.ZodNumber;
|
|
73
80
|
mFlareCount: z.ZodNumber;
|
|
74
81
|
xFlareCount: z.ZodNumber;
|
|
75
|
-
cFlareProbability: z.ZodNumber
|
|
76
|
-
mFlareProbability: z.ZodNumber
|
|
77
|
-
xFlareProbability: z.ZodNumber
|
|
78
|
-
protonProbability: z.ZodNumber
|
|
82
|
+
cFlareProbability: z.ZodNullable<z.ZodNumber>;
|
|
83
|
+
mFlareProbability: z.ZodNullable<z.ZodNumber>;
|
|
84
|
+
xFlareProbability: z.ZodNullable<z.ZodNumber>;
|
|
85
|
+
protonProbability: z.ZodNullable<z.ZodNumber>;
|
|
79
86
|
observedDate: z.ZodString;
|
|
80
87
|
}, z.core.$strip>>;
|
|
81
88
|
fetchedAt: z.ZodString;
|
|
82
89
|
}, z.core.$strip>, readonly [{
|
|
83
90
|
readonly reason: "feed_unavailable";
|
|
84
91
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
85
|
-
readonly when: "SWPC feed returns 5xx or 429, times out, or answers with a body that is not parseable JSON. Retried for up to 45 seconds in total before failing.";
|
|
92
|
+
readonly when: "SWPC feed returns a 5xx other than 501 or a 429, times out, or answers with a body that is not parseable JSON. Retried for up to 45 seconds in total before failing.";
|
|
86
93
|
readonly retryable: true;
|
|
87
94
|
readonly thrownBy: "service";
|
|
88
95
|
readonly recovery: "Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.";
|
|
89
96
|
}, {
|
|
90
97
|
readonly reason: "feed_moved";
|
|
91
98
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
92
|
-
readonly when: "SWPC feed path returns a permanent 4xx (404, 410, 401, 403). Fails in one attempt.";
|
|
99
|
+
readonly when: "SWPC feed path returns a permanent 4xx (404, 410, 401, 403), a 501, or a redirect the client cannot follow. Fails in one attempt.";
|
|
93
100
|
readonly retryable: false;
|
|
94
101
|
readonly thrownBy: "service";
|
|
95
102
|
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.";
|
|
@@ -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;AAsVjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0V3B,CAAC"}
|