@cyanheads/noaa-spaceweather-mcp-server 0.1.1
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 +328 -0
- package/CLAUDE.md +328 -0
- package/Dockerfile +99 -0
- package/LICENSE +201 -0
- package/README.md +315 -0
- package/changelog/0.1.x/0.1.1.md +31 -0
- package/changelog/template.md +127 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts +37 -0
- package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-alerts.tool.js +114 -0
- package/dist/mcp-server/tools/definitions/get-alerts.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts +37 -0
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js +202 -0
- package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts +55 -0
- package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-conditions.tool.js +129 -0
- package/dist/mcp-server/tools/definitions/get-conditions.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts +34 -0
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.js +126 -0
- package/dist/mcp-server/tools/definitions/get-kp-index.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts +58 -0
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js +237 -0
- package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts +46 -0
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js +197 -0
- package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +225 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +19 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/services/space-weather/space-weather-service.d.ts +42 -0
- package/dist/services/space-weather/space-weather-service.d.ts.map +1 -0
- package/dist/services/space-weather/space-weather-service.js +402 -0
- package/dist/services/space-weather/space-weather-service.js.map +1 -0
- package/dist/services/space-weather/types.d.ts +189 -0
- package/dist/services/space-weather/types.d.ts.map +1 -0
- package/dist/services/space-weather/types.js +6 -0
- package/dist/services/space-weather/types.js.map +1 -0
- package/package.json +105 -0
- package/server.json +99 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
# FORMAT REFERENCE — do not edit. Copy this file to
|
|
3
|
+
# `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
|
|
4
|
+
# to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
|
|
5
|
+
# with a concrete date.
|
|
6
|
+
|
|
7
|
+
# Required. One-line GitHub Release-style headline. 350 character cap.
|
|
8
|
+
# Default short and scannable. Don't pad, don't stitch unrelated changes with
|
|
9
|
+
# semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
|
|
10
|
+
# inside the value as a key separator and fails GitHub's strict parser.
|
|
11
|
+
summary: ""
|
|
12
|
+
|
|
13
|
+
# Set `true` when consumers must change code to upgrade: API removals,
|
|
14
|
+
# signature changes, config renames, behavior changes that break existing
|
|
15
|
+
# usage. Flagged as `Breaking` in the rollup.
|
|
16
|
+
breaking: false
|
|
17
|
+
|
|
18
|
+
# Set `true` if this release contains any security fix. Pairs with the
|
|
19
|
+
# `## Security` section below. Flagged as `Security` in the rollup so
|
|
20
|
+
# users can triage upgrade urgency at a glance.
|
|
21
|
+
security: false
|
|
22
|
+
|
|
23
|
+
# Optional free-form notes for maintenance agents processing this release.
|
|
24
|
+
# Not rendered in CHANGELOG — consumed by agents running `maintenance` on
|
|
25
|
+
# downstream servers. Use for adoption instructions that don't fit the
|
|
26
|
+
# human-facing sections: new files to create, fields to populate, one-time
|
|
27
|
+
# migration steps. Omit the field entirely when there's nothing to say.
|
|
28
|
+
# agent-notes: |
|
|
29
|
+
# <instructions for downstream maintenance agents>
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# <version> — YYYY-MM-DD
|
|
33
|
+
|
|
34
|
+
<!--
|
|
35
|
+
AUTHORING GUIDE — applies to the new per-version file you create from this
|
|
36
|
+
template.
|
|
37
|
+
|
|
38
|
+
Audience: someone scanning release notes to decide what affects them. Lead
|
|
39
|
+
each bullet with the symbol or concept name in **bold** so they can skip
|
|
40
|
+
what's irrelevant and zoom in on what's not.
|
|
41
|
+
|
|
42
|
+
Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
|
|
43
|
+
name the symbol, state what changed, stop. Use a second sentence only when
|
|
44
|
+
it carries weight. If a bullet feels long, it is.
|
|
45
|
+
|
|
46
|
+
Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
|
|
47
|
+
relevant skill), ceremonial framings ("This release introduces…",
|
|
48
|
+
backwards-compat paragraphs), file-by-file test enumerations, internal
|
|
49
|
+
implementation notes. Prefer code/symbol names over English re-explanations.
|
|
50
|
+
|
|
51
|
+
Narrative intro: skip by default. Add one short sentence only when the
|
|
52
|
+
release theme genuinely needs framing the bullets can't carry.
|
|
53
|
+
|
|
54
|
+
Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
|
|
55
|
+
Fixed, Security. Include only sections with entries; delete the rest
|
|
56
|
+
(including the commented-out scaffolding below). Don't ship empty headers.
|
|
57
|
+
|
|
58
|
+
Include: every distinct fact a reader needs to adopt or audit the release —
|
|
59
|
+
new exports, signatures, lint rule IDs, env vars, breaking changes, version
|
|
60
|
+
bumps on shipped skills. Nothing more.
|
|
61
|
+
|
|
62
|
+
Links: link issues, PRs, docs, or skills where they help a reader jump to
|
|
63
|
+
context. Once per item per entry — don't re-link the same issue in summary,
|
|
64
|
+
narrative, and bullet. Skip links for inline symbol names; code spans speak
|
|
65
|
+
for themselves.
|
|
66
|
+
|
|
67
|
+
Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
|
|
68
|
+
inside its own UI, not in npm reads or local editors.
|
|
69
|
+
|
|
70
|
+
[#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
|
|
71
|
+
[#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
|
|
72
|
+
|
|
73
|
+
Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
|
|
74
|
+
Never speculate on a future number — `#42` for an upcoming PR silently
|
|
75
|
+
resolves to whatever real item already owns 42, and timeline previews pull
|
|
76
|
+
in that unrelated item's metadata.
|
|
77
|
+
|
|
78
|
+
TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
|
|
79
|
+
via `gh release create --notes-from-tag`. The tag is a derivative of this
|
|
80
|
+
changelog entry — a condensed, scannable version, not a copy. Format:
|
|
81
|
+
|
|
82
|
+
<theme — omit version number, GitHub prepends it>
|
|
83
|
+
← blank line
|
|
84
|
+
<1-2 sentence context: what this release does>
|
|
85
|
+
← blank line
|
|
86
|
+
Dependency bumps: ← section header
|
|
87
|
+
← blank line
|
|
88
|
+
- `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
|
|
89
|
+
← blank line
|
|
90
|
+
Changed: ← only sections with entries
|
|
91
|
+
← blank line
|
|
92
|
+
- `format()` output includes `query` in text mode
|
|
93
|
+
← blank line
|
|
94
|
+
Added:
|
|
95
|
+
← blank line
|
|
96
|
+
- `manifest.json` scaffolded for MCPB bundle support
|
|
97
|
+
- Install badges (Claude Desktop, Cursor, VS Code)
|
|
98
|
+
← blank line
|
|
99
|
+
<N> tests pass; `bun run devcheck` clean. ← footer
|
|
100
|
+
|
|
101
|
+
Never a flat comma-separated string. Always structured markdown with
|
|
102
|
+
sections. The tag must scan well as a rendered GitHub Release page.
|
|
103
|
+
-->
|
|
104
|
+
|
|
105
|
+
## Added
|
|
106
|
+
|
|
107
|
+
-
|
|
108
|
+
|
|
109
|
+
## Changed
|
|
110
|
+
|
|
111
|
+
-
|
|
112
|
+
|
|
113
|
+
<!-- ## Deprecated
|
|
114
|
+
|
|
115
|
+
- -->
|
|
116
|
+
|
|
117
|
+
<!-- ## Removed
|
|
118
|
+
|
|
119
|
+
- -->
|
|
120
|
+
|
|
121
|
+
## Fixed
|
|
122
|
+
|
|
123
|
+
-
|
|
124
|
+
|
|
125
|
+
<!-- ## Security
|
|
126
|
+
|
|
127
|
+
- -->
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview noaa-spaceweather-mcp-server MCP server entry point.
|
|
4
|
+
* @module index
|
|
5
|
+
*/
|
|
6
|
+
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { allToolDefinitions } from './mcp-server/tools/definitions/index.js';
|
|
8
|
+
import { initSpaceWeatherService } from './services/space-weather/space-weather-service.js';
|
|
9
|
+
await createApp({
|
|
10
|
+
tools: allToolDefinitions,
|
|
11
|
+
resources: [],
|
|
12
|
+
prompts: [],
|
|
13
|
+
instructions: 'NOAA Space Weather Prediction Center data server — all feeds are public and keyless.\n' +
|
|
14
|
+
'- Start with noaa_spaceweather_get_conditions for a quick status snapshot.\n' +
|
|
15
|
+
'- Use noaa_spaceweather_get_aurora_forecast with coordinates for "can I see the aurora?" queries.\n' +
|
|
16
|
+
'- Use noaa_spaceweather_get_solar_wind for Bz monitoring (southward Bz drives storms).\n' +
|
|
17
|
+
'- Use noaa_spaceweather_get_alerts for active SWPC watches/warnings.\n' +
|
|
18
|
+
'Feeds update frequently (solar wind ~1 min, aurora ~5 min, Kp 3-hour intervals).',
|
|
19
|
+
setup(core) {
|
|
20
|
+
initSpaceWeatherService(core.config, core.storage);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAE5F,MAAM,SAAS,CAAC;IACd,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,wFAAwF;QACxF,8EAA8E;QAC9E,qGAAqG;QACrG,0FAA0F;QAC1F,wEAAwE;QACxE,kFAAkF;IACpF,KAAK,CAAC,IAAI;QACR,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool: noaa_spaceweather_get_alerts — active SWPC alerts/watches/warnings.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-alerts
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const getAlerts: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
active_only: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
alerts: z.ZodArray<z.ZodObject<{
|
|
11
|
+
productId: z.ZodString;
|
|
12
|
+
productType: z.ZodEnum<{
|
|
13
|
+
Warning: "Warning";
|
|
14
|
+
Watch: "Watch";
|
|
15
|
+
Alert: "Alert";
|
|
16
|
+
Summary: "Summary";
|
|
17
|
+
Other: "Other";
|
|
18
|
+
}>;
|
|
19
|
+
level: z.ZodNumber;
|
|
20
|
+
phenomenon: z.ZodString;
|
|
21
|
+
issueDatetime: z.ZodString;
|
|
22
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
23
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
24
|
+
message: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
totalCount: z.ZodNumber;
|
|
27
|
+
fetchedAt: z.ZodString;
|
|
28
|
+
}, z.core.$strip>, readonly [{
|
|
29
|
+
readonly reason: "feed_unavailable";
|
|
30
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
31
|
+
readonly when: "SWPC endpoint returns non-OK status or times out after retries.";
|
|
32
|
+
readonly retryable: true;
|
|
33
|
+
readonly recovery: "Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.";
|
|
34
|
+
}], {
|
|
35
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}>;
|
|
37
|
+
//# sourceMappingURL=get-alerts.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-alerts.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-alerts.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA4BjE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6FpB,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool: noaa_spaceweather_get_alerts — active SWPC alerts/watches/warnings.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-alerts
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getSpaceWeatherService } from '../../../services/space-weather/space-weather-service.js';
|
|
8
|
+
const AlertSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
productId: z.string().describe('SWPC product code, e.g. "WARK04", "ALTK07".'),
|
|
11
|
+
productType: z
|
|
12
|
+
.enum(['Warning', 'Watch', 'Alert', 'Summary', 'Other'])
|
|
13
|
+
.describe('Product classification derived from the code prefix.'),
|
|
14
|
+
level: z
|
|
15
|
+
.number()
|
|
16
|
+
.describe('Numeric severity level from the product code (0 when not applicable).'),
|
|
17
|
+
phenomenon: z
|
|
18
|
+
.string()
|
|
19
|
+
.describe('Short phenomenon name, e.g. "Geomagnetic", "Radio Blackout", "Solar Radiation".'),
|
|
20
|
+
issueDatetime: z.string().describe('ISO 8601 issue datetime.'),
|
|
21
|
+
validFrom: z
|
|
22
|
+
.string()
|
|
23
|
+
.nullable()
|
|
24
|
+
.describe('Validity start parsed from the message body, null if not found.'),
|
|
25
|
+
validTo: z
|
|
26
|
+
.string()
|
|
27
|
+
.nullable()
|
|
28
|
+
.describe('Validity end parsed from the message body, null if not found.'),
|
|
29
|
+
message: z.string().describe('Full plain-text message body.'),
|
|
30
|
+
})
|
|
31
|
+
.describe('One SWPC alert, watch, warning, or summary.');
|
|
32
|
+
export const getAlerts = tool('noaa_spaceweather_get_alerts', {
|
|
33
|
+
title: 'Get Space Weather Alerts',
|
|
34
|
+
description: 'Active SWPC alerts, watches, and warnings — parsed into structured records with product type, ' +
|
|
35
|
+
'severity level, issue time, validity window, and plain text. Covers geomagnetic storms, radio ' +
|
|
36
|
+
'blackouts, radiation storms, and aurora bulletins. With active_only=false, also returns ' +
|
|
37
|
+
'informational summaries and expired notices.',
|
|
38
|
+
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
39
|
+
input: z.object({
|
|
40
|
+
active_only: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.default(true)
|
|
43
|
+
.describe('When true (default), return only Warnings, Watches, and Alerts; exclude Summaries and Other. Set false to return all products.'),
|
|
44
|
+
}),
|
|
45
|
+
output: z.object({
|
|
46
|
+
alerts: z.array(AlertSchema).describe('Matching SWPC alert/watch/warning records.'),
|
|
47
|
+
totalCount: z.number().describe('Count of records in the alerts array.'),
|
|
48
|
+
fetchedAt: z.string().describe('ISO 8601 timestamp of when this data was fetched.'),
|
|
49
|
+
}),
|
|
50
|
+
errors: [
|
|
51
|
+
{
|
|
52
|
+
reason: 'feed_unavailable',
|
|
53
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
54
|
+
when: 'SWPC endpoint returns non-OK status or times out after retries.',
|
|
55
|
+
retryable: true,
|
|
56
|
+
recovery: 'Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
async handler(input, ctx) {
|
|
60
|
+
ctx.log.info('Fetching SWPC alerts', { active_only: input.active_only });
|
|
61
|
+
const svc = getSpaceWeatherService();
|
|
62
|
+
const all = await svc.getAlerts(ctx);
|
|
63
|
+
const filtered = input.active_only
|
|
64
|
+
? all.filter((a) => a.productType === 'Warning' || a.productType === 'Watch' || a.productType === 'Alert')
|
|
65
|
+
: all;
|
|
66
|
+
if (filtered.length === 0) {
|
|
67
|
+
ctx.enrich.notice(input.active_only
|
|
68
|
+
? 'No active alerts, watches, or warnings. Set active_only=false to include summaries.'
|
|
69
|
+
: 'No space weather products currently issued.');
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
alerts: filtered.map((a) => ({
|
|
73
|
+
productId: a.productId,
|
|
74
|
+
productType: a.productType,
|
|
75
|
+
level: a.level,
|
|
76
|
+
phenomenon: a.phenomenon,
|
|
77
|
+
issueDatetime: a.issueDatetime,
|
|
78
|
+
validFrom: a.validFrom,
|
|
79
|
+
validTo: a.validTo,
|
|
80
|
+
message: a.message,
|
|
81
|
+
})),
|
|
82
|
+
totalCount: filtered.length,
|
|
83
|
+
fetchedAt: new Date().toISOString(),
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
enrichment: {
|
|
87
|
+
notice: z.string().optional().describe('Status notice when no alerts are active.'),
|
|
88
|
+
},
|
|
89
|
+
format: (result) => {
|
|
90
|
+
const lines = [];
|
|
91
|
+
lines.push(`## SWPC Space Weather Alerts — ${result.fetchedAt}`);
|
|
92
|
+
lines.push(`**Total:** ${result.totalCount}`);
|
|
93
|
+
if (result.alerts.length === 0) {
|
|
94
|
+
lines.push('\n_No active alerts._');
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
for (const alert of result.alerts) {
|
|
98
|
+
lines.push('');
|
|
99
|
+
lines.push(`### [${alert.productType}] ${alert.phenomenon} — ${alert.productId}`);
|
|
100
|
+
lines.push(`**Issued:** ${alert.issueDatetime} | **Level:** ${alert.level}`);
|
|
101
|
+
if (alert.validFrom)
|
|
102
|
+
lines.push(`**Valid From:** ${alert.validFrom}`);
|
|
103
|
+
if (alert.validTo)
|
|
104
|
+
lines.push(`**Valid To:** ${alert.validTo}`);
|
|
105
|
+
lines.push('');
|
|
106
|
+
lines.push('```');
|
|
107
|
+
lines.push(alert.message);
|
|
108
|
+
lines.push('```');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=get-alerts.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-alerts.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-alerts.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,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAC7E,WAAW,EAAE,CAAC;SACX,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;SACvD,QAAQ,CAAC,sDAAsD,CAAC;IACnE,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CAAC,uEAAuE,CAAC;IACpF,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,CAAC,iFAAiF,CAAC;IAC9F,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IAC9D,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iEAAiE,CAAC;IAC9E,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,+DAA+D,CAAC;IAC5E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;CAC9D,CAAC;KACD,QAAQ,CAAC,6CAA6C,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,8BAA8B,EAAE;IAC5D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YAC/B,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,UAAU,MAAM,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;gBAClF,KAAK,CAAC,IAAI,CAAC,eAAe,KAAK,CAAC,aAAa,iBAAiB,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC7E,IAAI,KAAK,CAAC,SAAS;oBAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;gBACtE,IAAI,KAAK,CAAC,OAAO;oBAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAChE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAClB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC1B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool: noaa_spaceweather_get_aurora_forecast — OVATION aurora probability grid.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-aurora-forecast
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const getAuroraForecast: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
observationTime: z.ZodString;
|
|
12
|
+
forecastTime: z.ZodString;
|
|
13
|
+
localLookup: z.ZodNullable<z.ZodObject<{
|
|
14
|
+
requestedLatitude: z.ZodNumber;
|
|
15
|
+
requestedLongitude: z.ZodNumber;
|
|
16
|
+
gridLatitude: z.ZodNumber;
|
|
17
|
+
gridLongitude: z.ZodNumber;
|
|
18
|
+
auroraPercent: z.ZodNumber;
|
|
19
|
+
minKpRequired: z.ZodNumber;
|
|
20
|
+
verdict: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
gridPointCount: z.ZodNumber;
|
|
23
|
+
topAuroraPercent: z.ZodNumber;
|
|
24
|
+
topAuroraRegion: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, readonly [{
|
|
26
|
+
readonly reason: "feed_unavailable";
|
|
27
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
28
|
+
readonly when: "SWPC endpoint returns non-OK status or times out after retries.";
|
|
29
|
+
readonly retryable: true;
|
|
30
|
+
readonly recovery: "Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.";
|
|
31
|
+
}, {
|
|
32
|
+
readonly reason: "invalid_coordinates";
|
|
33
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
34
|
+
readonly when: "latitude is outside −90–90 or longitude is outside −180–180.";
|
|
35
|
+
readonly recovery: "Provide latitude in range −90 to 90 and longitude in range −180 to 180.";
|
|
36
|
+
}], undefined>;
|
|
37
|
+
//# sourceMappingURL=get-aurora-forecast.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-aurora-forecast.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-aurora-forecast.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAuCjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8K5B,CAAC"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool: noaa_spaceweather_get_aurora_forecast — OVATION aurora probability grid.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-aurora-forecast
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getSpaceWeatherService } from '../../../services/space-weather/space-weather-service.js';
|
|
8
|
+
/** Minimum Kp thresholds by geomagnetic latitude band for aurora visibility. */
|
|
9
|
+
function minKpForLatitude(geomLat) {
|
|
10
|
+
if (geomLat >= 65)
|
|
11
|
+
return 0;
|
|
12
|
+
if (geomLat >= 60)
|
|
13
|
+
return 2;
|
|
14
|
+
if (geomLat >= 55)
|
|
15
|
+
return 4;
|
|
16
|
+
if (geomLat >= 50)
|
|
17
|
+
return 5;
|
|
18
|
+
if (geomLat >= 45)
|
|
19
|
+
return 6;
|
|
20
|
+
if (geomLat >= 40)
|
|
21
|
+
return 7;
|
|
22
|
+
return 9;
|
|
23
|
+
}
|
|
24
|
+
/** Find the nearest grid point (1° resolution) and return its aurora probability. */
|
|
25
|
+
function lookupGridPoint(grid, lat, lon) {
|
|
26
|
+
if (grid.length === 0)
|
|
27
|
+
return null;
|
|
28
|
+
// Normalize longitude to -180..179
|
|
29
|
+
const normLon = ((((lon + 180) % 360) + 360) % 360) - 180;
|
|
30
|
+
let best = null;
|
|
31
|
+
let bestDist = Infinity;
|
|
32
|
+
for (const pt of grid) {
|
|
33
|
+
const dLat = pt.latitude - lat;
|
|
34
|
+
const dLon = pt.longitude - normLon;
|
|
35
|
+
const dist = dLat * dLat + dLon * dLon;
|
|
36
|
+
if (dist < bestDist) {
|
|
37
|
+
bestDist = dist;
|
|
38
|
+
best = pt;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return best
|
|
42
|
+
? { auroraPercent: best.auroraPercent, gridLat: best.latitude, gridLon: best.longitude }
|
|
43
|
+
: null;
|
|
44
|
+
}
|
|
45
|
+
export const getAuroraForecast = tool('noaa_spaceweather_get_aurora_forecast', {
|
|
46
|
+
title: 'Get Aurora Forecast',
|
|
47
|
+
description: 'OVATION model aurora forecast for the next ~30–60 min: global grid of aurora probability ' +
|
|
48
|
+
'percentages by latitude/longitude (1° resolution). With optional coordinates, returns the local ' +
|
|
49
|
+
'aurora probability at the nearest grid point, the minimum Kp needed for aurora at that latitude, ' +
|
|
50
|
+
'and a plain-language go/no-go verdict. Without coordinates, returns only global metadata. ' +
|
|
51
|
+
'Data updates every ~5 minutes. Coordinates are geographic (WGS84), not geomagnetic.',
|
|
52
|
+
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
53
|
+
input: z.object({
|
|
54
|
+
latitude: z
|
|
55
|
+
.number()
|
|
56
|
+
.min(-90)
|
|
57
|
+
.max(90)
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Geographic latitude in degrees (−90 to 90). Provide with longitude for a local aurora probability lookup.'),
|
|
60
|
+
longitude: z
|
|
61
|
+
.number()
|
|
62
|
+
.min(-180)
|
|
63
|
+
.max(180)
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Geographic longitude in degrees (−180 to 180). Provide with latitude for a local aurora probability lookup.'),
|
|
66
|
+
}),
|
|
67
|
+
output: z.object({
|
|
68
|
+
observationTime: z.string().describe('Time of the OVATION model observation, ISO 8601.'),
|
|
69
|
+
forecastTime: z.string().describe('Time the aurora forecast is valid for, ISO 8601.'),
|
|
70
|
+
localLookup: z
|
|
71
|
+
.object({
|
|
72
|
+
requestedLatitude: z
|
|
73
|
+
.number()
|
|
74
|
+
.describe('Geographic latitude supplied in the request (degrees, −90 to 90).'),
|
|
75
|
+
requestedLongitude: z
|
|
76
|
+
.number()
|
|
77
|
+
.describe('Geographic longitude supplied in the request (degrees, −180 to 180).'),
|
|
78
|
+
gridLatitude: z.number().describe('Nearest OVATION grid latitude.'),
|
|
79
|
+
gridLongitude: z.number().describe('Nearest OVATION grid longitude.'),
|
|
80
|
+
auroraPercent: z
|
|
81
|
+
.number()
|
|
82
|
+
.describe('Aurora probability at the nearest grid point (0–100%).'),
|
|
83
|
+
minKpRequired: z
|
|
84
|
+
.number()
|
|
85
|
+
.describe('Minimum Kp threshold for aurora visibility at this latitude.'),
|
|
86
|
+
verdict: z
|
|
87
|
+
.string()
|
|
88
|
+
.describe('Plain-language visibility verdict, e.g. "Good aurora chance (42%) — Kp≥6 needed at this latitude."'),
|
|
89
|
+
})
|
|
90
|
+
.nullable()
|
|
91
|
+
.describe('Local aurora lookup result. Null when no coordinates were provided.'),
|
|
92
|
+
gridPointCount: z.number().describe('Total number of grid points in the OVATION model.'),
|
|
93
|
+
topAuroraPercent: z
|
|
94
|
+
.number()
|
|
95
|
+
.describe('Highest aurora probability anywhere on the globe (0–100).'),
|
|
96
|
+
topAuroraRegion: z
|
|
97
|
+
.string()
|
|
98
|
+
.describe('Approximate region of the highest aurora probability grid point.'),
|
|
99
|
+
}),
|
|
100
|
+
errors: [
|
|
101
|
+
{
|
|
102
|
+
reason: 'feed_unavailable',
|
|
103
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
104
|
+
when: 'SWPC endpoint returns non-OK status or times out after retries.',
|
|
105
|
+
retryable: true,
|
|
106
|
+
recovery: 'Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
reason: 'invalid_coordinates',
|
|
110
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
111
|
+
when: 'latitude is outside −90–90 or longitude is outside −180–180.',
|
|
112
|
+
recovery: 'Provide latitude in range −90 to 90 and longitude in range −180 to 180.',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
async handler(input, ctx) {
|
|
116
|
+
// Validate: if one coordinate is provided, the other must be too
|
|
117
|
+
const hasLat = input.latitude != null;
|
|
118
|
+
const hasLon = input.longitude != null;
|
|
119
|
+
if ((hasLat && !hasLon) || (!hasLat && hasLon)) {
|
|
120
|
+
throw ctx.fail('invalid_coordinates', 'Provide both latitude and longitude, or neither.', {
|
|
121
|
+
...ctx.recoveryFor('invalid_coordinates'),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
ctx.log.info('Fetching aurora forecast', {
|
|
125
|
+
latitude: input.latitude,
|
|
126
|
+
longitude: input.longitude,
|
|
127
|
+
});
|
|
128
|
+
const svc = getSpaceWeatherService();
|
|
129
|
+
const aurora = await svc.getAuroraForecast(ctx);
|
|
130
|
+
const grid = aurora.grid;
|
|
131
|
+
// Find global maximum
|
|
132
|
+
let topPercent = 0;
|
|
133
|
+
let topPoint = null;
|
|
134
|
+
for (const pt of grid) {
|
|
135
|
+
if (pt.auroraPercent > topPercent) {
|
|
136
|
+
topPercent = pt.auroraPercent;
|
|
137
|
+
topPoint = pt;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const topRegion = topPoint
|
|
141
|
+
? `${topPoint.latitude >= 0 ? `${topPoint.latitude}°N` : `${Math.abs(topPoint.latitude)}°S`}, ${topPoint.longitude >= 0 ? `${topPoint.longitude}°E` : `${Math.abs(topPoint.longitude)}°W`}`
|
|
142
|
+
: 'Unknown';
|
|
143
|
+
// Local lookup
|
|
144
|
+
let localLookup = null;
|
|
145
|
+
if (hasLat && hasLon) {
|
|
146
|
+
// biome-ignore lint/style/noNonNullAssertion: guarded by hasLat && hasLon checks above
|
|
147
|
+
const lat = input.latitude;
|
|
148
|
+
// biome-ignore lint/style/noNonNullAssertion: guarded by hasLat && hasLon checks above
|
|
149
|
+
const lon = input.longitude;
|
|
150
|
+
const nearest = lookupGridPoint(grid, lat, lon);
|
|
151
|
+
if (nearest) {
|
|
152
|
+
const minKp = minKpForLatitude(Math.abs(lat));
|
|
153
|
+
const pct = nearest.auroraPercent;
|
|
154
|
+
let verdict;
|
|
155
|
+
if (pct >= 30)
|
|
156
|
+
verdict = `Good aurora chance (${pct}%) — Kp≥${minKp} needed at this latitude.`;
|
|
157
|
+
else if (pct >= 5)
|
|
158
|
+
verdict = `Low aurora chance (${pct}%) — conditions marginal. Kp≥${minKp} needed.`;
|
|
159
|
+
else if (minKp === 0)
|
|
160
|
+
verdict = `Very low aurora probability (${pct}%) despite favorable latitude — wait for elevated solar activity and higher Kp.`;
|
|
161
|
+
else
|
|
162
|
+
verdict = `Very low aurora probability (${pct}%) at this location. Kp≥${minKp} needed — travel to higher latitudes or wait for elevated Kp.`;
|
|
163
|
+
localLookup = {
|
|
164
|
+
requestedLatitude: lat,
|
|
165
|
+
requestedLongitude: lon,
|
|
166
|
+
gridLatitude: nearest.gridLat,
|
|
167
|
+
gridLongitude: nearest.gridLon,
|
|
168
|
+
auroraPercent: pct,
|
|
169
|
+
minKpRequired: minKp,
|
|
170
|
+
verdict,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
observationTime: aurora.meta.observationTime,
|
|
176
|
+
forecastTime: aurora.meta.forecastTime,
|
|
177
|
+
localLookup,
|
|
178
|
+
gridPointCount: grid.length,
|
|
179
|
+
topAuroraPercent: topPercent,
|
|
180
|
+
topAuroraRegion: topRegion,
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
format: (result) => {
|
|
184
|
+
const lines = [];
|
|
185
|
+
lines.push('## Aurora Forecast (OVATION)');
|
|
186
|
+
lines.push(`**Observation Time:** ${result.observationTime}`);
|
|
187
|
+
lines.push(`**Forecast Valid:** ${result.forecastTime}`);
|
|
188
|
+
lines.push(`**Global Peak:** ${result.topAuroraPercent}% near ${result.topAuroraRegion}`);
|
|
189
|
+
lines.push(`**Grid Points:** ${result.gridPointCount}`);
|
|
190
|
+
if (result.localLookup) {
|
|
191
|
+
const l = result.localLookup;
|
|
192
|
+
lines.push('');
|
|
193
|
+
lines.push('### Local Forecast');
|
|
194
|
+
lines.push(`**Location:** ${l.requestedLatitude}°, ${l.requestedLongitude}° → nearest grid (${l.gridLatitude}°, ${l.gridLongitude}°)`);
|
|
195
|
+
lines.push(`**Aurora Probability:** ${l.auroraPercent}%`);
|
|
196
|
+
lines.push(`**Min Kp Required:** ${l.minKpRequired}`);
|
|
197
|
+
lines.push(`**Verdict:** ${l.verdict}`);
|
|
198
|
+
}
|
|
199
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
//# sourceMappingURL=get-aurora-forecast.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-aurora-forecast.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-aurora-forecast.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,gFAAgF;AAChF,SAAS,gBAAgB,CAAC,OAAe;IACvC,IAAI,OAAO,IAAI,EAAE;QAAE,OAAO,CAAC,CAAC;IAC5B,IAAI,OAAO,IAAI,EAAE;QAAE,OAAO,CAAC,CAAC;IAC5B,IAAI,OAAO,IAAI,EAAE;QAAE,OAAO,CAAC,CAAC;IAC5B,IAAI,OAAO,IAAI,EAAE;QAAE,OAAO,CAAC,CAAC;IAC5B,IAAI,OAAO,IAAI,EAAE;QAAE,OAAO,CAA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CAAC,eAAe,EAAE,CAAC,CAAC;QAC1F,KAAK,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;QACxD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YACjC,KAAK,CAAC,IAAI,CACR,iBAAiB,CAAC,CAAC,iBAAiB,MAAM,CAAC,CAAC,kBAAkB,qBAAqB,CAAC,CAAC,YAAY,MAAM,CAAC,CAAC,aAAa,IAAI,CAC3H,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC;YAC1D,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC;YACtD,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool: noaa_spaceweather_get_conditions — current space-weather snapshot.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-conditions
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const getConditions: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
observedAt: z.ZodString;
|
|
9
|
+
currentKp: z.ZodNumber;
|
|
10
|
+
currentGScale: z.ZodNumber;
|
|
11
|
+
auroraLatitude: z.ZodString;
|
|
12
|
+
today: z.ZodObject<{
|
|
13
|
+
G: z.ZodObject<{
|
|
14
|
+
scale: z.ZodNumber;
|
|
15
|
+
text: z.ZodString;
|
|
16
|
+
label: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
R: z.ZodObject<{
|
|
19
|
+
scale: z.ZodNumber;
|
|
20
|
+
text: z.ZodString;
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
S: z.ZodObject<{
|
|
24
|
+
scale: z.ZodNumber;
|
|
25
|
+
text: z.ZodString;
|
|
26
|
+
label: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
forecast: z.ZodArray<z.ZodObject<{
|
|
30
|
+
date: z.ZodString;
|
|
31
|
+
G: z.ZodObject<{
|
|
32
|
+
scale: z.ZodNumber;
|
|
33
|
+
text: z.ZodString;
|
|
34
|
+
label: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
R: z.ZodObject<{
|
|
37
|
+
scale: z.ZodNumber;
|
|
38
|
+
text: z.ZodString;
|
|
39
|
+
label: z.ZodString;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
S: z.ZodObject<{
|
|
42
|
+
scale: z.ZodNumber;
|
|
43
|
+
text: z.ZodString;
|
|
44
|
+
label: z.ZodString;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
summary: z.ZodString;
|
|
48
|
+
}, z.core.$strip>, readonly [{
|
|
49
|
+
readonly reason: "feed_unavailable";
|
|
50
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
51
|
+
readonly when: "SWPC endpoint returns non-OK status or times out after retries.";
|
|
52
|
+
readonly retryable: true;
|
|
53
|
+
readonly recovery: "Retry in 30–60 seconds; SWPC feeds occasionally lag during high-activity events.";
|
|
54
|
+
}], undefined>;
|
|
55
|
+
//# sourceMappingURL=get-conditions.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-conditions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-conditions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0BjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgIxB,CAAC"}
|