@cyanheads/earthquake-mcp-server 0.3.0 → 0.3.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/CLAUDE.md +1 -1
- package/README.md +11 -6
- package/dist/mcp-server/resources/definitions/earthquake-event.resource.d.ts +67 -1
- package/dist/mcp-server/resources/definitions/earthquake-event.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/earthquake-event.resource.js +52 -8
- package/dist/mcp-server/resources/definitions/earthquake-event.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-count.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/earthquake-count.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-count.tool.js +35 -7
- package/dist/mcp-server/tools/definitions/earthquake-count.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-get-event.tool.d.ts +60 -0
- package/dist/mcp-server/tools/definitions/earthquake-get-event.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-get-event.tool.js +48 -9
- package/dist/mcp-server/tools/definitions/earthquake-get-event.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.d.ts +1 -0
- package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.d.ts +9 -1
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.js +35 -7
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.js.map +1 -1
- package/dist/mcp-server/tools/fdsn-error.d.ts +13 -7
- package/dist/mcp-server/tools/fdsn-error.d.ts.map +1 -1
- package/dist/mcp-server/tools/fdsn-error.js +23 -10
- package/dist/mcp-server/tools/fdsn-error.js.map +1 -1
- package/dist/mcp-server/tools/query-params.d.ts +1 -0
- package/dist/mcp-server/tools/query-params.d.ts.map +1 -1
- package/dist/mcp-server/tools/query-params.js +8 -2
- package/dist/mcp-server/tools/query-params.js.map +1 -1
- package/dist/mcp-server/tools/schemas.d.ts +60 -0
- package/dist/mcp-server/tools/schemas.d.ts.map +1 -1
- package/dist/mcp-server/tools/schemas.js +202 -0
- package/dist/mcp-server/tools/schemas.js.map +1 -1
- package/dist/services/emsc/emsc-service.d.ts.map +1 -1
- package/dist/services/emsc/emsc-service.js +6 -1
- package/dist/services/emsc/emsc-service.js.map +1 -1
- package/dist/services/usgs/types.d.ts +111 -1
- package/dist/services/usgs/types.d.ts.map +1 -1
- package/dist/services/usgs/usgs-service.d.ts +11 -3
- package/dist/services/usgs/usgs-service.d.ts.map +1 -1
- package/dist/services/usgs/usgs-service.js +110 -2
- package/dist/services/usgs/usgs-service.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/CLAUDE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Server:** earthquake-mcp-server
|
|
4
4
|
**Package:** `@cyanheads/earthquake-mcp-server`
|
|
5
|
-
**Version:** 0.3.
|
|
5
|
+
**Version:** 0.3.1
|
|
6
6
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.17`
|
|
7
7
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
8
8
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/earthquake-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/earthquake-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -58,7 +58,8 @@ Search earthquakes by time range, magnitude, depth, location radius, PAGER alert
|
|
|
58
58
|
|
|
59
59
|
- Dual-source: USGS (global, richer metadata) or EMSC (an independent global catalog from the European-Mediterranean Seismological Centre, for cross-verification anywhere)
|
|
60
60
|
- Full FDSN ComCat query API parameters: time range, magnitude, depth, location radius
|
|
61
|
-
- USGS-specific filters: PAGER alert level (`green`/`yellow`/`orange`/`red`), DYFI felt reports count, significance score
|
|
61
|
+
- USGS-specific filters: PAGER alert level (`green`/`yellow`/`orange`/`red`), DYFI felt reports count, significance score, event type
|
|
62
|
+
- Every event carries its upstream `event_type` — USGS spells it out (`earthquake`, `quarry blast`, `explosion`, `ice quake`), EMSC publishes a code (`ke` known earthquake, `ue` unknown event) — and the `event_type` filter narrows to one of them on USGS
|
|
62
63
|
- Location-based queries: provide `latitude`, `longitude`, and `radius_km` together
|
|
63
64
|
- Sort by time (newest first) or magnitude (largest first), ascending or descending
|
|
64
65
|
- One call returns at most 20,000 events; page beyond that with `offset`, forwarded straight to the upstream FDSN `offset` parameter on both sources
|
|
@@ -73,7 +74,8 @@ Search earthquakes by time range, magnitude, depth, location radius, PAGER alert
|
|
|
73
74
|
Count earthquakes matching filters without fetching full records.
|
|
74
75
|
|
|
75
76
|
- Lightweight alternative to `earthquake_search` for statistical queries ("how many M5+ events in 2025?")
|
|
76
|
-
- Same filter surface as `earthquake_search`: time, magnitude, depth, location radius, PAGER, DYFI, significance
|
|
77
|
+
- Same filter surface as `earthquake_search`: time, magnitude, depth, location radius, PAGER, DYFI, significance, event type
|
|
78
|
+
- A radius over a mining region counts quarry blasts alongside earthquakes — pass `event_type="earthquake"` on USGS to exclude them
|
|
77
79
|
- Returns `exceeds_limit` flag when count exceeds 20,000 — signals a full search needs paging
|
|
78
80
|
- Echoes the effective query back as `queryEcho`, including the resolved time window — omitting `start_time` counts only the last 30 days
|
|
79
81
|
- USGS returns the `max_allowed` cap (20,000); EMSC count endpoint does not expose this field (`max_allowed` will be null)
|
|
@@ -85,7 +87,9 @@ Count earthquakes matching filters without fetching full records.
|
|
|
85
87
|
|
|
86
88
|
Fetch complete detail for a specific earthquake by USGS event ID.
|
|
87
89
|
|
|
88
|
-
- Returns the
|
|
90
|
+
- Returns the normalized event a search result already carries, plus `detail` — a projection of the analysis products only the single-event response holds
|
|
91
|
+
- `detail` groups: PAGER alert and report link, ShakeMap peak MMI/PGA/PGV and intensity map, DYFI response count and max CDI, moment-tensor scalar moment and nodal planes, landslide and liquefaction alerts, origin quality (azimuthal gap, station count, location and depth uncertainty), finite-fault rupture length and width
|
|
92
|
+
- A group is omitted when USGS produced no such product — a small automatic event usually has none, a large reviewed one has most of them
|
|
89
93
|
- Event IDs appear in the `id` field of `earthquake_get_feed` and `earthquake_search` results (e.g. `us6000sznj`, `hv74966427`)
|
|
90
94
|
- USGS-only — EMSC events have no per-event detail endpoint
|
|
91
95
|
|
|
@@ -94,7 +98,7 @@ Fetch complete detail for a specific earthquake by USGS event ID.
|
|
|
94
98
|
| Type | URI pattern | Description |
|
|
95
99
|
|:---|:---|:---|
|
|
96
100
|
| Resource | `earthquake://feed/{magnitude_tier}/{time_window}` | USGS real-time earthquake feed as injectable context — returns the whole feed, so use the `earthquake_get_feed` tool for the broad tiers |
|
|
97
|
-
| Resource | `earthquake://event/{event_id}` | Full USGS earthquake event detail by ID as injectable context |
|
|
101
|
+
| Resource | `earthquake://event/{event_id}` | Full USGS earthquake event detail by ID as injectable context, including the same `detail` product projection as `earthquake_get_event` |
|
|
98
102
|
|
|
99
103
|
## Features
|
|
100
104
|
|
|
@@ -121,7 +125,8 @@ Agent-friendly output:
|
|
|
121
125
|
- Fields a source does not publish come back `null`, never as a fabricated zero — `tsunami` and `status` are null on EMSC events, and the rendered text says "not published by source" rather than "no tsunami" or "reviewed"
|
|
122
126
|
- `source_catalog` and `auth` carry provenance (which catalog and which authoritative agency produced a solution) so agents can weigh two sources against each other
|
|
123
127
|
- USGS-only filters dropped for an EMSC query are named in `ignoredFilters` on both `earthquake_search` and `earthquake_count`
|
|
124
|
-
- An upstream
|
|
128
|
+
- An upstream rejection surfaces the service's own explanation (the offending parameter and its accepted format) in the error message, not just a status code; when the service explains nothing, the error says so under its own reason rather than passing the raw upstream body through
|
|
129
|
+
- `event_type` travels with every event, so a quarry blast or explosion is never silently read as an earthquake
|
|
125
130
|
|
|
126
131
|
## Getting started
|
|
127
132
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module mcp-server/resources/definitions/earthquake-event.resource
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
6
7
|
export declare const earthquakeEventResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
7
8
|
event_id: z.ZodString;
|
|
8
9
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -35,8 +36,73 @@ export declare const earthquakeEventResource: import("@cyanheads/mcp-ts-core").R
|
|
|
35
36
|
}>>;
|
|
36
37
|
source_catalog: z.ZodOptional<z.ZodString>;
|
|
37
38
|
auth: z.ZodOptional<z.ZodString>;
|
|
39
|
+
event_type: z.ZodOptional<z.ZodString>;
|
|
38
40
|
event_url: z.ZodOptional<z.ZodString>;
|
|
39
41
|
detail_url: z.ZodOptional<z.ZodString>;
|
|
40
42
|
}, z.core.$strip>;
|
|
41
|
-
|
|
43
|
+
detail: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
losspager: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
alert_level: z.ZodOptional<z.ZodString>;
|
|
46
|
+
report_url: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
shakemap: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
max_mmi: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
max_pga: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
max_pgv: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
intensity_map_url: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
dyfi: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
responses: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
max_cdi: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
map_url: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
moment_tensor: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
scalar_moment_nm: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
derived_depth_km: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
nodal_plane_1: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
strike: z.ZodNumber;
|
|
64
|
+
dip: z.ZodNumber;
|
|
65
|
+
rake: z.ZodNumber;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
nodal_plane_2: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
strike: z.ZodNumber;
|
|
69
|
+
dip: z.ZodNumber;
|
|
70
|
+
rake: z.ZodNumber;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
ground_failure: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
landslide_alert: z.ZodOptional<z.ZodString>;
|
|
75
|
+
liquefaction_alert: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
origin: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
azimuthal_gap_deg: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
num_stations_used: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
horizontal_error_km: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
depth_error_km: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
review_status: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
finite_fault: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
rupture_length_km: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
rupture_width_km: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
model_url: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
}, z.core.$strip>, readonly [{
|
|
91
|
+
readonly reason: "not_found";
|
|
92
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
93
|
+
readonly when: "No event matches the provided event_id.";
|
|
94
|
+
readonly recovery: string;
|
|
95
|
+
}, {
|
|
96
|
+
readonly reason: "source_unavailable";
|
|
97
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
98
|
+
readonly when: "The USGS event API returns a 5xx, serves HTML, or is unreachable.";
|
|
99
|
+
readonly retryable: true;
|
|
100
|
+
readonly recovery: string;
|
|
101
|
+
}, {
|
|
102
|
+
readonly reason: "source_timeout";
|
|
103
|
+
readonly code: JsonRpcErrorCode.Timeout;
|
|
104
|
+
readonly when: "The USGS event API did not answer before the request deadline.";
|
|
105
|
+
readonly retryable: true;
|
|
106
|
+
readonly recovery: string;
|
|
107
|
+
}]>;
|
|
42
108
|
//# sourceMappingURL=earthquake-event.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earthquake-event.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-event.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"earthquake-event.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-event.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAI3E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFlC,CAAC"}
|
|
@@ -3,35 +3,79 @@
|
|
|
3
3
|
* @module mcp-server/resources/definitions/earthquake-event.resource
|
|
4
4
|
*/
|
|
5
5
|
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { JsonRpcErrorCode, McpError
|
|
7
|
-
import { EarthquakeEventSchema } from '../../../mcp-server/tools/schemas.js';
|
|
6
|
+
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { EarthquakeDetailSchema, EarthquakeEventSchema } from '../../../mcp-server/tools/schemas.js';
|
|
8
8
|
import { getUsgsService } from '../../../services/usgs/usgs-service.js';
|
|
9
9
|
export const earthquakeEventResource = resource('earthquake://event/{event_id}', {
|
|
10
10
|
name: 'earthquake-event',
|
|
11
11
|
title: 'USGS Earthquake Event',
|
|
12
12
|
description: 'Earthquake event detail by USGS event ID as injectable context. ' +
|
|
13
|
-
'Returns
|
|
14
|
-
'
|
|
13
|
+
'Returns the normalized event plus the analysis products only the single-event response ' +
|
|
14
|
+
'holds: PAGER alert, ShakeMap ground motion, DYFI felt reports, moment tensor, ground-failure ' +
|
|
15
|
+
'alerts, origin quality, and finite-fault rupture dimensions, each omitted when USGS ' +
|
|
16
|
+
'produced none. Use event IDs from earthquake_get_feed or earthquake_search results.',
|
|
15
17
|
mimeType: 'application/json',
|
|
16
18
|
params: z.object({
|
|
17
19
|
event_id: z.string().describe('USGS event ID, e.g. "us6000sznj" or "hv74966427".'),
|
|
18
20
|
}),
|
|
19
21
|
output: z.object({
|
|
20
22
|
event: EarthquakeEventSchema.describe('Full earthquake event detail.'),
|
|
23
|
+
detail: EarthquakeDetailSchema.optional().describe('Analysis products USGS attached to this event. Absent when the event carries none — ' +
|
|
24
|
+
'that means no product was produced, not that impact was zero.'),
|
|
21
25
|
}),
|
|
26
|
+
errors: [
|
|
27
|
+
{
|
|
28
|
+
reason: 'not_found',
|
|
29
|
+
code: JsonRpcErrorCode.NotFound,
|
|
30
|
+
when: 'No event matches the provided event_id.',
|
|
31
|
+
recovery: 'Verify the event ID from a feed or search result. ' +
|
|
32
|
+
'IDs are network-specific strings like "us6000sznj" or "hv74966427".',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
reason: 'source_unavailable',
|
|
36
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
37
|
+
when: 'The USGS event API returns a 5xx, serves HTML, or is unreachable.',
|
|
38
|
+
retryable: true,
|
|
39
|
+
recovery: 'Retry after a short delay. The same event also appears in earthquake_search and ' +
|
|
40
|
+
'earthquake_get_feed results, which carry the normalized record without the products.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
reason: 'source_timeout',
|
|
44
|
+
code: JsonRpcErrorCode.Timeout,
|
|
45
|
+
when: 'The USGS event API did not answer before the request deadline.',
|
|
46
|
+
retryable: true,
|
|
47
|
+
recovery: 'Retry the same event ID — a single-event lookup carries no filters to reduce. If it ' +
|
|
48
|
+
'keeps timing out, read the event from an earthquake_search or earthquake_get_feed result.',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
22
51
|
async handler(params, ctx) {
|
|
23
52
|
ctx.log.debug('Fetching event resource', { event_id: params.event_id });
|
|
24
|
-
let
|
|
53
|
+
let result;
|
|
25
54
|
try {
|
|
26
|
-
|
|
55
|
+
result = await getUsgsService().getEvent(params.event_id, ctx);
|
|
27
56
|
}
|
|
28
57
|
catch (err) {
|
|
29
58
|
if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
|
|
30
|
-
throw
|
|
59
|
+
throw ctx.fail('not_found', `No earthquake event found for ID "${params.event_id}". Verify the ID from a feed or search result.`, { ...ctx.recoveryFor('not_found') });
|
|
60
|
+
}
|
|
61
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.ServiceUnavailable) {
|
|
62
|
+
throw ctx.fail('source_unavailable', err.message, {
|
|
63
|
+
...ctx.recoveryFor('source_unavailable'),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// A timeout classifies as Timeout, not ServiceUnavailable — it needs its own
|
|
67
|
+
// branch or it bypasses the contract and reaches the caller with no recovery hint.
|
|
68
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.Timeout) {
|
|
69
|
+
throw ctx.fail('source_timeout', err.message, {
|
|
70
|
+
...ctx.recoveryFor('source_timeout'),
|
|
71
|
+
});
|
|
31
72
|
}
|
|
32
73
|
throw err;
|
|
33
74
|
}
|
|
34
|
-
return {
|
|
75
|
+
return {
|
|
76
|
+
event: result.event,
|
|
77
|
+
...(result.detail ? { detail: result.detail } : {}),
|
|
78
|
+
};
|
|
35
79
|
},
|
|
36
80
|
});
|
|
37
81
|
//# sourceMappingURL=earthquake-event.resource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earthquake-event.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-event.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"earthquake-event.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-event.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAoB,MAAM,iCAAiC,CAAC;AAEnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,+BAA+B,EAAE;IAC/E,IAAI,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22
|
}>>;
|
|
23
23
|
min_felt: z.ZodOptional<z.ZodNumber>;
|
|
24
24
|
min_significance: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
event_type: z.ZodOptional<z.ZodString>;
|
|
25
26
|
source: z.ZodDefault<z.ZodEnum<{
|
|
26
27
|
usgs: "usgs";
|
|
27
28
|
emsc: "emsc";
|
|
@@ -54,7 +55,12 @@ export declare const earthquakeCount: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
54
55
|
}, {
|
|
55
56
|
readonly reason: "upstream_rejected";
|
|
56
57
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
57
|
-
readonly when: "The source API rejected the query parameters
|
|
58
|
+
readonly when: "The source API rejected the query parameters and explained why in its response body.";
|
|
59
|
+
readonly recovery: string;
|
|
60
|
+
}, {
|
|
61
|
+
readonly reason: "upstream_rejected_no_reason";
|
|
62
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
63
|
+
readonly when: "The source API rejected the query but its response body carried no usable explanation.";
|
|
58
64
|
readonly recovery: string;
|
|
59
65
|
}], {
|
|
60
66
|
readonly queryEcho: z.ZodOptional<z.ZodObject<{
|
|
@@ -70,6 +76,7 @@ export declare const earthquakeCount: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
70
76
|
alert_level: z.ZodOptional<z.ZodString>;
|
|
71
77
|
min_felt: z.ZodOptional<z.ZodNumber>;
|
|
72
78
|
min_significance: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
event_type: z.ZodOptional<z.ZodString>;
|
|
73
80
|
source: z.ZodEnum<{
|
|
74
81
|
usgs: "usgs";
|
|
75
82
|
emsc: "emsc";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earthquake-count.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-count.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,eAAe
|
|
1
|
+
{"version":3,"file":"earthquake-count.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-count.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,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0X1B,CAAC"}
|
|
@@ -19,8 +19,10 @@ export const earthquakeCount = tool('earthquake_count', {
|
|
|
19
19
|
'narrow filters before fetching. ' +
|
|
20
20
|
'USGS returns the max_allowed cap (20,000); EMSC count endpoint does not return this field ' +
|
|
21
21
|
'(max_allowed will be null). ' +
|
|
22
|
-
'
|
|
23
|
-
'
|
|
22
|
+
'Both catalogs include non-tectonic records, so a radius over a mining region counts quarry ' +
|
|
23
|
+
'blasts alongside earthquakes — pass event_type="earthquake" on USGS to exclude them. ' +
|
|
24
|
+
'USGS-specific filters (alert_level, event_type, min_felt, min_significance) are not sent when ' +
|
|
25
|
+
'source=emsc — the response names them in ignoredFilters.',
|
|
24
26
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
25
27
|
input: z.object({
|
|
26
28
|
start_time: z
|
|
@@ -85,6 +87,13 @@ export const earthquakeCount = tool('earthquake_count', {
|
|
|
85
87
|
.describe('Minimum USGS significance score (0–2000+). ' +
|
|
86
88
|
'Combines magnitude, felt reports, and PAGER estimates. ' +
|
|
87
89
|
'Significant events typically score 600+. Only available from USGS.'),
|
|
90
|
+
event_type: z
|
|
91
|
+
.string()
|
|
92
|
+
.optional()
|
|
93
|
+
.describe('Filter by upstream event classification, e.g. "earthquake" to exclude quarry blasts and ' +
|
|
94
|
+
'explosions from the count, or "quarry blast" to count only those. Matched verbatim ' +
|
|
95
|
+
'against the USGS catalog, which accepts any string and returns a count of zero for an ' +
|
|
96
|
+
'unrecognized one. Only available from USGS.'),
|
|
88
97
|
source: z
|
|
89
98
|
.enum(['usgs', 'emsc'])
|
|
90
99
|
.default('usgs')
|
|
@@ -145,6 +154,10 @@ export const earthquakeCount = tool('earthquake_count', {
|
|
|
145
154
|
.number()
|
|
146
155
|
.optional()
|
|
147
156
|
.describe('Significance filter sent upstream. Absent for EMSC — not supported there.'),
|
|
157
|
+
event_type: z
|
|
158
|
+
.string()
|
|
159
|
+
.optional()
|
|
160
|
+
.describe('Event-type filter sent upstream. Absent for EMSC — not supported there.'),
|
|
148
161
|
source: z.enum(['usgs', 'emsc']).describe('Data source queried.'),
|
|
149
162
|
})
|
|
150
163
|
.optional()
|
|
@@ -194,10 +207,18 @@ export const earthquakeCount = tool('earthquake_count', {
|
|
|
194
207
|
{
|
|
195
208
|
reason: 'upstream_rejected',
|
|
196
209
|
code: JsonRpcErrorCode.InvalidParams,
|
|
197
|
-
when: 'The source API rejected the query parameters
|
|
210
|
+
when: 'The source API rejected the query parameters and explained why in its response body.',
|
|
198
211
|
recovery: 'Read the upstream reason in the error message — it names the offending parameter and ' +
|
|
199
212
|
'the accepted format. Correct that parameter and call again.',
|
|
200
213
|
},
|
|
214
|
+
{
|
|
215
|
+
reason: 'upstream_rejected_no_reason',
|
|
216
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
217
|
+
when: 'The source API rejected the query but its response body carried no usable explanation.',
|
|
218
|
+
recovery: 'The service named no offending parameter. Re-check the parameters you supplied — ' +
|
|
219
|
+
'time range format, magnitude bounds, and the lat/lon/radius trio are the usual causes — ' +
|
|
220
|
+
'or retry with the other source to see whether it accepts the same query.',
|
|
221
|
+
},
|
|
201
222
|
],
|
|
202
223
|
async handler(input, ctx) {
|
|
203
224
|
const latProvided = input.latitude != null;
|
|
@@ -234,12 +255,18 @@ export const earthquakeCount = tool('earthquake_count', {
|
|
|
234
255
|
...ctx.recoveryFor('source_timeout'),
|
|
235
256
|
});
|
|
236
257
|
}
|
|
237
|
-
// A 4xx means the upstream rejected the parameters, and its body says
|
|
238
|
-
// The framework leaves that body out of the message, so fold it in
|
|
239
|
-
// content[]-only clients see a bare status code.
|
|
258
|
+
// A 4xx means the upstream rejected the parameters, and its body usually says
|
|
259
|
+
// which one. The framework leaves that body out of the message, so fold it in
|
|
260
|
+
// here — otherwise content[]-only clients see a bare status code. A body with no
|
|
261
|
+
// usable reason still gets a contract reason of its own, so the raw upstream text
|
|
262
|
+
// (which echoes an internal hostname) never substitutes for an explanation.
|
|
240
263
|
const rejection = upstreamRejection(err);
|
|
241
264
|
if (rejection) {
|
|
242
|
-
|
|
265
|
+
const source = input.source.toUpperCase();
|
|
266
|
+
if (rejection.reason != null) {
|
|
267
|
+
throw ctx.fail('upstream_rejected', `${source} rejected the query: ${rejection.reason}`, { ...ctx.recoveryFor('upstream_rejected'), status: rejection.status }, { cause: err });
|
|
268
|
+
}
|
|
269
|
+
throw ctx.fail('upstream_rejected_no_reason', `${source} rejected the query (HTTP ${rejection.status}) — the service gave no reason.`, { ...ctx.recoveryFor('upstream_rejected_no_reason'), status: rejection.status }, { cause: err });
|
|
243
270
|
}
|
|
244
271
|
throw err;
|
|
245
272
|
}
|
|
@@ -267,6 +294,7 @@ export const earthquakeCount = tool('earthquake_count', {
|
|
|
267
294
|
...(isUsgs && params.minSignificance != null
|
|
268
295
|
? { min_significance: params.minSignificance }
|
|
269
296
|
: {}),
|
|
297
|
+
...(isUsgs && params.eventType != null ? { event_type: params.eventType } : {}),
|
|
270
298
|
source: input.source,
|
|
271
299
|
},
|
|
272
300
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earthquake-count.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-count.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EA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C,eAAe,EAAE;oBAC9C,CAAC,CAAC,EAAE,CAAC;gBACP,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB;SACF,CAAC,CAAC;QAEH,+EAA+E;QAC/E,6DAA6D;QAC7D,MAAM,cAAc,GAAG,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/D,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC;YAAE,GAAG,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;QAE9D,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,WAAW,EAAE,MAAM,CAAC,UAAU;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,aAAa,EAAE,MAAM,CAAC,YAAY;SACnC,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,KAAK,GAAa;YACtB,eAAe,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE;YAC5C,cAAc,MAAM,CAAC,KAAK,EAAE;YAC5B,oBAAoB,MAAM,CAAC,WAAW,IAAI,sBAAsB,EAAE;YAClE,sBAAsB,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,0DAA0D,CAAC,CAAC,CAAC,IAAI,EAAE;SACjH,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"earthquake-count.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-count.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,iBA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C,UAAU;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,aAAa,EAAE,MAAM,CAAC,YAAY;SACnC,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,KAAK,GAAa;YACtB,eAAe,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE;YAC5C,cAAc,MAAM,CAAC,KAAK,EAAE;YAC5B,oBAAoB,MAAM,CAAC,WAAW,IAAI,sBAAsB,EAAE;YAClE,sBAAsB,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,0DAA0D,CAAC,CAAC,CAAC,IAAI,EAAE;SACjH,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -36,13 +36,73 @@ export declare const earthquakeGetEvent: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
36
36
|
}>>;
|
|
37
37
|
source_catalog: z.ZodOptional<z.ZodString>;
|
|
38
38
|
auth: z.ZodOptional<z.ZodString>;
|
|
39
|
+
event_type: z.ZodOptional<z.ZodString>;
|
|
39
40
|
event_url: z.ZodOptional<z.ZodString>;
|
|
40
41
|
detail_url: z.ZodOptional<z.ZodString>;
|
|
41
42
|
}, z.core.$strip>;
|
|
43
|
+
detail: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
losspager: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
alert_level: z.ZodOptional<z.ZodString>;
|
|
46
|
+
report_url: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
shakemap: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
max_mmi: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
max_pga: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
max_pgv: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
intensity_map_url: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
dyfi: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
responses: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
max_cdi: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
map_url: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
moment_tensor: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
scalar_moment_nm: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
derived_depth_km: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
nodal_plane_1: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
strike: z.ZodNumber;
|
|
64
|
+
dip: z.ZodNumber;
|
|
65
|
+
rake: z.ZodNumber;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
nodal_plane_2: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
strike: z.ZodNumber;
|
|
69
|
+
dip: z.ZodNumber;
|
|
70
|
+
rake: z.ZodNumber;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
ground_failure: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
landslide_alert: z.ZodOptional<z.ZodString>;
|
|
75
|
+
liquefaction_alert: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
origin: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
azimuthal_gap_deg: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
num_stations_used: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
horizontal_error_km: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
depth_error_km: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
review_status: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
finite_fault: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
rupture_length_km: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
rupture_width_km: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
model_url: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
42
90
|
}, z.core.$strip>, readonly [{
|
|
43
91
|
readonly reason: "not_found";
|
|
44
92
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
45
93
|
readonly when: "No event matches the provided event_id.";
|
|
46
94
|
readonly recovery: string;
|
|
95
|
+
}, {
|
|
96
|
+
readonly reason: "source_unavailable";
|
|
97
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
98
|
+
readonly when: "The USGS event API returns a 5xx, serves HTML, or is unreachable.";
|
|
99
|
+
readonly retryable: true;
|
|
100
|
+
readonly recovery: string;
|
|
101
|
+
}, {
|
|
102
|
+
readonly reason: "source_timeout";
|
|
103
|
+
readonly code: JsonRpcErrorCode.Timeout;
|
|
104
|
+
readonly when: "The USGS event API did not answer before the request deadline.";
|
|
105
|
+
readonly retryable: true;
|
|
106
|
+
readonly recovery: string;
|
|
47
107
|
}], undefined>;
|
|
48
108
|
//# sourceMappingURL=earthquake-get-event.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earthquake-get-event.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-get-event.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"earthquake-get-event.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-get-event.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAS3E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2G7B,CAAC"}
|
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
import { EarthquakeEventSchema, formatEvent } from '../../../mcp-server/tools/schemas.js';
|
|
7
|
+
import { EarthquakeDetailSchema, EarthquakeEventSchema, formatEvent, formatEventDetail, } from '../../../mcp-server/tools/schemas.js';
|
|
8
8
|
import { getUsgsService } from '../../../services/usgs/usgs-service.js';
|
|
9
9
|
export const earthquakeGetEvent = tool('earthquake_get_event', {
|
|
10
10
|
title: 'Get Earthquake Event Detail',
|
|
11
11
|
description: 'Fetch detail for a specific earthquake by USGS event ID. ' +
|
|
12
|
-
'Returns
|
|
13
|
-
'
|
|
12
|
+
'Returns the same normalized event a search result carries, plus a projection of the ' +
|
|
13
|
+
'analysis products only the single-event response holds: PAGER impact alert and report link, ' +
|
|
14
|
+
'ShakeMap peak intensity and ground motion, DYFI felt-report totals, the moment-tensor focal ' +
|
|
15
|
+
'mechanism, landslide and liquefaction alerts, origin quality (azimuthal gap, station count, ' +
|
|
16
|
+
'location uncertainty), and finite-fault rupture dimensions. ' +
|
|
17
|
+
'Products are omitted when USGS produced none — a small automatic event typically has no ' +
|
|
18
|
+
'detail at all, while a large reviewed one has most of it. ' +
|
|
14
19
|
'Event IDs appear in the "id" field of earthquake_get_feed and earthquake_search results. ' +
|
|
15
20
|
'This tool is USGS-only — EMSC events have no per-event detail endpoint.',
|
|
16
21
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
@@ -22,6 +27,8 @@ export const earthquakeGetEvent = tool('earthquake_get_event', {
|
|
|
22
27
|
}),
|
|
23
28
|
output: z.object({
|
|
24
29
|
event: EarthquakeEventSchema.describe('Full earthquake event detail.'),
|
|
30
|
+
detail: EarthquakeDetailSchema.optional().describe('Analysis products USGS attached to this event. Absent when the event carries none — ' +
|
|
31
|
+
'that means no product was produced, not that impact was zero.'),
|
|
25
32
|
}),
|
|
26
33
|
errors: [
|
|
27
34
|
{
|
|
@@ -31,28 +38,60 @@ export const earthquakeGetEvent = tool('earthquake_get_event', {
|
|
|
31
38
|
recovery: 'Verify the event ID from a feed or search result. ' +
|
|
32
39
|
'IDs are network-specific strings like "us6000sznj" or "hv74966427".',
|
|
33
40
|
},
|
|
41
|
+
{
|
|
42
|
+
reason: 'source_unavailable',
|
|
43
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
44
|
+
when: 'The USGS event API returns a 5xx, serves HTML, or is unreachable.',
|
|
45
|
+
retryable: true,
|
|
46
|
+
recovery: 'Retry after a short delay. The same event also appears in earthquake_search and ' +
|
|
47
|
+
'earthquake_get_feed results, which carry the normalized record without the products.',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
reason: 'source_timeout',
|
|
51
|
+
code: JsonRpcErrorCode.Timeout,
|
|
52
|
+
when: 'The USGS event API did not answer before the request deadline.',
|
|
53
|
+
retryable: true,
|
|
54
|
+
recovery: 'Retry the same event ID — a single-event lookup carries no filters to reduce. If it ' +
|
|
55
|
+
'keeps timing out, read the event from an earthquake_search or earthquake_get_feed result.',
|
|
56
|
+
},
|
|
34
57
|
],
|
|
35
58
|
async handler(input, ctx) {
|
|
36
59
|
ctx.log.info('Fetching earthquake event detail', { event_id: input.event_id });
|
|
37
|
-
let
|
|
60
|
+
let result;
|
|
38
61
|
try {
|
|
39
|
-
|
|
62
|
+
result = await getUsgsService().getEvent(input.event_id, ctx);
|
|
40
63
|
}
|
|
41
64
|
catch (err) {
|
|
42
65
|
if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
|
|
43
66
|
throw ctx.fail('not_found', `No earthquake event found for ID "${input.event_id}". Verify the ID from a feed or search result.`, { ...ctx.recoveryFor('not_found') });
|
|
44
67
|
}
|
|
68
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.ServiceUnavailable) {
|
|
69
|
+
throw ctx.fail('source_unavailable', err.message, {
|
|
70
|
+
...ctx.recoveryFor('source_unavailable'),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// A timeout classifies as Timeout, not ServiceUnavailable — it needs its own
|
|
74
|
+
// branch or it bypasses the contract and reaches the caller with no recovery hint.
|
|
75
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.Timeout) {
|
|
76
|
+
throw ctx.fail('source_timeout', err.message, {
|
|
77
|
+
...ctx.recoveryFor('source_timeout'),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
45
80
|
throw err;
|
|
46
81
|
}
|
|
47
82
|
ctx.log.info('Event fetched', {
|
|
48
83
|
event_id: input.event_id,
|
|
49
|
-
magnitude: event.magnitude,
|
|
50
|
-
place: event.place,
|
|
84
|
+
magnitude: result.event.magnitude,
|
|
85
|
+
place: result.event.place,
|
|
86
|
+
products: result.detail != null ? Object.keys(result.detail) : [],
|
|
51
87
|
});
|
|
52
|
-
return {
|
|
88
|
+
return {
|
|
89
|
+
event: result.event,
|
|
90
|
+
...(result.detail ? { detail: result.detail } : {}),
|
|
91
|
+
};
|
|
53
92
|
},
|
|
54
93
|
format: (result) => {
|
|
55
|
-
const lines = formatEvent(result.event);
|
|
94
|
+
const lines = [...formatEvent(result.event), ...formatEventDetail(result.detail)];
|
|
56
95
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
57
96
|
},
|
|
58
97
|
});
|