@cyanheads/earthquake-mcp-server 0.2.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 +2 -2
- package/README.md +18 -9
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/earthquake-event.resource.d.ts +72 -4
- 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 +21 -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 +83 -5
- 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 +65 -3
- 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 +49 -10
- 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 +14 -4
- package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.js +17 -1
- package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.d.ts +27 -4
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.js +85 -7
- package/dist/mcp-server/tools/definitions/earthquake-search.tool.js.map +1 -1
- package/dist/mcp-server/tools/fdsn-error.d.ts +33 -0
- package/dist/mcp-server/tools/fdsn-error.d.ts.map +1 -0
- package/dist/mcp-server/tools/fdsn-error.js +84 -0
- package/dist/mcp-server/tools/fdsn-error.js.map +1 -0
- package/dist/mcp-server/tools/query-params.d.ts +8 -1
- package/dist/mcp-server/tools/query-params.d.ts.map +1 -1
- package/dist/mcp-server/tools/query-params.js +19 -1
- package/dist/mcp-server/tools/query-params.js.map +1 -1
- package/dist/mcp-server/tools/schemas.d.ts +65 -3
- package/dist/mcp-server/tools/schemas.d.ts.map +1 -1
- package/dist/mcp-server/tools/schemas.js +246 -12
- 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 +14 -3
- package/dist/services/emsc/emsc-service.js.map +1 -1
- package/dist/services/usgs/types.d.ts +125 -4
- 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 +115 -3
- package/dist/services/usgs/usgs-service.js.map +1 -1
- package/package.json +2 -2
- package/server.json +3 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pulls the actionable sentence out of an FDSN service's 4xx error body.
|
|
3
|
+
* `fetchWithTimeout` captures the upstream body into `error.data.body` but leaves the
|
|
4
|
+
* thrown message at a bare status code, so a content[]-only client sees "Status: 400"
|
|
5
|
+
* and nothing to act on. Shared by earthquake_search and earthquake_count, which catch
|
|
6
|
+
* the same upstream error shape.
|
|
7
|
+
* @module mcp-server/tools/fdsn-error
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Extract the reason lines from an FDSN error body, dropping the status stamp, the
|
|
11
|
+
* generic HTTP reason phrase, and the trailing boilerplate. USGS puts the useful
|
|
12
|
+
* sentence on the line after `Error 400: Bad Request`; EMSC puts it on the stamp line
|
|
13
|
+
* itself — both shapes reduce to the same result. Returns undefined when nothing
|
|
14
|
+
* beyond boilerplate survives.
|
|
15
|
+
*/
|
|
16
|
+
export declare function extractFdsnReason(body: string): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* An upstream rejection of the caller's parameters. `reason` is absent when the body
|
|
19
|
+
* carried nothing beyond boilerplate — the rejection is still real and still the
|
|
20
|
+
* caller's parameters, so it must not be reported as if the service explained itself.
|
|
21
|
+
*/
|
|
22
|
+
export interface UpstreamRejection {
|
|
23
|
+
reason?: string;
|
|
24
|
+
status: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Recognize an upstream rejection of the caller's parameters and read the reason out
|
|
28
|
+
* of the captured body. Returns undefined for every other failure (5xx, network,
|
|
29
|
+
* timeout, auth, rate limit, a 404 from a misconfigured base URL) so the caller
|
|
30
|
+
* rethrows those unchanged.
|
|
31
|
+
*/
|
|
32
|
+
export declare function upstreamRejection(err: unknown): UpstreamRejection | undefined;
|
|
33
|
+
//# sourceMappingURL=fdsn-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fdsn-error.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/fdsn-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAwBH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmBlE;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAgBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAU7E"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pulls the actionable sentence out of an FDSN service's 4xx error body.
|
|
3
|
+
* `fetchWithTimeout` captures the upstream body into `error.data.body` but leaves the
|
|
4
|
+
* thrown message at a bare status code, so a content[]-only client sees "Status: 400"
|
|
5
|
+
* and nothing to act on. Shared by earthquake_search and earthquake_count, which catch
|
|
6
|
+
* the same upstream error shape.
|
|
7
|
+
* @module mcp-server/tools/fdsn-error
|
|
8
|
+
*/
|
|
9
|
+
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
10
|
+
/**
|
|
11
|
+
* Boilerplate both FDSN implementations append after the reason — a usage URL, the
|
|
12
|
+
* echoed request (which carries an internal upstream hostname), a submission timestamp,
|
|
13
|
+
* and service versions. None of it helps the caller, so extraction stops here.
|
|
14
|
+
*/
|
|
15
|
+
const TRAILER_START = /^(usage details|request:|request submitted:|service version|fdsnws-event:)/i;
|
|
16
|
+
/** The `Error 400: ` stamp both services prefix onto the first line. */
|
|
17
|
+
const STATUS_STAMP = /^error\s+\d{3}:\s*/i;
|
|
18
|
+
/** Generic HTTP reason phrase USGS repeats after the stamp — no diagnostic value. */
|
|
19
|
+
const STATUS_PHRASE_ONLY = /^(bad request|unauthorized|forbidden|not found|unprocessable entity|internal server error)$/i;
|
|
20
|
+
/** Upper bound on the extracted reason — fits the full USGS sentence, stops short of a body dump. */
|
|
21
|
+
const MAX_REASON_CHARS = 300;
|
|
22
|
+
/** An HTML error page carries no reason line worth extracting. */
|
|
23
|
+
const HTML_BODY = /^\s*<(!doctype\s|html[\s>])/i;
|
|
24
|
+
/**
|
|
25
|
+
* Extract the reason lines from an FDSN error body, dropping the status stamp, the
|
|
26
|
+
* generic HTTP reason phrase, and the trailing boilerplate. USGS puts the useful
|
|
27
|
+
* sentence on the line after `Error 400: Bad Request`; EMSC puts it on the stamp line
|
|
28
|
+
* itself — both shapes reduce to the same result. Returns undefined when nothing
|
|
29
|
+
* beyond boilerplate survives.
|
|
30
|
+
*/
|
|
31
|
+
export function extractFdsnReason(body) {
|
|
32
|
+
if (HTML_BODY.test(body))
|
|
33
|
+
return;
|
|
34
|
+
const segments = [];
|
|
35
|
+
for (const raw of body.split('\n')) {
|
|
36
|
+
const line = raw.trim();
|
|
37
|
+
if (line === '')
|
|
38
|
+
continue;
|
|
39
|
+
if (TRAILER_START.test(line))
|
|
40
|
+
break;
|
|
41
|
+
const stripped = line.replace(STATUS_STAMP, '');
|
|
42
|
+
if (stripped === '' || STATUS_PHRASE_ONLY.test(stripped))
|
|
43
|
+
continue;
|
|
44
|
+
segments.push(stripped);
|
|
45
|
+
}
|
|
46
|
+
if (segments.length === 0)
|
|
47
|
+
return;
|
|
48
|
+
const reason = segments.join(' ');
|
|
49
|
+
return reason.length > MAX_REASON_CHARS
|
|
50
|
+
? `${reason.slice(0, MAX_REASON_CHARS).trimEnd()}…`
|
|
51
|
+
: reason;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Codes the framework assigns to the 4xx statuses that mean "the request itself was
|
|
55
|
+
* malformed": 400, 422, and the miscellaneous 4xx range. Deliberately narrower than
|
|
56
|
+
* the whole 400–499 band — 404 classifies as NotFound and, on the FDSN query path,
|
|
57
|
+
* means the configured base URL does not point at an FDSN service, which is an
|
|
58
|
+
* operator problem rather than a bad caller parameter. 401/403/409/429 are likewise
|
|
59
|
+
* their own failure classes and bubble unrelabeled.
|
|
60
|
+
*/
|
|
61
|
+
const REJECTION_CODES = new Set([
|
|
62
|
+
JsonRpcErrorCode.InvalidParams,
|
|
63
|
+
JsonRpcErrorCode.InvalidRequest,
|
|
64
|
+
JsonRpcErrorCode.ValidationError,
|
|
65
|
+
]);
|
|
66
|
+
/**
|
|
67
|
+
* Recognize an upstream rejection of the caller's parameters and read the reason out
|
|
68
|
+
* of the captured body. Returns undefined for every other failure (5xx, network,
|
|
69
|
+
* timeout, auth, rate limit, a 404 from a misconfigured base URL) so the caller
|
|
70
|
+
* rethrows those unchanged.
|
|
71
|
+
*/
|
|
72
|
+
export function upstreamRejection(err) {
|
|
73
|
+
if (!(err instanceof McpError))
|
|
74
|
+
return;
|
|
75
|
+
if (!REJECTION_CODES.has(err.code))
|
|
76
|
+
return;
|
|
77
|
+
const status = err.data?.status;
|
|
78
|
+
if (typeof status !== 'number' || status < 400 || status >= 500)
|
|
79
|
+
return;
|
|
80
|
+
const body = err.data?.body;
|
|
81
|
+
const reason = typeof body === 'string' ? extractFdsnReason(body) : undefined;
|
|
82
|
+
return reason != null ? { status, reason } : { status };
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=fdsn-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fdsn-error.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/fdsn-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,aAAa,GAAG,6EAA6E,CAAC;AAEpG,wEAAwE;AACxE,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAE3C,qFAAqF;AACrF,MAAM,kBAAkB,GACtB,8FAA8F,CAAC;AAEjG,qGAAqG;AACrG,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,kEAAkE;AAClE,MAAM,SAAS,GAAG,8BAA8B,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO;IAEjC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,KAAK,EAAE;YAAE,SAAS;QAC1B,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,MAAM;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,QAAQ,KAAK,EAAE,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC;Y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1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Shared tool-input → FDSN query-param builder for earthquake_search and earthquake_count.
|
|
3
3
|
* Resolves the documented 30-day default time window server-side so USGS and EMSC behave identically
|
|
4
|
-
* (EMSC applies no upstream default and would otherwise query its entire catalog)
|
|
4
|
+
* (EMSC applies no upstream default and would otherwise query its entire catalog), and names the
|
|
5
|
+
* USGS-only filters an EMSC query drops so both tools can report them.
|
|
5
6
|
* @module mcp-server/tools/query-params
|
|
6
7
|
*/
|
|
7
8
|
import type { EarthquakeQueryParams } from '../../services/usgs/types.js';
|
|
@@ -9,6 +10,7 @@ import type { EarthquakeQueryParams } from '../../services/usgs/types.js';
|
|
|
9
10
|
export interface EarthquakeFilterInput {
|
|
10
11
|
alert_level?: 'green' | 'yellow' | 'orange' | 'red' | undefined;
|
|
11
12
|
end_time?: string | undefined;
|
|
13
|
+
event_type?: string | undefined;
|
|
12
14
|
latitude?: number | undefined;
|
|
13
15
|
longitude?: number | undefined;
|
|
14
16
|
max_depth_km?: number | undefined;
|
|
@@ -20,6 +22,11 @@ export interface EarthquakeFilterInput {
|
|
|
20
22
|
radius_km?: number | undefined;
|
|
21
23
|
start_time?: string | undefined;
|
|
22
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Name the USGS-only filters the caller supplied that will not reach the upstream
|
|
27
|
+
* query. Empty for a USGS query, where every filter is sent.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ignoredUsgsFilters(input: EarthquakeFilterInput, source: 'usgs' | 'emsc'): string[];
|
|
23
30
|
/**
|
|
24
31
|
* Resolve the default start time: 30 days before end_time, or before now when
|
|
25
32
|
* end_time is also omitted. Returns undefined for an unparseable end_time —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/query-params.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../src/mcp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and earthquake_count.
|
|
3
3
|
* Resolves the documented 30-day default time window server-side so USGS and EMSC behave identically
|
|
4
|
-
* (EMSC applies no upstream default and would otherwise query its entire catalog)
|
|
4
|
+
* (EMSC applies no upstream default and would otherwise query its entire catalog), and names the
|
|
5
|
+
* USGS-only filters an EMSC query drops so both tools can report them.
|
|
5
6
|
* @module mcp-server/tools/query-params
|
|
6
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Filters only the USGS FDSN API implements — EMSC has no equivalent parameter.
|
|
10
|
+
* `event_type` is here because EMSC's endpoint rejects an `eventtype` parameter
|
|
11
|
+
* outright with HTTP 400, so forwarding it would fail the query rather than
|
|
12
|
+
* merely go unapplied.
|
|
13
|
+
*/
|
|
14
|
+
const USGS_ONLY_FILTERS = ['alert_level', 'event_type', 'min_felt', 'min_significance'];
|
|
15
|
+
/**
|
|
16
|
+
* Name the USGS-only filters the caller supplied that will not reach the upstream
|
|
17
|
+
* query. Empty for a USGS query, where every filter is sent.
|
|
18
|
+
*/
|
|
19
|
+
export function ignoredUsgsFilters(input, source) {
|
|
20
|
+
if (source !== 'emsc')
|
|
21
|
+
return [];
|
|
22
|
+
return USGS_ONLY_FILTERS.filter((name) => input[name] != null);
|
|
23
|
+
}
|
|
7
24
|
/** Documented default time window applied when start_time is omitted. */
|
|
8
25
|
const DEFAULT_WINDOW_DAYS = 30;
|
|
9
26
|
const DAY_MS = 86_400_000;
|
|
@@ -37,6 +54,7 @@ export function buildQueryParams(input) {
|
|
|
37
54
|
...(input.alert_level != null ? { alertLevel: input.alert_level } : {}),
|
|
38
55
|
...(input.min_felt != null ? { minFelt: input.min_felt } : {}),
|
|
39
56
|
...(input.min_significance != null ? { minSignificance: input.min_significance } : {}),
|
|
57
|
+
...(input.event_type != null ? { eventType: input.event_type } : {}),
|
|
40
58
|
};
|
|
41
59
|
}
|
|
42
60
|
//# sourceMappingURL=query-params.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-params.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/query-params.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"query-params.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/query-params.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,CAAU,CAAC;AAEjG;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA4B,EAC5B,MAAuB;IAEvB,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,EAAE,CAAC;IACjC,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;AACjE,CAAC;AAED,yEAAyE;AACzE,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,MAAM,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IAChE,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO;IAC3C,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,mBAAmB,GAAG,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;AACjF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,IAAI,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvE,OAAO;QACL,GAAG,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,SA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UAAU,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,GAAG,CAAC,KAAK,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtF,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC"}
|
|
@@ -24,18 +24,80 @@ export declare const EarthquakeEventSchema: z.ZodObject<{
|
|
|
24
24
|
orange: "orange";
|
|
25
25
|
red: "red";
|
|
26
26
|
}>>;
|
|
27
|
-
tsunami: z.ZodNumber
|
|
27
|
+
tsunami: z.ZodNullable<z.ZodNumber>;
|
|
28
28
|
significance: z.ZodNullable<z.ZodNumber>;
|
|
29
|
-
status: z.ZodEnum<{
|
|
29
|
+
status: z.ZodNullable<z.ZodEnum<{
|
|
30
30
|
automatic: "automatic";
|
|
31
31
|
reviewed: "reviewed";
|
|
32
32
|
deleted: "deleted";
|
|
33
|
-
}
|
|
33
|
+
}>>;
|
|
34
|
+
source_catalog: z.ZodOptional<z.ZodString>;
|
|
35
|
+
auth: z.ZodOptional<z.ZodString>;
|
|
36
|
+
event_type: z.ZodOptional<z.ZodString>;
|
|
34
37
|
event_url: z.ZodOptional<z.ZodString>;
|
|
35
38
|
detail_url: z.ZodOptional<z.ZodString>;
|
|
36
39
|
}, z.core.$strip>;
|
|
37
40
|
/** Inferred from EarthquakeEventSchema — the output type for a normalized earthquake event. */
|
|
38
41
|
export type EarthquakeEventOutput = z.infer<typeof EarthquakeEventSchema>;
|
|
42
|
+
/**
|
|
43
|
+
* Curated projection of the analysis products USGS attaches to a single-event
|
|
44
|
+
* response. Every group is optional and omitted when the event carries no such
|
|
45
|
+
* product — absence means "not produced for this event", never zero.
|
|
46
|
+
*/
|
|
47
|
+
export declare const EarthquakeDetailSchema: z.ZodObject<{
|
|
48
|
+
losspager: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
alert_level: z.ZodOptional<z.ZodString>;
|
|
50
|
+
report_url: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
shakemap: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
max_mmi: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
max_pga: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
max_pgv: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
intensity_map_url: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
dyfi: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
responses: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
max_cdi: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
map_url: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
moment_tensor: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
scalar_moment_nm: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
derived_depth_km: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
nodal_plane_1: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
strike: z.ZodNumber;
|
|
68
|
+
dip: z.ZodNumber;
|
|
69
|
+
rake: z.ZodNumber;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
nodal_plane_2: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
strike: z.ZodNumber;
|
|
73
|
+
dip: z.ZodNumber;
|
|
74
|
+
rake: z.ZodNumber;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
ground_failure: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
landslide_alert: z.ZodOptional<z.ZodString>;
|
|
79
|
+
liquefaction_alert: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
origin: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
azimuthal_gap_deg: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
num_stations_used: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
horizontal_error_km: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
depth_error_km: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
review_status: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
finite_fault: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
rupture_length_km: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
rupture_width_km: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
model_url: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
/** Inferred from EarthquakeDetailSchema — the product projection for a single event. */
|
|
95
|
+
export type EarthquakeDetailOutput = z.infer<typeof EarthquakeDetailSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* Render the product projection as markdown lines. Renders every schema field for
|
|
98
|
+
* format-parity, and says so plainly when a group is absent rather than implying zero.
|
|
99
|
+
*/
|
|
100
|
+
export declare function formatEventDetail(detail: EarthquakeDetailOutput | undefined): string[];
|
|
39
101
|
/** Format a single earthquake event as markdown lines. Renders all schema fields for format-parity. */
|
|
40
102
|
export declare function formatEvent(event: EarthquakeEventOutput): string[];
|
|
41
103
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,yFAAyF;AACzF,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,yFAAyF;AACzF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2FhC,CAAC;AAEH,+FAA+F;AAC/F,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAa1E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyHjC,CAAC;AAEH,wFAAwF;AACxF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAO5E;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,sBAAsB,GAAG,SAAS,GAAG,MAAM,EAAE,CAiFtF;AAED,uGAAuG;AACvG,wBAAgB,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,EAAE,CAuDlE"}
|
|
@@ -26,58 +26,292 @@ export const EarthquakeEventSchema = z.object({
|
|
|
26
26
|
felt: z
|
|
27
27
|
.number()
|
|
28
28
|
.nullable()
|
|
29
|
-
.describe('Number of DYFI (Did You Feel It?) responses. Null
|
|
29
|
+
.describe('Number of DYFI (Did You Feel It?) responses. Null when USGS has received no reports for the event, and always null for EMSC, which publishes no DYFI field — a null is not evidence the event went unfelt.'),
|
|
30
30
|
cdi: z
|
|
31
31
|
.number()
|
|
32
32
|
.nullable()
|
|
33
|
-
.describe('Maximum reported intensity (Community Decimal Intensity, 0–12 scale). USGS
|
|
33
|
+
.describe('Maximum reported intensity (Community Decimal Intensity, 0–12 scale), derived from DYFI responses. Null when USGS computed no DYFI intensity, and always null for EMSC, which publishes no such field.'),
|
|
34
34
|
mmi: z
|
|
35
35
|
.number()
|
|
36
36
|
.nullable()
|
|
37
|
-
.describe('Maximum ShakeMap instrumental intensity (Modified Mercalli, 0–12 scale). USGS
|
|
37
|
+
.describe('Maximum ShakeMap instrumental intensity (Modified Mercalli, 0–12 scale). Null when USGS produced no ShakeMap for the event, and always null for EMSC, which publishes no such field.'),
|
|
38
38
|
alert: z
|
|
39
39
|
.enum(['green', 'yellow', 'orange', 'red'])
|
|
40
40
|
.nullable()
|
|
41
|
-
.describe('PAGER estimated impact alert level. Null
|
|
41
|
+
.describe('PAGER estimated impact alert level. Null when USGS ran no PAGER assessment, and always null for EMSC, which publishes no such field.'),
|
|
42
42
|
tsunami: z
|
|
43
43
|
.number()
|
|
44
|
-
.
|
|
44
|
+
.nullable()
|
|
45
|
+
.describe('USGS tsunami flag: 1 for large events in oceanic regions, 0 otherwise. It is not a warning — USGS states the flag does not indicate whether a tsunami did or will exist; check NOAA (tsunami.gov) for actual alert status. Null when the source publishes no such flag, as EMSC does not.'),
|
|
45
46
|
significance: z
|
|
46
47
|
.number()
|
|
47
48
|
.nullable()
|
|
48
|
-
.describe('USGS significance score (0–2000+). Combines magnitude, felt reports, PAGER. USGS
|
|
49
|
+
.describe('USGS significance score (0–2000+). Combines magnitude, felt reports, PAGER. Null when USGS computed no score, and always null for EMSC, which publishes no such field.'),
|
|
49
50
|
status: z
|
|
50
51
|
.enum(['automatic', 'reviewed', 'deleted'])
|
|
51
|
-
.
|
|
52
|
+
.nullable()
|
|
53
|
+
.describe('Human-review state: "automatic" (posted by automatic processing, not yet verified by a person), "reviewed" (examined by an analyst), or "deleted". Null when the source publishes no review status — EMSC does not, so treat an EMSC solution as unverified and subject to revision rather than final.'),
|
|
54
|
+
source_catalog: z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Upstream catalog this solution came from, e.g. "EMSC-RTS" (EMSC real-time seismicity, revised as analysis continues). Absent for USGS, which publishes no catalog identifier on event records.'),
|
|
58
|
+
auth: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('Code of the agency or network the source names as authoritative for this solution, e.g. "NEIC", "BMKG", "NDI" from EMSC or "us", "ci", "ak" from USGS. Absent when the source reports none.'),
|
|
62
|
+
event_type: z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Upstream event classification. USGS spells it out — "earthquake", "quarry blast", ' +
|
|
66
|
+
'"explosion", "ice quake" — while EMSC publishes a two-letter evtype code, "ke" for a ' +
|
|
67
|
+
'known earthquake and "ue" for an unknown event. Not every record in either catalog is a ' +
|
|
68
|
+
'tectonic earthquake. Absent when the source publishes no classification.'),
|
|
52
69
|
event_url: z.string().optional().describe('USGS event page URL. Present for USGS events only.'),
|
|
53
70
|
detail_url: z
|
|
54
71
|
.string()
|
|
55
72
|
.optional()
|
|
56
73
|
.describe('URL to fetch the full GeoJSON detail record. Present in USGS list responses.'),
|
|
57
74
|
});
|
|
75
|
+
/** One nodal plane of a moment-tensor solution. */
|
|
76
|
+
const NodalPlaneSchema = z.object({
|
|
77
|
+
strike: z.number().describe('Fault plane strike in degrees clockwise from north (0–360).'),
|
|
78
|
+
dip: z.number().describe('Fault plane dip in degrees from horizontal (0–90).'),
|
|
79
|
+
rake: z
|
|
80
|
+
.number()
|
|
81
|
+
.describe('Slip direction in degrees (-180 to 180). Near 90 is reverse faulting, near -90 normal, near 0 or 180 strike-slip.'),
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Curated projection of the analysis products USGS attaches to a single-event
|
|
85
|
+
* response. Every group is optional and omitted when the event carries no such
|
|
86
|
+
* product — absence means "not produced for this event", never zero.
|
|
87
|
+
*/
|
|
88
|
+
export const EarthquakeDetailSchema = z.object({
|
|
89
|
+
losspager: z
|
|
90
|
+
.object({
|
|
91
|
+
alert_level: z
|
|
92
|
+
.string()
|
|
93
|
+
.optional()
|
|
94
|
+
.describe('PAGER impact alert level — "green", "yellow", "orange", or "red".'),
|
|
95
|
+
report_url: z
|
|
96
|
+
.string()
|
|
97
|
+
.optional()
|
|
98
|
+
.describe('URL of the PAGER one-page PDF summary of estimated impact.'),
|
|
99
|
+
})
|
|
100
|
+
.optional()
|
|
101
|
+
.describe('PAGER impact assessment. Estimated fatality and economic-loss brackets live in a separate ' +
|
|
102
|
+
'content file and are not part of this response — fetch report_url for them.'),
|
|
103
|
+
shakemap: z
|
|
104
|
+
.object({
|
|
105
|
+
max_mmi: z
|
|
106
|
+
.number()
|
|
107
|
+
.optional()
|
|
108
|
+
.describe('Maximum modeled shaking intensity across the ShakeMap grid (Modified Mercalli).'),
|
|
109
|
+
max_pga: z
|
|
110
|
+
.number()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe('Maximum modeled peak ground acceleration, in percent of g.'),
|
|
113
|
+
max_pgv: z.number().optional().describe('Maximum modeled peak ground velocity, in cm/s.'),
|
|
114
|
+
intensity_map_url: z
|
|
115
|
+
.string()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe('URL of the rendered ShakeMap intensity map image.'),
|
|
118
|
+
})
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('ShakeMap modeled ground-motion summary. Absent when no ShakeMap was produced.'),
|
|
121
|
+
dyfi: z
|
|
122
|
+
.object({
|
|
123
|
+
responses: z
|
|
124
|
+
.number()
|
|
125
|
+
.optional()
|
|
126
|
+
.describe('Number of "Did You Feel It?" reports the public submitted.'),
|
|
127
|
+
max_cdi: z
|
|
128
|
+
.number()
|
|
129
|
+
.optional()
|
|
130
|
+
.describe('Maximum Community Decimal Intensity derived from those reports (0–12 scale).'),
|
|
131
|
+
map_url: z.string().optional().describe('URL of the rendered DYFI intensity map image.'),
|
|
132
|
+
})
|
|
133
|
+
.optional()
|
|
134
|
+
.describe('Felt-report summary. Absent when no DYFI product exists for the event.'),
|
|
135
|
+
moment_tensor: z
|
|
136
|
+
.object({
|
|
137
|
+
scalar_moment_nm: z
|
|
138
|
+
.number()
|
|
139
|
+
.optional()
|
|
140
|
+
.describe('Scalar seismic moment in newton-metres — the physical size of the rupture.'),
|
|
141
|
+
derived_depth_km: z
|
|
142
|
+
.number()
|
|
143
|
+
.optional()
|
|
144
|
+
.describe('Centroid depth in kilometers derived from the moment-tensor inversion.'),
|
|
145
|
+
nodal_plane_1: NodalPlaneSchema.optional().describe('First nodal plane of the focal mechanism. Either plane can be the true fault.'),
|
|
146
|
+
nodal_plane_2: NodalPlaneSchema.optional().describe('Second nodal plane — the auxiliary solution, indistinguishable from the first on seismic data alone.'),
|
|
147
|
+
})
|
|
148
|
+
.optional()
|
|
149
|
+
.describe('Focal-mechanism solution. Absent for events with no moment-tensor inversion.'),
|
|
150
|
+
ground_failure: z
|
|
151
|
+
.object({
|
|
152
|
+
landslide_alert: z
|
|
153
|
+
.string()
|
|
154
|
+
.optional()
|
|
155
|
+
.describe('Landslide hazard alert level — "green", "yellow", "orange", or "red".'),
|
|
156
|
+
liquefaction_alert: z
|
|
157
|
+
.string()
|
|
158
|
+
.optional()
|
|
159
|
+
.describe('Liquefaction hazard alert level — "green", "yellow", "orange", or "red".'),
|
|
160
|
+
})
|
|
161
|
+
.optional()
|
|
162
|
+
.describe('Secondary-hazard alert levels. Absent when no ground-failure model was run.'),
|
|
163
|
+
origin: z
|
|
164
|
+
.object({
|
|
165
|
+
azimuthal_gap_deg: z
|
|
166
|
+
.number()
|
|
167
|
+
.optional()
|
|
168
|
+
.describe('Largest azimuthal gap between stations, in degrees. Gaps above ~180 make the location poorly constrained.'),
|
|
169
|
+
num_stations_used: z
|
|
170
|
+
.number()
|
|
171
|
+
.optional()
|
|
172
|
+
.describe('Number of seismic stations used in the location solution.'),
|
|
173
|
+
horizontal_error_km: z
|
|
174
|
+
.number()
|
|
175
|
+
.optional()
|
|
176
|
+
.describe('Horizontal location uncertainty in kilometers.'),
|
|
177
|
+
depth_error_km: z.number().optional().describe('Depth uncertainty in kilometers.'),
|
|
178
|
+
review_status: z
|
|
179
|
+
.string()
|
|
180
|
+
.optional()
|
|
181
|
+
.describe('Review state of the origin solution as the contributing network published it.'),
|
|
182
|
+
})
|
|
183
|
+
.optional()
|
|
184
|
+
.describe('Location-quality metrics for the preferred origin.'),
|
|
185
|
+
finite_fault: z
|
|
186
|
+
.object({
|
|
187
|
+
rupture_length_km: z
|
|
188
|
+
.number()
|
|
189
|
+
.optional()
|
|
190
|
+
.describe('Modeled rupture length along strike, in kilometers.'),
|
|
191
|
+
rupture_width_km: z
|
|
192
|
+
.number()
|
|
193
|
+
.optional()
|
|
194
|
+
.describe('Modeled rupture width down dip, in kilometers.'),
|
|
195
|
+
model_url: z.string().optional().describe('URL of the finite-fault rupture model file.'),
|
|
196
|
+
})
|
|
197
|
+
.optional()
|
|
198
|
+
.describe('Finite-fault rupture model. Produced only for large events.'),
|
|
199
|
+
});
|
|
200
|
+
/** Render a projected field with its unit, or say the product omitted it. Never implies zero. */
|
|
201
|
+
function detailValue(value, unit = '') {
|
|
202
|
+
return value == null ? 'not published' : `${value}${unit}`;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Render the product projection as markdown lines. Renders every schema field for
|
|
206
|
+
* format-parity, and says so plainly when a group is absent rather than implying zero.
|
|
207
|
+
*/
|
|
208
|
+
export function formatEventDetail(detail) {
|
|
209
|
+
const lines = ['', '### Analysis products'];
|
|
210
|
+
if (detail == null || Object.keys(detail).length === 0) {
|
|
211
|
+
lines.push('_No analysis products on this event — USGS publishes them for larger or reviewed events._');
|
|
212
|
+
return lines;
|
|
213
|
+
}
|
|
214
|
+
const pager = detail.losspager;
|
|
215
|
+
if (pager) {
|
|
216
|
+
lines.push(`**PAGER:** Alert level: ${detailValue(pager.alert_level)}` +
|
|
217
|
+
(pager.report_url ? ` | Report: ${pager.report_url}` : ''));
|
|
218
|
+
}
|
|
219
|
+
const shakemap = detail.shakemap;
|
|
220
|
+
if (shakemap) {
|
|
221
|
+
lines.push(`**ShakeMap:** Max MMI: ${detailValue(shakemap.max_mmi)} | ` +
|
|
222
|
+
`Max PGA: ${detailValue(shakemap.max_pga, ' %g')} | ` +
|
|
223
|
+
`Max PGV: ${detailValue(shakemap.max_pgv, ' cm/s')}` +
|
|
224
|
+
(shakemap.intensity_map_url ? ` | Intensity map: ${shakemap.intensity_map_url}` : ''));
|
|
225
|
+
}
|
|
226
|
+
const dyfi = detail.dyfi;
|
|
227
|
+
if (dyfi) {
|
|
228
|
+
lines.push(`**DYFI:** Responses: ${detailValue(dyfi.responses)} | ` +
|
|
229
|
+
`Max CDI: ${detailValue(dyfi.max_cdi)}` +
|
|
230
|
+
(dyfi.map_url ? ` | Map: ${dyfi.map_url}` : ''));
|
|
231
|
+
}
|
|
232
|
+
const tensor = detail.moment_tensor;
|
|
233
|
+
if (tensor) {
|
|
234
|
+
const planes = [tensor.nodal_plane_1, tensor.nodal_plane_2]
|
|
235
|
+
.map((plane, index) => plane
|
|
236
|
+
? `Nodal plane ${index + 1}: strike ${plane.strike}°, dip ${plane.dip}°, rake ${plane.rake}°`
|
|
237
|
+
: undefined)
|
|
238
|
+
.filter((text) => text != null);
|
|
239
|
+
lines.push(`**Moment tensor:** Scalar moment: ${detailValue(tensor.scalar_moment_nm, ' N·m')} | ` +
|
|
240
|
+
`Derived depth: ${detailValue(tensor.derived_depth_km, ' km')}` +
|
|
241
|
+
(planes.length > 0 ? ` | ${planes.join(' | ')}` : ''));
|
|
242
|
+
}
|
|
243
|
+
const failure = detail.ground_failure;
|
|
244
|
+
if (failure) {
|
|
245
|
+
lines.push(`**Ground failure:** Landslide alert: ${detailValue(failure.landslide_alert)} | ` +
|
|
246
|
+
`Liquefaction alert: ${detailValue(failure.liquefaction_alert)}`);
|
|
247
|
+
}
|
|
248
|
+
const origin = detail.origin;
|
|
249
|
+
if (origin) {
|
|
250
|
+
lines.push(`**Origin quality:** Azimuthal gap: ${detailValue(origin.azimuthal_gap_deg, '°')} | ` +
|
|
251
|
+
`Stations used: ${detailValue(origin.num_stations_used)} | ` +
|
|
252
|
+
`Horizontal error: ${detailValue(origin.horizontal_error_km, ' km')} | ` +
|
|
253
|
+
`Depth error: ${detailValue(origin.depth_error_km, ' km')} | ` +
|
|
254
|
+
`Review status: ${detailValue(origin.review_status)}`);
|
|
255
|
+
}
|
|
256
|
+
const fault = detail.finite_fault;
|
|
257
|
+
if (fault) {
|
|
258
|
+
lines.push(`**Finite fault:** Rupture length: ${detailValue(fault.rupture_length_km, ' km')} | ` +
|
|
259
|
+
`Rupture width: ${detailValue(fault.rupture_width_km, ' km')}` +
|
|
260
|
+
(fault.model_url ? ` | Model: ${fault.model_url}` : ''));
|
|
261
|
+
}
|
|
262
|
+
return lines;
|
|
263
|
+
}
|
|
58
264
|
/** Format a single earthquake event as markdown lines. Renders all schema fields for format-parity. */
|
|
59
265
|
export function formatEvent(event) {
|
|
60
266
|
const lines = [];
|
|
61
267
|
lines.push(`## ${event.title}`);
|
|
62
268
|
lines.push(`**ID:** ${event.id} | **Magnitude:** ${event.magnitude !== null ? event.magnitude : 'unknown'} (${event.magnitude_type}) | **Depth:** ${event.depth_km !== null ? `${event.depth_km} km` : 'unknown'}`);
|
|
63
269
|
lines.push(`**Place:** ${event.place}`);
|
|
64
|
-
|
|
270
|
+
// USGS titles carry the classification for non-earthquakes, EMSC titles never do.
|
|
271
|
+
// Rendering anything other than a plain "earthquake" keeps quarry blasts and
|
|
272
|
+
// explosions from reading as seismicity in the text-only surface.
|
|
273
|
+
if (event.event_type != null && event.event_type !== 'earthquake') {
|
|
274
|
+
lines.push(`**Event type:** ${event.event_type}`);
|
|
275
|
+
}
|
|
276
|
+
lines.push(`**Time:** ${event.time} | **Updated:** ${event.updated}`);
|
|
65
277
|
lines.push(`**Location:** ${event.latitude.toFixed(4)}°, ${event.longitude.toFixed(4)}°`);
|
|
66
|
-
//
|
|
278
|
+
// Provenance — review state plus whatever catalog/agency the source named.
|
|
279
|
+
// A null status is rendered, never dropped: it means the source publishes none.
|
|
280
|
+
const provenance = [`Status: ${event.status ?? 'not published by source'}`];
|
|
281
|
+
if (event.source_catalog)
|
|
282
|
+
provenance.push(`Catalog: ${event.source_catalog}`);
|
|
283
|
+
if (event.auth)
|
|
284
|
+
provenance.push(`Agency: ${event.auth}`);
|
|
285
|
+
lines.push(`**Provenance:** ${provenance.join(' | ')}`);
|
|
67
286
|
lines.push(`**PAGER Alert:** ${event.alert !== null ? event.alert.toUpperCase() : 'Not computed'}`);
|
|
68
287
|
// Render tsunami as its raw value so the linter's format-parity sentinel check passes
|
|
69
|
-
lines.push(`**Tsunami
|
|
288
|
+
lines.push(`**Tsunami flag:** ${event.tsunami === null
|
|
289
|
+
? 'not published by source'
|
|
290
|
+
: `${event.tsunami}${event.tsunami !== 0 ? ' ⚠️ Large oceanic event — check tsunami.gov for actual alert status' : ''}`}`);
|
|
291
|
+
// Every impact field reaches content[]: present ones with their value, absent
|
|
292
|
+
// ones collected into one "Not reported" segment so a fully sparse event reads
|
|
293
|
+
// as a single line rather than four.
|
|
70
294
|
const impactParts = [];
|
|
295
|
+
const notReported = [];
|
|
71
296
|
if (event.felt !== null)
|
|
72
297
|
impactParts.push(`Felt by ${event.felt} (DYFI)`);
|
|
298
|
+
else
|
|
299
|
+
notReported.push('DYFI felt reports');
|
|
73
300
|
if (event.mmi !== null)
|
|
74
301
|
impactParts.push(`ShakeMap MMI: ${event.mmi}`);
|
|
302
|
+
else
|
|
303
|
+
notReported.push('ShakeMap MMI');
|
|
75
304
|
if (event.cdi !== null)
|
|
76
305
|
impactParts.push(`CDI: ${event.cdi}`);
|
|
306
|
+
else
|
|
307
|
+
notReported.push('CDI');
|
|
77
308
|
if (event.significance !== null)
|
|
78
309
|
impactParts.push(`Significance: ${event.significance}`);
|
|
79
|
-
|
|
80
|
-
|
|
310
|
+
else
|
|
311
|
+
notReported.push('significance');
|
|
312
|
+
if (notReported.length > 0)
|
|
313
|
+
impactParts.push(`Not reported: ${notReported.join(', ')}`);
|
|
314
|
+
lines.push(`**Impact:** ${impactParts.join(' | ')}`);
|
|
81
315
|
if (event.event_url)
|
|
82
316
|
lines.push(`**USGS page:** ${event.event_url}`);
|
|
83
317
|
if (event.detail_url)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,yFAAyF;AACzF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACzD,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CAAC,oFAAoF,CAAC;IACjG,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,+GAA+G,CAChH;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC9E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IAC/E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IACvE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACzE,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yJAAyJ,CAC1J;IACH,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SAC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