@cyanheads/noaa-marine-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 +387 -0
- package/CLAUDE.md +387 -0
- package/Dockerfile +99 -0
- package/LICENSE +201 -0
- package/README.md +300 -0
- package/changelog/0.1.x/0.1.1.md +28 -0
- package/changelog/template.md +127 -0
- package/dist/config/server-config.d.ts +12 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +20 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/noaa-marine-station.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/noaa-marine-station.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/noaa-marine-station.resource.js +96 -0
- package/dist/mcp-server/resources/definitions/noaa-marine-station.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-find-stations.tool.d.ts +105 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-find-stations.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-find-stations.tool.js +338 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-find-stations.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-conditions.tool.d.ts +40 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-conditions.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-conditions.tool.js +164 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-conditions.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-currents.tool.d.ts +59 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-currents.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-currents.tool.js +227 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-currents.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-tide-predictions.tool.d.ts +60 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-tide-predictions.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-tide-predictions.tool.js +180 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-tide-predictions.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-water-level.tool.d.ts +65 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-water-level.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-water-level.tool.js +232 -0
- package/dist/mcp-server/tools/definitions/noaa-marine-get-water-level.tool.js.map +1 -0
- package/dist/services/coops/coops-service.d.ts +74 -0
- package/dist/services/coops/coops-service.d.ts.map +1 -0
- package/dist/services/coops/coops-service.js +217 -0
- package/dist/services/coops/coops-service.js.map +1 -0
- package/dist/services/coops/types.d.ts +66 -0
- package/dist/services/coops/types.d.ts.map +1 -0
- package/dist/services/coops/types.js +6 -0
- package/dist/services/coops/types.js.map +1 -0
- package/dist/services/ndbc/ndbc-service.d.ts +28 -0
- package/dist/services/ndbc/ndbc-service.d.ts.map +1 -0
- package/dist/services/ndbc/ndbc-service.js +213 -0
- package/dist/services/ndbc/ndbc-service.js.map +1 -0
- package/dist/services/ndbc/types.d.ts +60 -0
- package/dist/services/ndbc/types.d.ts.map +1 -0
- package/dist/services/ndbc/types.js +6 -0
- package/dist/services/ndbc/types.js.map +1 -0
- package/package.json +105 -0
- package/server.json +113 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview noaa_marine_get_tide_predictions tool — high/low tide predictions from CO-OPS.
|
|
3
|
+
* @module mcp-server/tools/definitions/noaa-marine-get-tide-predictions.tool
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getCoopsService } from '../../../services/coops/coops-service.js';
|
|
8
|
+
/** Parse YYYYMMDD → Date for range validation. */
|
|
9
|
+
function parseDateStr(s) {
|
|
10
|
+
return new Date(`${s.slice(0, 4)}-${s.slice(4, 6)}-${s.slice(6, 8)}T00:00:00Z`);
|
|
11
|
+
}
|
|
12
|
+
export const noaaMarineGetTidePredictions = tool('noaa_marine_get_tide_predictions', {
|
|
13
|
+
title: 'Get Tide Predictions',
|
|
14
|
+
description: 'High/low tide predictions for a CO-OPS tide station over a date range. ' +
|
|
15
|
+
'Returns time, height, and tide type (H=high, L=low) for each event when using the default hilo interval, ' +
|
|
16
|
+
'or 6-minute interval predictions for a detailed tide curve. ' +
|
|
17
|
+
'Datum defaults to MLLW (mean lower low water — standard for US nautical charts). ' +
|
|
18
|
+
'Date range is limited to 1 year per request; split longer ranges across multiple calls. ' +
|
|
19
|
+
'Use noaa_marine_find_stations first to resolve a station name or location to a numeric station ID.',
|
|
20
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
21
|
+
input: z.object({
|
|
22
|
+
station_id: z
|
|
23
|
+
.string()
|
|
24
|
+
.regex(/^[A-Za-z0-9_-]{1,20}$/)
|
|
25
|
+
.describe('CO-OPS tide station ID (numeric, e.g. "9447130" for Seattle). ' +
|
|
26
|
+
'Obtain from noaa_marine_find_stations with types=["tide"].'),
|
|
27
|
+
begin_date: z
|
|
28
|
+
.string()
|
|
29
|
+
.regex(/^\d{8}$/)
|
|
30
|
+
.describe('Start date in YYYYMMDD format, e.g. "20240601".'),
|
|
31
|
+
end_date: z
|
|
32
|
+
.string()
|
|
33
|
+
.regex(/^\d{8}$/)
|
|
34
|
+
.describe('End date in YYYYMMDD format (inclusive), e.g. "20240607".'),
|
|
35
|
+
datum: z
|
|
36
|
+
.enum(['MLLW', 'MHHW', 'MSL', 'MTL', 'MHW', 'MLW', 'CD', 'STND'])
|
|
37
|
+
.default('MLLW')
|
|
38
|
+
.describe('Tidal datum reference plane. MLLW (default) is the US nautical chart datum. ' +
|
|
39
|
+
'MSL = mean sea level; MHHW = mean higher high water (flooding reference).'),
|
|
40
|
+
time_zone: z
|
|
41
|
+
.enum(['lst_ldt', 'gmt', 'lst'])
|
|
42
|
+
.default('lst_ldt')
|
|
43
|
+
.describe('Time zone for returned timestamps. lst_ldt = local standard/daylight time (default); ' +
|
|
44
|
+
'gmt = UTC; lst = local standard time year-round.'),
|
|
45
|
+
units: z
|
|
46
|
+
.enum(['english', 'metric'])
|
|
47
|
+
.default('english')
|
|
48
|
+
.describe('Unit system for heights: english = feet; metric = meters.'),
|
|
49
|
+
interval: z
|
|
50
|
+
.enum(['hilo', '6min'])
|
|
51
|
+
.default('hilo')
|
|
52
|
+
.describe('Prediction interval: hilo (default) returns only high and low tide events; ' +
|
|
53
|
+
'6min returns a continuous prediction curve at 6-minute intervals.'),
|
|
54
|
+
}),
|
|
55
|
+
output: z.object({
|
|
56
|
+
station_id: z.string().describe('Station ID echoed from the request — for chaining.'),
|
|
57
|
+
station_name: z
|
|
58
|
+
.string()
|
|
59
|
+
.describe('Station name as returned by CO-OPS — confirms the correct station was queried.'),
|
|
60
|
+
datum: z
|
|
61
|
+
.string()
|
|
62
|
+
.describe('Tidal datum used (e.g. MLLW) — echoed for correct interpretation of heights.'),
|
|
63
|
+
units: z.string().describe('Height units: "english" (feet) or "metric" (meters).'),
|
|
64
|
+
predictions: z
|
|
65
|
+
.array(z
|
|
66
|
+
.object({
|
|
67
|
+
time: z
|
|
68
|
+
.string()
|
|
69
|
+
.describe('Prediction datetime in the requested time zone (YYYY-MM-DD HH:MM format).'),
|
|
70
|
+
height: z
|
|
71
|
+
.number()
|
|
72
|
+
.describe('Predicted water height in the requested units (feet or meters) relative to the datum.'),
|
|
73
|
+
type: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe('Tide type: H = high tide, L = low tide (only present for hilo interval).'),
|
|
77
|
+
})
|
|
78
|
+
.describe('A single tide prediction event.'))
|
|
79
|
+
.describe('Tide predictions for the requested date range.'),
|
|
80
|
+
}),
|
|
81
|
+
errors: [
|
|
82
|
+
{
|
|
83
|
+
reason: 'station_not_found',
|
|
84
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
85
|
+
when: 'CO-OPS returned an error for the station ID — likely wrong type or invalid ID.',
|
|
86
|
+
recovery: 'Use noaa_marine_find_stations with types=["tide"] to obtain a valid tide station ID.',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
reason: 'date_range_exceeded',
|
|
90
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
91
|
+
when: 'Requested date range exceeds the 1-year CO-OPS limit.',
|
|
92
|
+
recovery: 'Split the request into multiple calls each spanning at most 1 year.',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
reason: 'no_predictions',
|
|
96
|
+
code: JsonRpcErrorCode.NotFound,
|
|
97
|
+
when: 'Station exists but CO-OPS returned no prediction data for the date range.',
|
|
98
|
+
recovery: 'The station may be inactive or not a prediction station. Try a different station ID from noaa_marine_find_stations.',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
async handler(input, ctx) {
|
|
102
|
+
// Validate date range ≤ 1 year
|
|
103
|
+
const begin = parseDateStr(input.begin_date);
|
|
104
|
+
const end = parseDateStr(input.end_date);
|
|
105
|
+
const diffDays = (end.getTime() - begin.getTime()) / (1000 * 60 * 60 * 24);
|
|
106
|
+
if (diffDays > 365) {
|
|
107
|
+
throw ctx.fail('date_range_exceeded', `Date range of ${Math.ceil(diffDays)} days exceeds the 1-year limit.`, { ...ctx.recoveryFor('date_range_exceeded') });
|
|
108
|
+
}
|
|
109
|
+
const svc = getCoopsService();
|
|
110
|
+
// Fetch station list (for name resolution) and predictions in parallel.
|
|
111
|
+
// CO-OPS predictions API does not return station metadata — station list is best-effort.
|
|
112
|
+
const [tideStations, predResult] = await Promise.allSettled([
|
|
113
|
+
svc.getStations('tidepredictions', ctx),
|
|
114
|
+
svc.fetchTidePredictions({
|
|
115
|
+
station: input.station_id,
|
|
116
|
+
begin_date: input.begin_date,
|
|
117
|
+
end_date: input.end_date,
|
|
118
|
+
datum: input.datum,
|
|
119
|
+
time_zone: input.time_zone,
|
|
120
|
+
units: input.units,
|
|
121
|
+
interval: input.interval,
|
|
122
|
+
}, ctx),
|
|
123
|
+
]);
|
|
124
|
+
const stationMeta = tideStations.status === 'fulfilled'
|
|
125
|
+
? tideStations.value.find((s) => s.id === input.station_id)
|
|
126
|
+
: undefined;
|
|
127
|
+
if (predResult.status === 'rejected') {
|
|
128
|
+
const err = predResult.reason;
|
|
129
|
+
// CO-OPS returns HTTP 400 when the station ID is invalid or wrong type.
|
|
130
|
+
// fetchWithTimeout intercepts it before service-level JSON parsing — detect via statusCode.
|
|
131
|
+
if (err instanceof McpError) {
|
|
132
|
+
const statusCode = err.data?.statusCode;
|
|
133
|
+
if (statusCode === 400) {
|
|
134
|
+
throw ctx.fail('station_not_found', `CO-OPS rejected station ${input.station_id} — use noaa_marine_find_stations with types=["tide"] to verify the ID.`, { ...ctx.recoveryFor('station_not_found') });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
throw err;
|
|
138
|
+
}
|
|
139
|
+
const result = predResult.value;
|
|
140
|
+
if (!result.predictions || result.predictions.length === 0) {
|
|
141
|
+
throw ctx.fail('no_predictions', `No predictions returned for station ${input.station_id} in the requested date range.`, { ...ctx.recoveryFor('no_predictions') });
|
|
142
|
+
}
|
|
143
|
+
const predictions = result.predictions.map((p) => {
|
|
144
|
+
const entry = {
|
|
145
|
+
time: p.t,
|
|
146
|
+
height: Number.parseFloat(p.v),
|
|
147
|
+
};
|
|
148
|
+
if (p.type)
|
|
149
|
+
entry.type = p.type;
|
|
150
|
+
return entry;
|
|
151
|
+
});
|
|
152
|
+
ctx.log.info('Tide predictions fetched', {
|
|
153
|
+
station_id: input.station_id,
|
|
154
|
+
count: predictions.length,
|
|
155
|
+
interval: input.interval,
|
|
156
|
+
});
|
|
157
|
+
return {
|
|
158
|
+
station_id: input.station_id,
|
|
159
|
+
station_name: stationMeta?.name ?? result.stationName,
|
|
160
|
+
datum: input.datum,
|
|
161
|
+
units: input.units,
|
|
162
|
+
predictions,
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
format: (result) => {
|
|
166
|
+
const lines = [
|
|
167
|
+
`## Tide Predictions — ${result.station_name} (${result.station_id})`,
|
|
168
|
+
`**Datum:** ${result.datum} · **Units:** ${result.units}`,
|
|
169
|
+
'',
|
|
170
|
+
];
|
|
171
|
+
for (const p of result.predictions) {
|
|
172
|
+
const typeStr = p.type
|
|
173
|
+
? ` [${p.type === 'H' ? 'HIGH' : p.type === 'L' ? 'LOW' : p.type}]`
|
|
174
|
+
: '';
|
|
175
|
+
lines.push(`${p.time}${typeStr}: ${p.height} ${result.units === 'metric' ? 'm' : 'ft'}`);
|
|
176
|
+
}
|
|
177
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
//# sourceMappingURL=noaa-marine-get-tide-predictions.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noaa-marine-get-tide-predictions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/noaa-marine-get-tide-predictions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,kDAAkD;AAClD,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,E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GAAG,OAAO,KAAK,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3F,CAAC;QAED,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,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview noaa_marine_get_water_level tool — observed water levels with paired predictions.
|
|
3
|
+
* @module mcp-server/tools/definitions/noaa-marine-get-water-level.tool
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const noaaMarineGetWaterLevel: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
station_id: z.ZodString;
|
|
9
|
+
begin_date: z.ZodString;
|
|
10
|
+
end_date: z.ZodString;
|
|
11
|
+
datum: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
MLLW: "MLLW";
|
|
13
|
+
MHHW: "MHHW";
|
|
14
|
+
MSL: "MSL";
|
|
15
|
+
MTL: "MTL";
|
|
16
|
+
MHW: "MHW";
|
|
17
|
+
MLW: "MLW";
|
|
18
|
+
CD: "CD";
|
|
19
|
+
STND: "STND";
|
|
20
|
+
}>>;
|
|
21
|
+
time_zone: z.ZodDefault<z.ZodEnum<{
|
|
22
|
+
lst_ldt: "lst_ldt";
|
|
23
|
+
gmt: "gmt";
|
|
24
|
+
lst: "lst";
|
|
25
|
+
}>>;
|
|
26
|
+
units: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
english: "english";
|
|
28
|
+
metric: "metric";
|
|
29
|
+
}>>;
|
|
30
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
+
station_id: z.ZodString;
|
|
32
|
+
station_name: z.ZodString;
|
|
33
|
+
datum: z.ZodString;
|
|
34
|
+
units: z.ZodString;
|
|
35
|
+
observations: z.ZodArray<z.ZodObject<{
|
|
36
|
+
time: z.ZodString;
|
|
37
|
+
value: z.ZodNumber;
|
|
38
|
+
sigma: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
quality: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
predictions: z.ZodArray<z.ZodObject<{
|
|
42
|
+
time: z.ZodString;
|
|
43
|
+
value: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
residual_summary: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
max_surge: z.ZodNumber;
|
|
47
|
+
max_drawdown: z.ZodNumber;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>, readonly [{
|
|
50
|
+
readonly reason: "station_not_found";
|
|
51
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
52
|
+
readonly when: "CO-OPS returned an error for the station ID.";
|
|
53
|
+
readonly recovery: "Use noaa_marine_find_stations with types=[\"water_level\"] to obtain a valid station ID.";
|
|
54
|
+
}, {
|
|
55
|
+
readonly reason: "date_range_exceeded";
|
|
56
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
57
|
+
readonly when: "Requested date range exceeds the 31-day CO-OPS limit for 6-minute water level data.";
|
|
58
|
+
readonly recovery: "Split the request into multiple calls each spanning at most 31 days.";
|
|
59
|
+
}, {
|
|
60
|
+
readonly reason: "no_data";
|
|
61
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
62
|
+
readonly when: "Station exists but no observed water-level data for the date range.";
|
|
63
|
+
readonly recovery: "The station may be offline or the date range may be in the future. Try a different date range or station.";
|
|
64
|
+
}], undefined>;
|
|
65
|
+
//# sourceMappingURL=noaa-marine-get-water-level.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noaa-marine-get-water-level.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/noaa-marine-get-water-level.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAO3E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkRlC,CAAC"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview noaa_marine_get_water_level tool — observed water levels with paired predictions.
|
|
3
|
+
* @module mcp-server/tools/definitions/noaa-marine-get-water-level.tool
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getCoopsService } from '../../../services/coops/coops-service.js';
|
|
8
|
+
function parseDateStr(s) {
|
|
9
|
+
return new Date(`${s.slice(0, 4)}-${s.slice(4, 6)}-${s.slice(6, 8)}T00:00:00Z`);
|
|
10
|
+
}
|
|
11
|
+
export const noaaMarineGetWaterLevel = tool('noaa_marine_get_water_level', {
|
|
12
|
+
title: 'Get Water Level',
|
|
13
|
+
description: 'Observed water level (real-time or historical) for a CO-OPS water-level station, with paired predictions for comparison. ' +
|
|
14
|
+
'The difference (residual = observed − predicted) indicates storm surge (positive) or anomalous drawdown (negative). ' +
|
|
15
|
+
'Returns 6-minute observations alongside 6-minute predictions. ' +
|
|
16
|
+
'Date range is limited to 31 days per request; split longer ranges into multiple calls. ' +
|
|
17
|
+
'Use noaa_marine_find_stations first to resolve a station name or location to a valid station ID.',
|
|
18
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
19
|
+
input: z.object({
|
|
20
|
+
station_id: z
|
|
21
|
+
.string()
|
|
22
|
+
.regex(/^[A-Za-z0-9_-]{1,20}$/)
|
|
23
|
+
.describe('CO-OPS water-level station ID (numeric, e.g. "9447130" for Seattle). ' +
|
|
24
|
+
'Obtain from noaa_marine_find_stations with types=["water_level"].'),
|
|
25
|
+
begin_date: z
|
|
26
|
+
.string()
|
|
27
|
+
.regex(/^\d{8}$/)
|
|
28
|
+
.describe('Start date in YYYYMMDD format, e.g. "20240601".'),
|
|
29
|
+
end_date: z
|
|
30
|
+
.string()
|
|
31
|
+
.regex(/^\d{8}$/)
|
|
32
|
+
.describe('End date in YYYYMMDD format (inclusive), e.g. "20240601".'),
|
|
33
|
+
datum: z
|
|
34
|
+
.enum(['MLLW', 'MHHW', 'MSL', 'MTL', 'MHW', 'MLW', 'CD', 'STND'])
|
|
35
|
+
.default('MLLW')
|
|
36
|
+
.describe('Tidal datum reference plane. MLLW (default) is the US nautical chart datum. ' +
|
|
37
|
+
'MSL = mean sea level; MHHW = mean higher high water (flooding reference).'),
|
|
38
|
+
time_zone: z
|
|
39
|
+
.enum(['lst_ldt', 'gmt', 'lst'])
|
|
40
|
+
.default('lst_ldt')
|
|
41
|
+
.describe('Time zone for returned timestamps. lst_ldt = local standard/daylight time (default); ' +
|
|
42
|
+
'gmt = UTC; lst = local standard time year-round.'),
|
|
43
|
+
units: z
|
|
44
|
+
.enum(['english', 'metric'])
|
|
45
|
+
.default('english')
|
|
46
|
+
.describe('Unit system: english = feet; metric = meters.'),
|
|
47
|
+
}),
|
|
48
|
+
output: z.object({
|
|
49
|
+
station_id: z.string().describe('Station ID echoed from the request — for chaining.'),
|
|
50
|
+
station_name: z.string().describe('Station name as returned by CO-OPS.'),
|
|
51
|
+
datum: z
|
|
52
|
+
.string()
|
|
53
|
+
.describe('Tidal datum used — echoed for correct interpretation of water heights.'),
|
|
54
|
+
units: z.string().describe('Height units: "english" (feet) or "metric" (meters).'),
|
|
55
|
+
observations: z
|
|
56
|
+
.array(z
|
|
57
|
+
.object({
|
|
58
|
+
time: z.string().describe('Observation datetime in the requested time zone.'),
|
|
59
|
+
value: z
|
|
60
|
+
.number()
|
|
61
|
+
.describe('Observed water height in the requested units relative to the datum.'),
|
|
62
|
+
sigma: z
|
|
63
|
+
.number()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Standard deviation of the water level sensor reading.'),
|
|
66
|
+
quality: z.string().describe('Quality flag: p = preliminary, v = verified.'),
|
|
67
|
+
})
|
|
68
|
+
.describe('A single 6-minute observed water level reading.'))
|
|
69
|
+
.describe('6-minute observed water level readings.'),
|
|
70
|
+
predictions: z
|
|
71
|
+
.array(z
|
|
72
|
+
.object({
|
|
73
|
+
time: z.string().describe('Prediction datetime matching the observation time step.'),
|
|
74
|
+
value: z
|
|
75
|
+
.number()
|
|
76
|
+
.describe('Predicted water height in the requested units relative to the datum.'),
|
|
77
|
+
})
|
|
78
|
+
.describe('A single 6-minute tide prediction.'))
|
|
79
|
+
.describe('Paired 6-minute tide predictions for the same period. May be empty if CO-OPS predictions are unavailable for this station.'),
|
|
80
|
+
residual_summary: z
|
|
81
|
+
.object({
|
|
82
|
+
max_surge: z
|
|
83
|
+
.number()
|
|
84
|
+
.describe('Maximum positive residual (observed − predicted) in the requested units (feet for english, meters for metric) — storm surge indicator.'),
|
|
85
|
+
max_drawdown: z
|
|
86
|
+
.number()
|
|
87
|
+
.describe('Maximum negative residual magnitude in the requested units (feet for english, meters for metric) — anomalous drawdown indicator.'),
|
|
88
|
+
})
|
|
89
|
+
.optional()
|
|
90
|
+
.describe('Summary of observed-minus-predicted residuals in the requested units. Only present when both observations and predictions are available.'),
|
|
91
|
+
}),
|
|
92
|
+
errors: [
|
|
93
|
+
{
|
|
94
|
+
reason: 'station_not_found',
|
|
95
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
96
|
+
when: 'CO-OPS returned an error for the station ID.',
|
|
97
|
+
recovery: 'Use noaa_marine_find_stations with types=["water_level"] to obtain a valid station ID.',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
reason: 'date_range_exceeded',
|
|
101
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
102
|
+
when: 'Requested date range exceeds the 31-day CO-OPS limit for 6-minute water level data.',
|
|
103
|
+
recovery: 'Split the request into multiple calls each spanning at most 31 days.',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
reason: 'no_data',
|
|
107
|
+
code: JsonRpcErrorCode.NotFound,
|
|
108
|
+
when: 'Station exists but no observed water-level data for the date range.',
|
|
109
|
+
recovery: 'The station may be offline or the date range may be in the future. Try a different date range or station.',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
async handler(input, ctx) {
|
|
113
|
+
// Validate date range ≤ 31 days
|
|
114
|
+
const begin = parseDateStr(input.begin_date);
|
|
115
|
+
const end = parseDateStr(input.end_date);
|
|
116
|
+
const diffDays = (end.getTime() - begin.getTime()) / (1000 * 60 * 60 * 24);
|
|
117
|
+
if (diffDays > 31) {
|
|
118
|
+
throw ctx.fail('date_range_exceeded', `Date range of ${Math.ceil(diffDays)} days exceeds the 31-day limit for 6-minute water level data.`, { ...ctx.recoveryFor('date_range_exceeded') });
|
|
119
|
+
}
|
|
120
|
+
const svc = getCoopsService();
|
|
121
|
+
const params = {
|
|
122
|
+
station: input.station_id,
|
|
123
|
+
begin_date: input.begin_date,
|
|
124
|
+
end_date: input.end_date,
|
|
125
|
+
datum: input.datum,
|
|
126
|
+
time_zone: input.time_zone,
|
|
127
|
+
units: input.units,
|
|
128
|
+
};
|
|
129
|
+
// Fetch observed water level and predictions in parallel
|
|
130
|
+
const [obsResult, predResult] = await Promise.allSettled([
|
|
131
|
+
svc.fetchWaterLevel(params, ctx),
|
|
132
|
+
svc.fetchWaterLevelPredictions(params, ctx),
|
|
133
|
+
]);
|
|
134
|
+
if (obsResult.status === 'rejected') {
|
|
135
|
+
const err = obsResult.reason;
|
|
136
|
+
// CO-OPS returns HTTP 400 for invalid station IDs — fetchWithTimeout intercepts before JSON parsing.
|
|
137
|
+
if (err instanceof McpError) {
|
|
138
|
+
const statusCode = err.data?.statusCode;
|
|
139
|
+
if (statusCode === 400) {
|
|
140
|
+
throw ctx.fail('station_not_found', `CO-OPS rejected station ${input.station_id} — use noaa_marine_find_stations with types=["water_level"] to verify the ID.`, { ...ctx.recoveryFor('station_not_found') });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
throw err;
|
|
144
|
+
}
|
|
145
|
+
const { data: rawObs, stationName } = obsResult.value;
|
|
146
|
+
if (!rawObs || rawObs.length === 0) {
|
|
147
|
+
throw ctx.fail('no_data', `No water level data for station ${input.station_id} in the requested date range.`, { ...ctx.recoveryFor('no_data') });
|
|
148
|
+
}
|
|
149
|
+
const observations = rawObs.map((row) => {
|
|
150
|
+
const entry = {
|
|
151
|
+
time: row.t,
|
|
152
|
+
value: Number.parseFloat(row.v),
|
|
153
|
+
quality: row.q ?? 'p',
|
|
154
|
+
};
|
|
155
|
+
if (row.s) {
|
|
156
|
+
const sigma = Number.parseFloat(row.s);
|
|
157
|
+
if (!Number.isNaN(sigma))
|
|
158
|
+
entry.sigma = sigma;
|
|
159
|
+
}
|
|
160
|
+
return entry;
|
|
161
|
+
});
|
|
162
|
+
const rawPred = predResult.status === 'fulfilled' ? predResult.value : [];
|
|
163
|
+
const predictions = rawPred.map((p) => ({
|
|
164
|
+
time: p.t,
|
|
165
|
+
value: Number.parseFloat(p.v),
|
|
166
|
+
}));
|
|
167
|
+
// Compute residual summary when both series are present
|
|
168
|
+
let residualSummary;
|
|
169
|
+
if (observations.length > 0 && predictions.length > 0) {
|
|
170
|
+
const predMap = new Map(predictions.map((p) => [p.time, p.value]));
|
|
171
|
+
const residuals = [];
|
|
172
|
+
for (const obs of observations) {
|
|
173
|
+
const pred = predMap.get(obs.time);
|
|
174
|
+
if (pred !== undefined)
|
|
175
|
+
residuals.push(obs.value - pred);
|
|
176
|
+
}
|
|
177
|
+
if (residuals.length > 0) {
|
|
178
|
+
const maxSurge = Math.max(...residuals);
|
|
179
|
+
const maxDrawdown = Math.abs(Math.min(...residuals));
|
|
180
|
+
residualSummary = {
|
|
181
|
+
max_surge: Math.round(maxSurge * 100) / 100,
|
|
182
|
+
max_drawdown: Math.round(maxDrawdown * 100) / 100,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
ctx.log.info('Water level data fetched', {
|
|
187
|
+
station_id: input.station_id,
|
|
188
|
+
obs_count: observations.length,
|
|
189
|
+
pred_count: predictions.length,
|
|
190
|
+
});
|
|
191
|
+
return {
|
|
192
|
+
station_id: input.station_id,
|
|
193
|
+
station_name: stationName,
|
|
194
|
+
datum: input.datum,
|
|
195
|
+
units: input.units,
|
|
196
|
+
observations,
|
|
197
|
+
predictions,
|
|
198
|
+
...(residualSummary ? { residual_summary: residualSummary } : {}),
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
format: (result) => {
|
|
202
|
+
const lines = [
|
|
203
|
+
`## Water Level — ${result.station_name} (${result.station_id})`,
|
|
204
|
+
`**Datum:** ${result.datum} · **Units:** ${result.units}`,
|
|
205
|
+
];
|
|
206
|
+
if (result.residual_summary) {
|
|
207
|
+
const unitLabel = result.units === 'metric' ? 'm' : 'ft';
|
|
208
|
+
lines.push(`**Max surge:** ${result.residual_summary.max_surge} ${unitLabel} · **Max drawdown:** ${result.residual_summary.max_drawdown} ${unitLabel}`);
|
|
209
|
+
}
|
|
210
|
+
lines.push('', `**Observations** (${result.observations.length} records):`);
|
|
211
|
+
const obsToShow = result.observations.slice(0, 10);
|
|
212
|
+
for (const o of obsToShow) {
|
|
213
|
+
const sig = o.sigma !== undefined ? ` ±${o.sigma}` : '';
|
|
214
|
+
lines.push(`${o.time}: ${o.value} ${result.units === 'metric' ? 'm' : 'ft'}${sig} [${o.quality}]`);
|
|
215
|
+
}
|
|
216
|
+
if (result.observations.length > 10) {
|
|
217
|
+
lines.push(`... and ${result.observations.length - 10} more observations`);
|
|
218
|
+
}
|
|
219
|
+
if (result.predictions.length > 0) {
|
|
220
|
+
lines.push('', `**Predictions** (${result.predictions.length} records):`);
|
|
221
|
+
const predToShow = result.predictions.slice(0, 5);
|
|
222
|
+
for (const p of predToShow) {
|
|
223
|
+
lines.push(`${p.time}: ${p.value} ${result.units === 'metric' ? 'm' : 'ft'} (predicted)`);
|
|
224
|
+
}
|
|
225
|
+
if (result.predictions.length > 5) {
|
|
226
|
+
lines.push(`... and ${result.predictions.length - 5} more predictions`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
//# sourceMappingURL=noaa-marine-get-water-level.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noaa-marine-get-water-level.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/noaa-marine-get-water-level.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,6BAA6B,EAAE;IACzE,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,2HAA2H;QAC3H,sHAAsH;QACtH,gEAAgE;QAChE,yFAAyF;QACzF,kGAAkG;IACpG,WAAW,EAAE,EAAE,YAAY,E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AAC,CAAC,CAAC;YAClD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;gBAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC;YAC5F,CAAC;YACD,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAClC,KAAK,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,mBAAmB,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAED,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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview CO-OPS Tides & Currents API service — station list cache and data fetching.
|
|
3
|
+
* @module services/coops/coops-service
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import type { AppConfig } from '@cyanheads/mcp-ts-core/config';
|
|
7
|
+
import type { StorageService } from '@cyanheads/mcp-ts-core/storage';
|
|
8
|
+
import type { ServerConfig } from '../../config/server-config.js';
|
|
9
|
+
import type { CoopsCurrent6MinRow, CoopsCurrentRow, CoopsDataRow, CoopsPredictionRow, CoopsStation, CoopsStationType } from './types.js';
|
|
10
|
+
export declare class CoopsService {
|
|
11
|
+
private readonly applicationId;
|
|
12
|
+
private readonly stationCache;
|
|
13
|
+
constructor(_config: AppConfig, _storage: StorageService, serverConfig: ServerConfig);
|
|
14
|
+
/** Fetch (or return cached) station list for the given type. */
|
|
15
|
+
getStations(type: CoopsStationType, ctx: Context): Promise<CoopsStation[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Pre-warm the most-used station lists. Called during server setup.
|
|
18
|
+
* Errors are caught and logged — pre-warm is best-effort.
|
|
19
|
+
*/
|
|
20
|
+
preWarm(ctx: Context): Promise<void>;
|
|
21
|
+
/** Fetch tide predictions for a station over a date range. */
|
|
22
|
+
fetchTidePredictions(params: {
|
|
23
|
+
station: string;
|
|
24
|
+
begin_date: string;
|
|
25
|
+
end_date: string;
|
|
26
|
+
datum: string;
|
|
27
|
+
time_zone: string;
|
|
28
|
+
units: string;
|
|
29
|
+
interval: string;
|
|
30
|
+
}, ctx: Context): Promise<{
|
|
31
|
+
predictions: CoopsPredictionRow[];
|
|
32
|
+
stationName: string;
|
|
33
|
+
}>;
|
|
34
|
+
/** Fetch observed water levels for a station. */
|
|
35
|
+
fetchWaterLevel(params: {
|
|
36
|
+
station: string;
|
|
37
|
+
begin_date: string;
|
|
38
|
+
end_date: string;
|
|
39
|
+
datum: string;
|
|
40
|
+
time_zone: string;
|
|
41
|
+
units: string;
|
|
42
|
+
}, ctx: Context): Promise<{
|
|
43
|
+
data: CoopsDataRow[];
|
|
44
|
+
stationName: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** Fetch water level predictions for the same date range as a water_level request (companion fetch). */
|
|
47
|
+
fetchWaterLevelPredictions(params: {
|
|
48
|
+
station: string;
|
|
49
|
+
begin_date: string;
|
|
50
|
+
end_date: string;
|
|
51
|
+
datum: string;
|
|
52
|
+
time_zone: string;
|
|
53
|
+
units: string;
|
|
54
|
+
}, ctx: Context): Promise<CoopsPredictionRow[]>;
|
|
55
|
+
/** Fetch current predictions for a station. */
|
|
56
|
+
fetchCurrentPredictions(params: {
|
|
57
|
+
station: string;
|
|
58
|
+
begin_date: string;
|
|
59
|
+
end_date: string;
|
|
60
|
+
time_zone: string;
|
|
61
|
+
units: string;
|
|
62
|
+
interval: string;
|
|
63
|
+
}, ctx: Context): Promise<{
|
|
64
|
+
events?: CoopsCurrentRow[];
|
|
65
|
+
predictions?: CoopsCurrent6MinRow[];
|
|
66
|
+
stationName: string;
|
|
67
|
+
}>;
|
|
68
|
+
private buildDataUrl;
|
|
69
|
+
private detectHtmlError;
|
|
70
|
+
private checkCoopsError;
|
|
71
|
+
}
|
|
72
|
+
export declare function initCoopsService(config: AppConfig, storage: StorageService, serverConfig: ServerConfig): void;
|
|
73
|
+
export declare function getCoopsService(): CoopsService;
|
|
74
|
+
//# sourceMappingURL=coops-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coops-service.d.ts","sourceRoot":"","sources":["../../../src/services/coops/coops-service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,YAAY,EAEZ,kBAAkB,EAClB,YAAY,EAEZ,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAWpB,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2C;gBAG5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY;IAIpF,gEAAgE;IAC1D,WAAW,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA+BhF;;;OAGG;IACG,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1C,8DAA8D;IACxD,oBAAoB,CACxB,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EA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