@cyanheads/epa-mcp-server 0.3.3 → 0.4.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 +5 -5
- package/CLAUDE.md +5 -5
- package/Dockerfile +3 -3
- package/README.md +58 -23
- package/changelog/0.4.x/0.4.0.md +35 -0
- package/changelog/0.4.x/0.4.1.md +34 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/facility.resource.d.ts +8 -1
- package/dist/mcp-server/resources/definitions/facility.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/facility.resource.js +13 -7
- package/dist/mcp-server/resources/definitions/facility.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/index.d.ts +7 -1
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.d.ts +23 -9
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.js +165 -93
- package/dist/mcp-server/tools/definitions/get-air-quality.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-facility.tool.d.ts +30 -2
- package/dist/mcp-server/tools/definitions/get-facility.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-facility.tool.js +211 -53
- package/dist/mcp-server/tools/definitions/get-facility.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.d.ts +5 -2
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.js +18 -15
- package/dist/mcp-server/tools/definitions/get-tri-releases.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +165 -32
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-facilities.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-facilities.tool.js +39 -26
- package/dist/mcp-server/tools/definitions/search-facilities.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-superfund.tool.d.ts +3 -1
- package/dist/mcp-server/tools/definitions/search-superfund.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-superfund.tool.js +13 -9
- package/dist/mcp-server/tools/definitions/search-superfund.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.d.ts +17 -3
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.js +64 -12
- package/dist/mcp-server/tools/definitions/search-tri-releases.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-violations.tool.d.ts +20 -3
- package/dist/mcp-server/tools/definitions/search-violations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-violations.tool.js +84 -15
- package/dist/mcp-server/tools/definitions/search-violations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.d.ts +3 -1
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.js +22 -7
- package/dist/mcp-server/tools/definitions/search-water-systems.tool.js.map +1 -1
- package/dist/mcp-server/tools/format-lbs.d.ts +14 -0
- package/dist/mcp-server/tools/format-lbs.d.ts.map +1 -0
- package/dist/mcp-server/tools/format-lbs.js +16 -0
- package/dist/mcp-server/tools/format-lbs.js.map +1 -0
- package/dist/mcp-server/tools/format-location.d.ts +18 -0
- package/dist/mcp-server/tools/format-location.d.ts.map +1 -0
- package/dist/mcp-server/tools/format-location.js +26 -0
- package/dist/mcp-server/tools/format-location.js.map +1 -0
- package/dist/mcp-server/tools/format-tri-release.d.ts +16 -0
- package/dist/mcp-server/tools/format-tri-release.d.ts.map +1 -0
- package/dist/mcp-server/tools/format-tri-release.js +23 -0
- package/dist/mcp-server/tools/format-tri-release.js.map +1 -0
- package/dist/services/airnow/airnow-service.d.ts +10 -29
- package/dist/services/airnow/airnow-service.d.ts.map +1 -1
- package/dist/services/airnow/airnow-service.js +156 -97
- package/dist/services/airnow/airnow-service.js.map +1 -1
- package/dist/services/airnow/types.d.ts +62 -23
- package/dist/services/airnow/types.d.ts.map +1 -1
- package/dist/services/airnow/types.js +2 -1
- package/dist/services/airnow/types.js.map +1 -1
- package/dist/services/call-budget.d.ts +22 -0
- package/dist/services/call-budget.d.ts.map +1 -0
- package/dist/services/call-budget.js +28 -0
- package/dist/services/call-budget.js.map +1 -0
- package/dist/services/dmap/dmap-service.d.ts +76 -7
- package/dist/services/dmap/dmap-service.d.ts.map +1 -1
- package/dist/services/dmap/dmap-service.js +461 -144
- package/dist/services/dmap/dmap-service.js.map +1 -1
- package/dist/services/dmap/types.d.ts +17 -4
- package/dist/services/dmap/types.d.ts.map +1 -1
- package/dist/services/echo/echo-service.d.ts +38 -11
- package/dist/services/echo/echo-service.d.ts.map +1 -1
- package/dist/services/echo/echo-service.js +417 -223
- package/dist/services/echo/echo-service.js.map +1 -1
- package/dist/services/echo/types.d.ts +167 -80
- package/dist/services/echo/types.d.ts.map +1 -1
- package/dist/services/ejscreen/ejscreen-service.d.ts.map +1 -1
- package/dist/services/ejscreen/ejscreen-service.js +9 -3
- package/dist/services/ejscreen/ejscreen-service.js.map +1 -1
- package/package.json +7 -7
- package/server.json +9 -3
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Tool for getting AQI observations or
|
|
2
|
+
* @fileoverview Tool for getting current AQI observations or the issued AQI forecast for a
|
|
3
|
+
* location from AirNow.
|
|
3
4
|
* @module mcp-server/tools/definitions/get-air-quality.tool
|
|
4
5
|
*/
|
|
5
6
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
7
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
8
|
import { getAirNowService } from '../../../services/airnow/airnow-service.js';
|
|
9
|
+
const AIRNOW_PROGRAM = 'the U.S. EPA AirNow program (www.airnow.gov)';
|
|
10
|
+
const PRELIMINARY_NOTICE = 'AirNow data are preliminary and unverified; do not use them for regulatory, trend, or enforcement decisions.';
|
|
11
|
+
/** Credit line naming the agencies behind the returned readings and the AirNow program. */
|
|
12
|
+
function attributionFor(mode, areas) {
|
|
13
|
+
const agencies = [
|
|
14
|
+
...new Set(areas.flatMap((area) => area.readings.flatMap((r) => {
|
|
15
|
+
const agency = r.reportingAgency ?? r.forecastAgency;
|
|
16
|
+
return agency ? [agency] : [];
|
|
17
|
+
}))),
|
|
18
|
+
];
|
|
19
|
+
const list = (items) => new Intl.ListFormat('en', { type: 'conjunction' }).format(items);
|
|
20
|
+
const credit = mode === 'current'
|
|
21
|
+
? `Data courtesy of ${list([...agencies, AIRNOW_PROGRAM])}.`
|
|
22
|
+
: agencies.length > 0
|
|
23
|
+
? `Forecasts issued by ${list(agencies)} and distributed by ${AIRNOW_PROGRAM}.`
|
|
24
|
+
: `Forecasts distributed by ${AIRNOW_PROGRAM}.`;
|
|
25
|
+
return `${credit} ${PRELIMINARY_NOTICE}`;
|
|
26
|
+
}
|
|
8
27
|
export const getAirQualityTool = tool('epa_get_air_quality', {
|
|
9
28
|
title: 'Get Air Quality Index',
|
|
10
|
-
description:
|
|
29
|
+
description: "Get current AQI observations or the issued AQI forecast for a US location from the AirNow API. Provide either zip_code or both latitude and longitude. Current mode returns the latest hourly NowCast AQI for each pollutant (PM2.5, ozone, PM10) from the closest monitor within 50 miles, with the monitor site name, site ID, and reporting agency; pollutants in one reporting area can come from different monitors. Forecast mode returns every day the reporting area's agency has issued (typically one to five), each with the AQI category, an action-day flag, and the issue date, plus the agency's forecast discussion when one exists; some agencies forecast a category without an AQI number. In forecast mode, set forecast_date to keep only the forecast valid on that date; current mode rejects it. Data are preliminary — suitable for awareness, not regulatory, trend, or enforcement decisions. Responses are cached for ~1 hour.",
|
|
11
30
|
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
12
31
|
input: z.object({
|
|
13
|
-
zip_code: z.string().optional().describe('5-digit ZIP code for the location'),
|
|
32
|
+
zip_code: z.string().optional().describe('5-digit US ZIP code for the location'),
|
|
14
33
|
latitude: z
|
|
15
34
|
.number()
|
|
16
35
|
.optional()
|
|
@@ -22,18 +41,11 @@ export const getAirQualityTool = tool('epa_get_air_quality', {
|
|
|
22
41
|
mode: z
|
|
23
42
|
.enum(['current', 'forecast'])
|
|
24
43
|
.default('current')
|
|
25
|
-
.describe('Data mode: "current" for latest
|
|
44
|
+
.describe('Data mode: "current" for the latest hourly observations, "forecast" for every forecast day the reporting area has issued'),
|
|
26
45
|
forecast_date: z
|
|
27
46
|
.string()
|
|
28
47
|
.optional()
|
|
29
|
-
.describe('
|
|
30
|
-
distance_miles: z
|
|
31
|
-
.number()
|
|
32
|
-
.int()
|
|
33
|
-
.min(0)
|
|
34
|
-
.max(300)
|
|
35
|
-
.default(25)
|
|
36
|
-
.describe('Search radius in miles for finding reporting stations. Default 25 miles.'),
|
|
48
|
+
.describe('Forecast mode only (rejected in current mode): keep just the forecast valid on this date (YYYY-MM-DD). Omit to get every issued forecast day. When no issued day matches, the result is empty and its message lists the issued dates.'),
|
|
37
49
|
}),
|
|
38
50
|
output: z.object({
|
|
39
51
|
observations: z
|
|
@@ -42,48 +54,91 @@ export const getAirQualityTool = tool('epa_get_air_quality', {
|
|
|
42
54
|
reportingArea: z
|
|
43
55
|
.string()
|
|
44
56
|
.optional()
|
|
45
|
-
.describe('Name of the AQI reporting area (e.g. "Seattle-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
.describe('Name of the AQI reporting area (e.g. "Seattle-Bellevue-Kent Valley")'),
|
|
58
|
+
reportingAreaCode: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('AirNow reporting area code (e.g. "wa004"). Forecast mode only.'),
|
|
62
|
+
stateCode: z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('2-letter state code of the reporting area. Forecast mode only.'),
|
|
49
66
|
dateObserved: z
|
|
50
67
|
.string()
|
|
51
68
|
.optional()
|
|
52
|
-
.describe('Observation
|
|
69
|
+
.describe('Observation date (YYYY-MM-DD). Current mode only.'),
|
|
53
70
|
hourObserved: z
|
|
54
|
-
.
|
|
71
|
+
.string()
|
|
55
72
|
.optional()
|
|
56
|
-
.describe('
|
|
73
|
+
.describe('Local hour of the observation as "HH:00". Current mode only.'),
|
|
57
74
|
localTimeZone: z
|
|
58
75
|
.string()
|
|
59
76
|
.optional()
|
|
60
|
-
.describe('Local time zone abbreviation (e.g. "
|
|
77
|
+
.describe('Local time zone abbreviation for hourObserved (e.g. "PDT"). Current mode only.'),
|
|
78
|
+
discussion: z
|
|
79
|
+
.string()
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("The forecasting agency's discussion for this area, verbatim (may contain HTML). Forecast mode only; omitted when the agency issued none."),
|
|
61
82
|
readings: z
|
|
62
83
|
.array(z
|
|
63
84
|
.object({
|
|
64
85
|
parameterName: z
|
|
65
86
|
.string()
|
|
66
|
-
.describe('Pollutant name (e.g. "PM2.5", "
|
|
67
|
-
aqi: z
|
|
87
|
+
.describe('Pollutant name as AirNow reports it (e.g. "PM2.5", "OZONE", "PM10")'),
|
|
88
|
+
aqi: z
|
|
89
|
+
.number()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe('Air Quality Index value. Omitted when the agency issued only a category (category-only forecast).'),
|
|
68
92
|
categoryNumber: z
|
|
69
93
|
.number()
|
|
70
94
|
.optional()
|
|
71
|
-
.describe('AQI category number: 1=Good, 2=Moderate, 3=Unhealthy for Sensitive Groups, 4=Unhealthy, 5=Very Unhealthy, 6=Hazardous'),
|
|
95
|
+
.describe('AQI category number: 1=Good, 2=Moderate, 3=Unhealthy for Sensitive Groups, 4=Unhealthy, 5=Very Unhealthy, 6=Hazardous. Omitted when AirNow reports an unrecognized category.'),
|
|
72
96
|
categoryName: z
|
|
73
97
|
.string()
|
|
74
98
|
.optional()
|
|
75
99
|
.describe('AQI category name (e.g. "Good", "Moderate", "Unhealthy")'),
|
|
100
|
+
siteName: z
|
|
101
|
+
.string()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe('Monitor site that produced this observation. Current mode only.'),
|
|
104
|
+
siteID: z
|
|
105
|
+
.string()
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('AirNow ID of the monitor site. Current mode only.'),
|
|
108
|
+
reportingAgency: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('Agency that reported this observation. Current mode only.'),
|
|
112
|
+
dateIssue: z
|
|
113
|
+
.string()
|
|
114
|
+
.optional()
|
|
115
|
+
.describe('Date the forecast was issued (YYYY-MM-DD). Forecast mode only.'),
|
|
116
|
+
dateValid: z
|
|
117
|
+
.string()
|
|
118
|
+
.optional()
|
|
119
|
+
.describe('Date the forecast applies to (YYYY-MM-DD). Forecast mode only.'),
|
|
120
|
+
forecastAgency: z
|
|
121
|
+
.string()
|
|
122
|
+
.optional()
|
|
123
|
+
.describe('Agency that issued the forecast. Forecast mode only.'),
|
|
124
|
+
actionDay: z
|
|
125
|
+
.boolean()
|
|
126
|
+
.optional()
|
|
127
|
+
.describe('True when the agency declared an air quality action day for this date. Forecast mode only.'),
|
|
76
128
|
})
|
|
77
|
-
.describe('AQI reading for
|
|
78
|
-
.describe('Per-pollutant AQI readings for this reporting area
|
|
129
|
+
.describe('AQI reading for one pollutant (and, in forecast mode, one valid date)'))
|
|
130
|
+
.describe('Per-pollutant AQI readings for this reporting area'),
|
|
79
131
|
})
|
|
80
|
-
.describe('AQI
|
|
132
|
+
.describe('AQI readings for one reporting area — per observed hour in current mode, per area across all forecast days in forecast mode'))
|
|
81
133
|
.describe('AQI observation or forecast records grouped by reporting area'),
|
|
82
134
|
mode: z.string().describe('Data mode used: "current" or "forecast"'),
|
|
83
135
|
message: z
|
|
84
136
|
.string()
|
|
85
137
|
.optional()
|
|
86
|
-
.describe(
|
|
138
|
+
.describe("Why the result is empty: AirNow's own explanation, the issued forecast dates when forecast_date matched none, or a coverage hint. Absent when data is returned."),
|
|
139
|
+
attribution: z
|
|
140
|
+
.string()
|
|
141
|
+
.describe('Credit to the reporting or forecasting agencies and the U.S. EPA AirNow program, with the preliminary-data notice. Reproduce it when passing this data on.'),
|
|
87
142
|
}),
|
|
88
143
|
errors: [
|
|
89
144
|
{
|
|
@@ -93,98 +148,115 @@ export const getAirQualityTool = tool('epa_get_air_quality', {
|
|
|
93
148
|
recovery: 'Provide either zip_code or both latitude and longitude to identify the location.',
|
|
94
149
|
},
|
|
95
150
|
{
|
|
96
|
-
reason: '
|
|
151
|
+
reason: 'forecast_date_needs_forecast_mode',
|
|
152
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
153
|
+
when: 'forecast_date was set while mode is "current", where it has no effect.',
|
|
154
|
+
recovery: 'Set mode to "forecast" to filter by forecast_date, or omit forecast_date.',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
reason: 'invalid_zip_code',
|
|
97
158
|
code: JsonRpcErrorCode.ValidationError,
|
|
98
|
-
when: '
|
|
99
|
-
recovery: '
|
|
159
|
+
when: 'AirNow rejected zip_code as invalid (HTTP 400).',
|
|
160
|
+
recovery: 'Check that zip_code is a valid 5-digit US ZIP code, or pass latitude and longitude instead.',
|
|
161
|
+
thrownBy: 'service',
|
|
100
162
|
},
|
|
101
163
|
],
|
|
102
164
|
async handler(input, ctx) {
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const zip = input.zip_code;
|
|
107
|
-
const loc = zip !== undefined && zip.trim() !== ''
|
|
165
|
+
// Zip takes precedence over lat/lng; a blank zip (form clients) falls through to lat/lng.
|
|
166
|
+
const zip = input.zip_code?.trim();
|
|
167
|
+
const location = zip
|
|
108
168
|
? { kind: 'zip', zipCode: zip }
|
|
109
169
|
: input.latitude !== undefined && input.longitude !== undefined
|
|
110
170
|
? { kind: 'latlng', latitude: input.latitude, longitude: input.longitude }
|
|
111
171
|
: undefined;
|
|
112
|
-
if (!
|
|
172
|
+
if (!location) {
|
|
113
173
|
throw ctx.fail('no_location', 'Provide either zip_code or both latitude and longitude.');
|
|
114
174
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (input.forecast_date === undefined || input.forecast_date.trim() === '') {
|
|
119
|
-
throw ctx.fail('forecast_date_required', 'forecast_date (YYYY-MM-DD) is required when mode is "forecast".');
|
|
120
|
-
}
|
|
121
|
-
forecastDate = input.forecast_date;
|
|
175
|
+
const forecastDate = input.forecast_date?.trim() || undefined;
|
|
176
|
+
if (forecastDate && input.mode === 'current') {
|
|
177
|
+
throw ctx.fail('forecast_date_needs_forecast_mode', `forecast_date "${forecastDate}" only filters forecasts; current mode returns the latest observations.`);
|
|
122
178
|
}
|
|
123
179
|
ctx.log.info('epa_get_air_quality', {
|
|
124
180
|
mode: input.mode,
|
|
125
|
-
|
|
126
|
-
|
|
181
|
+
location: location.kind,
|
|
182
|
+
forecastDate,
|
|
127
183
|
});
|
|
128
184
|
const service = getAirNowService();
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
185
|
+
const lookup = input.mode === 'forecast'
|
|
186
|
+
? await service.getForecast(location, ctx)
|
|
187
|
+
: await service.getCurrent(location, ctx);
|
|
188
|
+
const observations = input.mode === 'forecast' && forecastDate
|
|
189
|
+
? lookup.areas.flatMap((area) => {
|
|
190
|
+
const readings = area.readings.filter((r) => r.dateValid === forecastDate);
|
|
191
|
+
return readings.length > 0 ? [{ ...area, readings }] : [];
|
|
192
|
+
})
|
|
193
|
+
: lookup.areas;
|
|
194
|
+
ctx.log.info('epa_get_air_quality completed', { areas: observations.length });
|
|
195
|
+
const attribution = attributionFor(input.mode, observations);
|
|
196
|
+
if (observations.length > 0)
|
|
197
|
+
return { observations, mode: input.mode, attribution };
|
|
198
|
+
const where = location.kind === 'zip'
|
|
199
|
+
? `zip_code="${location.zipCode}"`
|
|
200
|
+
: `latitude=${location.latitude}, longitude=${location.longitude}`;
|
|
201
|
+
let message;
|
|
202
|
+
if (lookup.noDataMessage !== undefined) {
|
|
203
|
+
message = `AirNow returned no data for ${where}: "${lookup.noDataMessage}"`;
|
|
139
204
|
}
|
|
140
|
-
else {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
latitude: loc.latitude,
|
|
146
|
-
longitude: loc.longitude,
|
|
147
|
-
date: forecastDate,
|
|
148
|
-
distanceMiles: input.distance_miles,
|
|
149
|
-
}, ctx);
|
|
205
|
+
else if (lookup.areas.length > 0) {
|
|
206
|
+
const issued = [
|
|
207
|
+
...new Set(lookup.areas.flatMap((a) => a.readings.flatMap((r) => r.dateValid ?? []))),
|
|
208
|
+
].sort();
|
|
209
|
+
message = `No forecast valid on ${forecastDate} for ${where}. ${issued.length > 0 ? `Issued forecast dates: ${issued.join(', ')}.` : 'AirNow listed no valid dates.'} Omit forecast_date to get every issued day.`;
|
|
150
210
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const location = loc.kind === 'zip'
|
|
154
|
-
? `zip_code="${input.zip_code}"`
|
|
155
|
-
: `lat=${input.latitude}, lng=${input.longitude}`;
|
|
156
|
-
return {
|
|
157
|
-
observations: [],
|
|
158
|
-
mode: input.mode,
|
|
159
|
-
message: `No AQI data found for ${location} within ${input.distance_miles} miles. Try increasing distance_miles or check that the location is within the US.`,
|
|
160
|
-
};
|
|
211
|
+
else {
|
|
212
|
+
message = `No AQI data found for ${where}. AirNow observations come from monitors within 50 miles and forecasts from the location's reporting area; check that the location is in the US, or try a nearby ZIP code.`;
|
|
161
213
|
}
|
|
162
|
-
return { observations, mode: input.mode };
|
|
214
|
+
return { observations: [], mode: input.mode, message, attribution };
|
|
163
215
|
},
|
|
164
216
|
format: (result) => {
|
|
165
|
-
const lines = [
|
|
166
|
-
|
|
217
|
+
const lines = [
|
|
218
|
+
`## Air Quality Index — ${result.mode === 'forecast' ? 'Forecast' : 'Current Observations'} (mode: ${result.mode})`,
|
|
219
|
+
];
|
|
167
220
|
if (result.message)
|
|
168
221
|
lines.push(`\n> ${result.message}`);
|
|
169
|
-
for (const
|
|
170
|
-
lines.push(`\n### ${
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
222
|
+
for (const area of result.observations) {
|
|
223
|
+
lines.push(`\n### ${area.reportingArea ?? 'Unknown Area'}`);
|
|
224
|
+
const meta = [
|
|
225
|
+
area.stateCode && `**State:** ${area.stateCode}`,
|
|
226
|
+
area.reportingAreaCode && `**Reporting area code:** ${area.reportingAreaCode}`,
|
|
227
|
+
].filter(Boolean);
|
|
228
|
+
if (meta.length > 0)
|
|
229
|
+
lines.push(meta.join(' | '));
|
|
230
|
+
if (area.dateObserved || area.hourObserved) {
|
|
231
|
+
const time = area.hourObserved
|
|
232
|
+
? ` at ${area.hourObserved}${area.localTimeZone ? ` ${area.localTimeZone}` : ''}`
|
|
176
233
|
: '';
|
|
177
|
-
lines.push(`**
|
|
234
|
+
lines.push(`**Observed:** ${area.dateObserved ?? 'date not reported'}${time}`);
|
|
178
235
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
236
|
+
for (const r of area.readings) {
|
|
237
|
+
const label = r.dateValid ? `${r.dateValid} ${r.parameterName}` : r.parameterName;
|
|
238
|
+
const value = r.aqi !== undefined
|
|
239
|
+
? `AQI ${r.aqi}${r.categoryName ? ` (${r.categoryName})` : ''}`
|
|
240
|
+
: (r.categoryName ?? 'Category not reported');
|
|
241
|
+
const category = r.categoryNumber !== undefined ? ` [category ${r.categoryNumber}]` : '';
|
|
242
|
+
const categoryOnly = r.aqi === undefined ? ' (category only, no AQI number)' : '';
|
|
243
|
+
const site = r.siteName || r.siteID
|
|
244
|
+
? ` — ${[r.siteName, r.siteID && `site ${r.siteID}`].filter(Boolean).join(', ')}`
|
|
245
|
+
: '';
|
|
246
|
+
const details = [
|
|
247
|
+
r.reportingAgency,
|
|
248
|
+
(r.dateIssue || r.forecastAgency) &&
|
|
249
|
+
['issued', r.dateIssue, r.forecastAgency && `by ${r.forecastAgency}`]
|
|
250
|
+
.filter(Boolean)
|
|
251
|
+
.join(' '),
|
|
252
|
+
r.actionDay !== undefined && `action day: ${r.actionDay ? 'yes' : 'no'}`,
|
|
253
|
+
].filter(Boolean);
|
|
254
|
+
lines.push(`- **${label}:** ${value}${category}${categoryOnly}${site}${details.length > 0 ? ` · ${details.join(' · ')}` : ''}`);
|
|
186
255
|
}
|
|
256
|
+
if (area.discussion)
|
|
257
|
+
lines.push(`\n**Discussion:**\n${area.discussion}`);
|
|
187
258
|
}
|
|
259
|
+
lines.push(`\n**Source:** ${result.attribution}`);
|
|
188
260
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
189
261
|
},
|
|
190
262
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-air-quality.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-air-quality.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"get-air-quality.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-air-quality.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,MAAM,cAAc,GAAG,8CAA8C,CAAC;AACtE,MAAM,kBAAkB,GACtB,8GAA8G,CAAC;AAEjH,2FAA2F;AAC3F,SAAS,cAAc,CAAC,IAA4B,EAAE,KAAuB;IAC3E,M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AE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,cAAc,IAAI,MAAM,CAAC,CAAC,cAAc,EAAE,CAAC;6BAClE,MAAM,CAAC,OAAO,CAAC;6BACf,IAAI,CAAC,GAAG,CAAC;oBACd,CAAC,CAAC,SAAS,KAAK,SAAS,IAAI,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;iBACzE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAClB,KAAK,CAAC,IAAI,CACR,OAAO,KAAK,OAAO,KAAK,GAAG,QAAQ,GAAG,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CACpH,CAAC;YACJ,CAAC;YACD,IAAI,IAAI,CAAC,UAAU;gBAAE,KAAK,CAAC,IAAI,CAAC,sBAAsB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC3E,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAClD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -25,22 +25,47 @@ export declare const getFacilityTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
25
25
|
tri: z.ZodBoolean;
|
|
26
26
|
sdwa: z.ZodBoolean;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
|
+
triFacilityIds: z.ZodArray<z.ZodString>;
|
|
28
29
|
triReleasesTransfersInLbs: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
triReleasesTransfersYear: z.ZodOptional<z.ZodNumber>;
|
|
29
31
|
compliance: z.ZodOptional<z.ZodObject<{
|
|
30
32
|
mediaStatusCode: z.ZodOptional<z.ZodString>;
|
|
31
33
|
mediaStatusDescription: z.ZodOptional<z.ZodString>;
|
|
32
34
|
quartersInViolation: z.ZodOptional<z.ZodNumber>;
|
|
33
35
|
}, z.core.$strip>>;
|
|
36
|
+
programCompliance: z.ZodArray<z.ZodObject<{
|
|
37
|
+
statute: z.ZodString;
|
|
38
|
+
currentStatus: z.ZodOptional<z.ZodString>;
|
|
39
|
+
quartersInNoncompliance: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
quartersInSignificantNoncompliance: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
inspections: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
lastInspectionDate: z.ZodOptional<z.ZodString>;
|
|
43
|
+
informalActions: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
formalActions: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
totalPenaltiesInDollars: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
threeYearPeriodStart: z.ZodOptional<z.ZodString>;
|
|
47
|
+
fiveYearPeriodStart: z.ZodOptional<z.ZodString>;
|
|
48
|
+
periodEnd: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
34
50
|
inspections: z.ZodArray<z.ZodObject<{
|
|
51
|
+
category: z.ZodOptional<z.ZodString>;
|
|
35
52
|
activityType: z.ZodOptional<z.ZodString>;
|
|
36
53
|
activityDate: z.ZodOptional<z.ZodString>;
|
|
37
54
|
description: z.ZodOptional<z.ZodString>;
|
|
55
|
+
statute: z.ZodOptional<z.ZodString>;
|
|
56
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
leadAgency: z.ZodOptional<z.ZodString>;
|
|
38
58
|
}, z.core.$strip>>;
|
|
59
|
+
inspectionsTotal: z.ZodNumber;
|
|
39
60
|
formalActions: z.ZodArray<z.ZodObject<{
|
|
40
61
|
caseId: z.ZodOptional<z.ZodString>;
|
|
41
62
|
settlementDate: z.ZodOptional<z.ZodString>;
|
|
42
63
|
penaltyAssessedInDollars: z.ZodOptional<z.ZodNumber>;
|
|
43
64
|
actionType: z.ZodOptional<z.ZodString>;
|
|
65
|
+
actionDate: z.ZodOptional<z.ZodString>;
|
|
66
|
+
statute: z.ZodOptional<z.ZodString>;
|
|
67
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
leadAgency: z.ZodOptional<z.ZodString>;
|
|
44
69
|
}, z.core.$strip>>;
|
|
45
70
|
airCompliance: z.ZodOptional<z.ZodObject<{
|
|
46
71
|
programId: z.ZodOptional<z.ZodString>;
|
|
@@ -55,7 +80,10 @@ export declare const getFacilityTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
55
80
|
}, z.core.$strip>, readonly [{
|
|
56
81
|
readonly reason: "facility_not_found";
|
|
57
82
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
58
|
-
readonly when: "ECHO
|
|
83
|
+
readonly when: "ECHO has no facility for the given Registry ID.";
|
|
59
84
|
readonly recovery: "Verify the Registry ID using epa_search_facilities and retry with a valid ID.";
|
|
60
|
-
|
|
85
|
+
readonly thrownBy: "service";
|
|
86
|
+
}], {
|
|
87
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}>;
|
|
61
89
|
//# sourceMappingURL=get-facility.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-facility.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-facility.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-facility.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-facility.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Z1B,CAAC"}
|