@cyanheads/earthquake-mcp-server 0.1.15 → 0.2.0

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.
Files changed (41) hide show
  1. package/CLAUDE.md +31 -23
  2. package/Dockerfile +13 -7
  3. package/README.md +9 -4
  4. package/dist/mcp-server/resources/definitions/earthquake-event.resource.d.ts +1 -1
  5. package/dist/mcp-server/resources/definitions/earthquake-feed.resource.d.ts +1 -1
  6. package/dist/mcp-server/resources/definitions/earthquake-feed.resource.d.ts.map +1 -1
  7. package/dist/mcp-server/resources/definitions/earthquake-feed.resource.js +8 -2
  8. package/dist/mcp-server/resources/definitions/earthquake-feed.resource.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/earthquake-count.tool.d.ts +20 -1
  10. package/dist/mcp-server/tools/definitions/earthquake-count.tool.d.ts.map +1 -1
  11. package/dist/mcp-server/tools/definitions/earthquake-count.tool.js +79 -16
  12. package/dist/mcp-server/tools/definitions/earthquake-count.tool.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/earthquake-get-event.tool.d.ts +1 -1
  14. package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.d.ts +6 -1
  15. package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.js +93 -13
  17. package/dist/mcp-server/tools/definitions/earthquake-get-feed.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/earthquake-search.tool.d.ts +24 -6
  19. package/dist/mcp-server/tools/definitions/earthquake-search.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/earthquake-search.tool.js +130 -42
  21. package/dist/mcp-server/tools/definitions/earthquake-search.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/query-params.d.ts +34 -0
  23. package/dist/mcp-server/tools/query-params.d.ts.map +1 -0
  24. package/dist/mcp-server/tools/query-params.js +42 -0
  25. package/dist/mcp-server/tools/query-params.js.map +1 -0
  26. package/dist/mcp-server/tools/schemas.d.ts +1 -1
  27. package/dist/mcp-server/tools/schemas.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/schemas.js +5 -2
  29. package/dist/mcp-server/tools/schemas.js.map +1 -1
  30. package/dist/services/emsc/emsc-service.d.ts +6 -1
  31. package/dist/services/emsc/emsc-service.d.ts.map +1 -1
  32. package/dist/services/emsc/emsc-service.js +43 -11
  33. package/dist/services/emsc/emsc-service.js.map +1 -1
  34. package/dist/services/usgs/types.d.ts +3 -1
  35. package/dist/services/usgs/types.d.ts.map +1 -1
  36. package/dist/services/usgs/usgs-service.d.ts +6 -1
  37. package/dist/services/usgs/usgs-service.d.ts.map +1 -1
  38. package/dist/services/usgs/usgs-service.js +39 -33
  39. package/dist/services/usgs/usgs-service.js.map +1 -1
  40. package/package.json +10 -9
  41. package/server.json +3 -3
package/CLAUDE.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  **Server:** earthquake-mcp-server
4
4
  **Package:** `@cyanheads/earthquake-mcp-server`
5
- **Version:** 0.1.15
6
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.9`
5
+ **Version:** 0.2.0
6
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.16`
7
7
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
8
8
  **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
9
9
  **Zod:** ^4.4.3
@@ -136,6 +136,8 @@ export function getServerConfig() {
136
136
 
137
137
  `parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`MY_API_KEY`) not the path (`apiKey`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
138
138
 
139
+ For env booleans use `z.stringbool()`, never `z.coerce.boolean()` — `Boolean("false")` is `true`, so a coerced flag can't be disabled through the environment. `z.stringbool()` parses `true/false/1/0/yes/no/on/off` and rejects anything else, so `=false` actually disables.
140
+
139
141
  ---
140
142
 
141
143
  ## Context
@@ -145,16 +147,18 @@ Handlers receive a unified `ctx` object. Key properties:
145
147
  | Property | Description |
146
148
  |:---------|:------------|
147
149
  | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
148
- | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
149
- | `ctx.elicit` | Ask user for structured input. **Check for presence first:** `if (ctx.elicit) { ... }` |
150
+ | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
151
+ | `ctx.elicit` | Ask user for structured input — form call `(message, schema)` or `.url(message, url)` for an external link. **Check for presence first:** `if (ctx.elicit) { ... }` |
150
152
  | `ctx.sample` | Request LLM completion from the client. **Check for presence first:** `if (ctx.sample) { ... }` |
153
+ | `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
154
+ | `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
151
155
  | `ctx.signal` | `AbortSignal` for cancellation. |
152
156
  | `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
153
157
  | `ctx.fail` | Throw a typed error checked against the `errors[]` contract — `ctx.fail('reason', message, { recovery? })`. |
154
158
  | `ctx.notifyPromptListChanged` | Notify clients that the prompt list changed (call after dynamic prompt registration). |
155
159
  | `ctx.notifyToolListChanged` | Notify clients that the tool list changed (call after dynamic tool registration). |
156
160
  | `ctx.requestId` | Unique request ID. |
157
- | `ctx.tenantId` | Tenant ID from JWT or `'default'` for stdio. |
161
+ | `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
158
162
 
159
163
  ---
160
164
 
@@ -162,7 +166,7 @@ Handlers receive a unified `ctx` object. Key properties:
162
166
 
163
167
  Handlers throw — the framework catches, classifies, and formats.
164
168
 
165
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required descriptive metadata for the agent's next move ( 5 words, lint-validated); for the wire `data.recovery.hint` (mirrored into `content[]` text), pass explicitly at the throw site when dynamic context matters: `ctx.fail('reason', msg, { recovery: { hint: '...' } })`. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
169
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
166
170
 
167
171
  ```ts
168
172
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -174,7 +178,7 @@ errors: [
174
178
  ],
175
179
  async handler(input, ctx) {
176
180
  const item = await db.find(input.id);
177
- if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
181
+ if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
178
182
  return item;
179
183
  }
180
184
  ```
@@ -237,7 +241,7 @@ src/
237
241
 
238
242
  ## Skills
239
243
 
240
- Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
244
+ Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
241
245
 
242
246
  **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
243
247
 
@@ -254,30 +258,29 @@ Available skills:
254
258
  | `add-service` | Scaffold a new service integration |
255
259
  | `add-test` | Scaffold test file for a tool, resource, or service |
256
260
  | `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
257
- | `tool-defs-analysis` | Read-only audit of definition language: voice, leaks, defaults, recovery hints, examples |
261
+ | `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
258
262
  | `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
259
263
  | `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
260
- | `devcheck` | Lint, format, typecheck, audit |
261
264
  | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
262
- | `maintenance` | Investigate changelogs, adopt upstream changes, and sync skills after `bun update --latest` |
263
- | `git-wrapup` | Version-bump, changelog, commit, and tag workflow |
264
- | `release-and-publish` | Ship a release: verification gate, push commits+tags, publish to npm / MCP Registry / GHCR / `.mcpb` bundle on GitHub Releases |
265
+ | `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
266
+ | `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
267
+ | `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
265
268
  | `api-auth` | Auth modes, scopes, JWT/OAuth |
266
269
  | `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
267
270
  | `api-config` | AppConfig, parseConfig, env vars |
268
271
  | `api-context` | Context interface, logger, state, progress |
269
272
  | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
270
- | `api-linter` | Definition lint rules reference (`format-parity`, `schema-*`, `server-json-*`, …) |
273
+ | `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
274
+ | `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
271
275
  | `api-services` | LLM, Speech, Graph services |
272
276
  | `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
273
277
  | `api-testing` | createMockContext, test patterns |
274
278
  | `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
275
- | `api-mirror` | MirrorService — persistent local SQLite mirror of a bulk upstream dataset (Tier 3 opt-in) |
276
279
  | `api-workers` | Cloudflare Workers runtime |
277
- | `techniques` | Catalog of reusable response/data-shaping patterns — overflow handling, payload shaping, retrieval when a payload is too large or awkwardly shaped |
280
+ | `techniques` | Catalog of response/data-shaping techniques — overflow handling, payload shaping, retrieval patterns |
278
281
  | `orchestrations` | Chain task skills into a gated multi-phase pipeline — build-out, QA-fix, update-ship — when you can spawn sub-agents |
279
- | `report-issue-framework` | File bug/feature request against @cyanheads/mcp-ts-core |
280
- | `report-issue-local` | File bug/feature request against this server's repo |
282
+ | `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
283
+ | `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
281
284
 
282
285
  **Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
283
286
 
@@ -292,11 +295,14 @@ When you complete a skill's checklist, check the boxes and add a completion time
292
295
  | `bun run build` | Compile TypeScript |
293
296
  | `bun run rebuild` | Clean + build |
294
297
  | `bun run clean` | Remove build artifacts |
295
- | `bun run devcheck` | Lint + format + typecheck + security + packaging alignment |
298
+ | `bun run devcheck` | Lint + format + typecheck + security + packaging alignment + changelog sync |
296
299
  | `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
297
300
  | `bun run tree` | Generate directory structure doc |
298
- | `bun run format` | Auto-fix formatting |
299
- | `bun run test` | Run tests |
301
+ | `bun run format` | Auto-fix formatting (safe fixes only) |
302
+ | `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
303
+ | `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
304
+ | `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
305
+ | `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
300
306
  | `bun run lint:mcp` | Validate MCP definitions against spec |
301
307
  | `bun run lint:packaging` | Validate env var alignment between `manifest.json` and `server.json` (skipped cleanly when `manifest.json` is absent) |
302
308
  | `bun run list-skills` | List skills in `skills/` with name + description |
@@ -342,14 +348,16 @@ Each per-version file opens with YAML frontmatter:
342
348
  ---
343
349
  summary: "One-line headline, ≤350 chars" # required — powers the rollup index
344
350
  breaking: false # optional — true flags breaking changes
345
- security: false # optional — true flags security fixes
351
+ security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
346
352
  ---
347
353
 
348
354
  # 0.1.0 — YYYY-MM-DD
349
355
  ...
350
356
  ```
351
357
 
352
- `breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
358
+ `breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`). When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
359
+
360
+ `agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
353
361
 
354
362
  **Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
355
363
 
package/Dockerfile CHANGED
@@ -4,15 +4,19 @@
4
4
  # This stage installs all dependencies (including dev), builds the TypeScript
5
5
  # source code into JavaScript, and prepares the production assets.
6
6
  # ==============================================================================
7
- FROM oven/bun:1.3 AS build
7
+ FROM oven/bun:1.3.14 AS build
8
8
 
9
9
  WORKDIR /usr/src/app
10
10
 
11
11
  # Copy dependency manifests for optimized layer caching
12
12
  COPY package.json bun.lock ./
13
13
 
14
- # Install all dependencies (including dev dependencies for building)
15
- RUN bun install --frozen-lockfile
14
+ # Install all dependencies (including dev dependencies for building).
15
+ # The BuildKit cache mount persists Bun's global package cache across builds.
16
+ # --ignore-scripts keeps a dependency's native postinstall (node-gyp under Bun)
17
+ # from aborting the build; tsc needs type declarations, not compiled bindings.
18
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
19
+ bun install --frozen-lockfile --ignore-scripts
16
20
 
17
21
  # Copy the rest of the source code
18
22
  COPY . .
@@ -29,7 +33,7 @@ RUN bun scripts/build.ts
29
33
  # application. It uses a slim base image and only includes production
30
34
  # dependencies and build artifacts.
31
35
  # ==============================================================================
32
- FROM oven/bun:1.3-slim AS production
36
+ FROM oven/bun:1.3.14-slim AS production
33
37
 
34
38
  WORKDIR /usr/src/app
35
39
 
@@ -50,14 +54,16 @@ COPY package.json bun.lock ./
50
54
 
51
55
  # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
52
56
  # that are not needed in the final production image.
53
- RUN bun install --production --frozen-lockfile --ignore-scripts
57
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
58
+ bun install --production --frozen-lockfile --ignore-scripts
54
59
 
55
60
  # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
56
61
  # These are not bundled by default to keep the base image lean. Enable at build time
57
62
  # with: docker build --build-arg OTEL_ENABLED=true
58
63
  ARG OTEL_ENABLED=true
59
- RUN if [ "$OTEL_ENABLED" = "true" ]; then \
60
- bun add @hono/otel \
64
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
65
+ if [ "$OTEL_ENABLED" = "true" ]; then \
66
+ bun add --omit=dev --ignore-scripts @hono/otel \
61
67
  @opentelemetry/instrumentation-http \
62
68
  @opentelemetry/exporter-metrics-otlp-http \
63
69
  @opentelemetry/exporter-trace-otlp-http \
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.1.15-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/earthquake-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/earthquake-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/earthquake-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.2.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/earthquake-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/earthquake-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/earthquake-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -46,6 +46,8 @@ Fetch a USGS pre-computed real-time earthquake feed by magnitude tier and time w
46
46
  - Five magnitude tiers: `all` (microseisms), `1.0`, `2.5`, `4.5`, and `significant` (USGS-curated by magnitude, felt reports, and PAGER impact)
47
47
  - Four time windows: `hour`, `day`, `week`, `month`
48
48
  - Returns event list with counts and the source feed URL
49
+ - Paged with an opaque `cursor`: `limit` bounds a page (default 100, max 1000), `totalCount` reports the whole feed, and `nextCursor` retrieves the rest — the broad tiers run past 10,000 events for `month`
50
+ - The cursor is opaque because these feeds have no upstream paging parameter and USGS regenerates them about once a minute; a numeric offset across two calls would skip or repeat events
49
51
  - Best for real-time "what's happening now" queries; use `earthquake_search` for historical or filtered queries
50
52
 
51
53
  ---
@@ -59,7 +61,9 @@ Search earthquakes by time range, magnitude, depth, location radius, PAGER alert
59
61
  - USGS-specific filters: PAGER alert level (`green`/`yellow`/`orange`/`red`), DYFI felt reports count, significance score
60
62
  - Location-based queries: provide `latitude`, `longitude`, and `radius_km` together
61
63
  - Sort by time (newest first) or magnitude (largest first), ascending or descending
62
- - Results capped at 20,000 events per query; use `earthquake_count` first to gauge result size
64
+ - One call returns at most 20,000 events; page beyond that with `offset`, forwarded straight to the upstream FDSN `offset` parameter on both sources
65
+ - `offset` counts from 1, matching both upstream APIs — a capped result carries `totalCount` and the `nextOffset` to pass on the following call
66
+ - Use `earthquake_count` first to gauge result size
63
67
  - USGS-specific filters are silently ignored when `source=emsc`
64
68
 
65
69
  ---
@@ -70,7 +74,8 @@ Count earthquakes matching filters without fetching full records.
70
74
 
71
75
  - Lightweight alternative to `earthquake_search` for statistical queries ("how many M5+ events in 2025?")
72
76
  - Same filter surface as `earthquake_search`: time, magnitude, depth, location radius, PAGER, DYFI, significance
73
- - Returns `exceeds_limit` flag when count exceeds 20,000 — signals that a full search would be truncated
77
+ - Returns `exceeds_limit` flag when count exceeds 20,000 — signals a full search needs paging
78
+ - Echoes the effective query back as `queryEcho`, including the resolved time window — omitting `start_time` counts only the last 30 days
74
79
  - USGS returns the `max_allowed` cap (20,000); EMSC count endpoint does not expose this field (`max_allowed` will be null)
75
80
 
76
81
  ---
@@ -87,7 +92,7 @@ Fetch complete detail for a specific earthquake by USGS event ID.
87
92
 
88
93
  | Type | URI pattern | Description |
89
94
  |:---|:---|:---|
90
- | Resource | `earthquake://feed/{magnitude_tier}/{time_window}` | USGS real-time earthquake feed as injectable context |
95
+ | 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 |
91
96
  | Resource | `earthquake://event/{event_id}` | Full USGS earthquake event detail by ID as injectable context |
92
97
 
93
98
  ## Features
@@ -9,7 +9,7 @@ export declare const earthquakeEventResource: import("@cyanheads/mcp-ts-core").R
9
9
  event: z.ZodObject<{
10
10
  id: z.ZodString;
11
11
  title: z.ZodString;
12
- magnitude: z.ZodNumber;
12
+ magnitude: z.ZodNullable<z.ZodNumber>;
13
13
  magnitude_type: z.ZodString;
14
14
  time: z.ZodString;
15
15
  updated: z.ZodString;
@@ -12,7 +12,7 @@ export declare const earthquakeFeedResource: import("@cyanheads/mcp-ts-core").Re
12
12
  events: z.ZodArray<z.ZodObject<{
13
13
  id: z.ZodString;
14
14
  title: z.ZodString;
15
- magnitude: z.ZodNumber;
15
+ magnitude: z.ZodNullable<z.ZodNumber>;
16
16
  time: z.ZodString;
17
17
  place: z.ZodString;
18
18
  latitude: z.ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"earthquake-feed.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-feed.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiBrD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;6BAyFjC,CAAC"}
1
+ {"version":3,"file":"earthquake-feed.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-feed.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiBrD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;6BAiGjC,CAAC"}
@@ -18,7 +18,10 @@ export const earthquakeFeedResource = resource('earthquake://feed/{magnitude_tie
18
18
  title: 'USGS Earthquake Feed',
19
19
  description: 'Direct access to a USGS real-time earthquake feed as injectable context. ' +
20
20
  'magnitude_tier: all | 1.0 | 2.5 | 4.5 | significant. ' +
21
- 'time_window: hour | day | week | month.',
21
+ 'time_window: hour | day | week | month. ' +
22
+ 'Returns the whole feed in one read — the URI carries no paging, so the broad combinations ' +
23
+ '("all" or "1.0" with "week" or "month") can run to thousands of events. ' +
24
+ 'Use the earthquake_get_feed tool for those: it serves the same data a bounded page at a time.',
22
25
  mimeType: 'application/json',
23
26
  params: z.object({
24
27
  magnitude_tier: z.string().describe('Magnitude tier: all, 1.0, 2.5, 4.5, or significant.'),
@@ -32,7 +35,10 @@ export const earthquakeFeedResource = resource('earthquake://feed/{magnitude_tie
32
35
  .object({
33
36
  id: z.string().describe('USGS event identifier.'),
34
37
  title: z.string().describe('Human-readable event summary.'),
35
- magnitude: z.number().describe('Preferred magnitude value.'),
38
+ magnitude: z
39
+ .number()
40
+ .nullable()
41
+ .describe('Preferred magnitude value. Null when no magnitude was computed for the event.'),
36
42
  time: z.string().describe('ISO 8601 UTC origin time.'),
37
43
  place: z.string().describe('Nearest named location.'),
38
44
  latitude: z.number().describe('Epicenter latitude in decimal degrees.'),
@@ -1 +1 @@
1
- {"version":3,"file":"earthquake-feed.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-feed.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAU,CAAC;AACzE,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAKhE,SAAS,MAAM,CAAC,CAAS;IACvB,OAAQ,WAAiC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AACD,SAAS,QAAQ,CAAC,CAAS;IACzB,OAAQ,aAAmC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,kDAAkD,EAAE;IACjG,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,2EAA2E;QAC3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AC,IAAI;gBACZ,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,SAAS,EAAE,CAAC,CAAC,SAAS;gBACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;aACrB,CAAC,CAAC;YACH,QAAQ,EAAE,MAAM,CAAC,OAAO;SACzB,CAAC;IACJ,CAAC;IAED,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACX,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CACtC,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC7B,GAAG,EAAE,qBAAqB,IAAI,IAAI,MAAM,EAAE;YAC1C,IAAI,EAAE,QAAQ,IAAI,iBAAiB,MAAM,GAAG;YAC5C,WAAW,EAAE,wBAAwB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,uBAAuB,MAAM,GAAG;YAC7G,QAAQ,EAAE,kBAAkB;SAC7B,CAAC,CAAC,CACJ;KACF,CAAC;CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"earthquake-feed.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/earthquake-feed.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAU,CAAC;AACzE,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAKhE,SAAS,MAAM,CA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ceUnavailable;
45
45
  readonly when: "Selected source API returns non-2xx or times out.";
46
46
  readonly recovery: "Try the other source (usgs or emsc) or retry after a short delay.";
47
- }], undefined>;
47
+ }], {
48
+ readonly queryEcho: z.ZodOptional<z.ZodObject<{
49
+ start_time: z.ZodOptional<z.ZodString>;
50
+ end_time: z.ZodOptional<z.ZodString>;
51
+ min_magnitude: z.ZodOptional<z.ZodNumber>;
52
+ max_magnitude: z.ZodOptional<z.ZodNumber>;
53
+ latitude: z.ZodOptional<z.ZodNumber>;
54
+ longitude: z.ZodOptional<z.ZodNumber>;
55
+ radius_km: z.ZodOptional<z.ZodNumber>;
56
+ min_depth_km: z.ZodOptional<z.ZodNumber>;
57
+ max_depth_km: z.ZodOptional<z.ZodNumber>;
58
+ alert_level: z.ZodOptional<z.ZodString>;
59
+ min_felt: z.ZodOptional<z.ZodNumber>;
60
+ min_significance: z.ZodOptional<z.ZodNumber>;
61
+ source: z.ZodEnum<{
62
+ usgs: "usgs";
63
+ emsc: "emsc";
64
+ }>;
65
+ }, z.core.$strip>>;
66
+ }>;
48
67
  //# sourceMappingURL=earthquake-count.tool.d.ts.map
@@ -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;AAK3E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiN1B,CAAC"}
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;AAM3E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2R1B,CAAC"}
@@ -4,6 +4,7 @@
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 { buildQueryParams } from '../../../mcp-server/tools/query-params.js';
7
8
  import { getEmscService } from '../../../services/emsc/emsc-service.js';
8
9
  import { getUsgsService } from '../../../services/usgs/usgs-service.js';
9
10
  export const earthquakeCount = tool('earthquake_count', {
@@ -11,6 +12,8 @@ export const earthquakeCount = tool('earthquake_count', {
11
12
  description: 'Count earthquakes matching filters without fetching full records. ' +
12
13
  'Use for statistical queries ("how many M5+ earthquakes in 2025?") or to gauge result size ' +
13
14
  'before calling earthquake_search. ' +
15
+ 'Omitting start_time counts only the last 30 days, so pass an explicit range for any ' +
16
+ 'period-specific question; queryEcho reports the window and filters the count actually covers. ' +
14
17
  'When exceeds_limit is true, the count exceeds 20,000 and a full search would be truncated — ' +
15
18
  'narrow filters before fetching. ' +
16
19
  'USGS returns the max_allowed cap (20,000); EMSC count endpoint does not return this field ' +
@@ -22,7 +25,8 @@ export const earthquakeCount = tool('earthquake_count', {
22
25
  .string()
23
26
  .optional()
24
27
  .describe('Start of time range as ISO 8601 (e.g. "2026-01-01" or "2026-05-23T00:00:00"). ' +
25
- 'Defaults to 30 days before end_time if omitted.'),
28
+ 'Defaults to 30 days before end_time (or before the current time) if omitted' +
29
+ 'applied server-side so USGS and EMSC honor the same window.'),
26
30
  end_time: z
27
31
  .string()
28
32
  .optional()
@@ -100,6 +104,56 @@ export const earthquakeCount = tool('earthquake_count', {
100
104
  'For EMSC, evaluated against the known 20000 limit since max_allowed is not returned. ' +
101
105
  'Narrow filters to retrieve all matching events.'),
102
106
  }),
107
+ // A count is a single number with no context of its own — the window and filters
108
+ // it covers have to travel with it, including the server-resolved 30-day default.
109
+ // Populated via ctx.enrich(...) so it reaches structuredContent and content[].
110
+ enrichment: {
111
+ queryEcho: z
112
+ .object({
113
+ start_time: z
114
+ .string()
115
+ .optional()
116
+ .describe('Effective query start time sent upstream — server-resolved to a 30-day window when omitted from input.'),
117
+ end_time: z
118
+ .string()
119
+ .optional()
120
+ .describe('Effective query end time. Absent when omitted from input — the upstream defaults to the current time.'),
121
+ min_magnitude: z.number().optional().describe('Minimum magnitude filter sent upstream.'),
122
+ max_magnitude: z.number().optional().describe('Maximum magnitude filter sent upstream.'),
123
+ latitude: z.number().optional().describe('Radius-search latitude sent upstream.'),
124
+ longitude: z.number().optional().describe('Radius-search longitude sent upstream.'),
125
+ radius_km: z
126
+ .number()
127
+ .optional()
128
+ .describe('Search radius in km sent upstream (converted to degrees for EMSC).'),
129
+ min_depth_km: z.number().optional().describe('Minimum depth filter sent upstream.'),
130
+ max_depth_km: z.number().optional().describe('Maximum depth filter sent upstream.'),
131
+ alert_level: z
132
+ .string()
133
+ .optional()
134
+ .describe('PAGER alert filter sent upstream. Absent for EMSC — not supported there.'),
135
+ min_felt: z
136
+ .number()
137
+ .optional()
138
+ .describe('DYFI felt-report filter sent upstream. Absent for EMSC — not supported there.'),
139
+ min_significance: z
140
+ .number()
141
+ .optional()
142
+ .describe('Significance filter sent upstream. Absent for EMSC — not supported there.'),
143
+ source: z.enum(['usgs', 'emsc']).describe('Data source queried.'),
144
+ })
145
+ .optional()
146
+ .describe('Echo of the effective parameters the count covers, including server-resolved defaults. ' +
147
+ 'Read start_time and end_time to know which window the count spans — a filter absent ' +
148
+ 'here was not sent upstream.'),
149
+ },
150
+ enrichmentTrailer: {
151
+ queryEcho: {
152
+ render: (q) => `**Query echo:** ${Object.entries(q ?? {})
153
+ .map(([key, value]) => `${key}=${String(value)}`)
154
+ .join(' · ')}`,
155
+ },
156
+ },
103
157
  errors: [
104
158
  {
105
159
  reason: 'invalid_radius',
@@ -127,21 +181,8 @@ export const earthquakeCount = tool('earthquake_count', {
127
181
  start_time: input.start_time,
128
182
  min_magnitude: input.min_magnitude,
129
183
  });
130
- // Use conditional spreads to satisfy exactOptionalPropertyTypes
131
- const params = {
132
- ...(input.start_time != null ? { startTime: input.start_time } : {}),
133
- ...(input.end_time != null ? { endTime: input.end_time } : {}),
134
- ...(input.min_magnitude != null ? { minMagnitude: input.min_magnitude } : {}),
135
- ...(input.max_magnitude != null ? { maxMagnitude: input.max_magnitude } : {}),
136
- ...(input.latitude != null ? { latitude: input.latitude } : {}),
137
- ...(input.longitude != null ? { longitude: input.longitude } : {}),
138
- ...(input.radius_km != null ? { radiusKm: input.radius_km } : {}),
139
- ...(input.min_depth_km != null ? { minDepthKm: input.min_depth_km } : {}),
140
- ...(input.max_depth_km != null ? { maxDepthKm: input.max_depth_km } : {}),
141
- ...(input.alert_level != null ? { alertLevel: input.alert_level } : {}),
142
- ...(input.min_felt != null ? { minFelt: input.min_felt } : {}),
143
- ...(input.min_significance != null ? { minSignificance: input.min_significance } : {}),
144
- };
184
+ // Shared builder applies the documented 30-day start-time default server-side
185
+ const params = buildQueryParams(input);
145
186
  let result;
146
187
  try {
147
188
  result =
@@ -162,6 +203,28 @@ export const earthquakeCount = tool('earthquake_count', {
162
203
  count: result.count,
163
204
  exceeds_limit: result.exceedsLimit,
164
205
  });
206
+ // Echo the effective upstream parameters — USGS-only filters are excluded for
207
+ // EMSC because buildFdsnQuery does not send them.
208
+ const isUsgs = input.source !== 'emsc';
209
+ ctx.enrich({
210
+ queryEcho: {
211
+ ...(params.startTime != null ? { start_time: params.startTime } : {}),
212
+ ...(params.endTime != null ? { end_time: params.endTime } : {}),
213
+ ...(params.minMagnitude != null ? { min_magnitude: params.minMagnitude } : {}),
214
+ ...(params.maxMagnitude != null ? { max_magnitude: params.maxMagnitude } : {}),
215
+ ...(params.latitude != null ? { latitude: params.latitude } : {}),
216
+ ...(params.longitude != null ? { longitude: params.longitude } : {}),
217
+ ...(params.radiusKm != null ? { radius_km: params.radiusKm } : {}),
218
+ ...(params.minDepthKm != null ? { min_depth_km: params.minDepthKm } : {}),
219
+ ...(params.maxDepthKm != null ? { max_depth_km: params.maxDepthKm } : {}),
220
+ ...(isUsgs && params.alertLevel != null ? { alert_level: params.alertLevel } : {}),
221
+ ...(isUsgs && params.minFelt != null ? { min_felt: params.minFelt } : {}),
222
+ ...(isUsgs && params.minSignificance != null
223
+ ? { min_significance: params.minSignificance }
224
+ : {}),
225
+ source: input.source,
226
+ },
227
+ });
165
228
  return {
166
229
  count: result.count,
167
230
  max_allowed: result.maxAllowed,
@@ -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,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE;IACtD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,oEAAoE;QACpE,4FAA4F;QAC5F,oCAAoC;QACpC,8FAA8F;QAC9F,kCAAkC;QAClC,4FAA4F;QAC5F,8BAA8B;QAC9B,+FAA+F;IACjG,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,gFAAgF;YAC9E,iDAAiD,CACpD;QACH,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,E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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,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAoB,MAAM,iCAAiC,CAAC;AAEnF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE;IACtD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,oEAAoE;QACpE,4FAA4F;QAC5F,oCAAoC;QACpC,sFAAsF;QACtF,gGAAgG;QAChG,8FAA8F;QAC9F,kCAAkC;QAClC,4FAA4F;QAC5F,8BAA8B;QAC9B,+FAA+F;IACjG,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,gFAAgF;YAC9E,gFAAgF;YAChF,6DAA6D,CAChE;QACH,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,qEAAqE,CAAC;QAClF,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC,CAAC;aACP,GAAG,CAAC,EAAE,CAAC;aACP,QAAQ,EAAE;aACV,QAAQ,CACP,6CAA6C;YAC3C,m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E,KAAK,CAAC,MAAM;aACrB;SACF,CAAC,CAAC;QAEH,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"}
@@ -10,7 +10,7 @@ export declare const earthquakeGetEvent: import("@cyanheads/mcp-ts-core").ToolDe
10
10
  event: z.ZodObject<{
11
11
  id: z.ZodString;
12
12
  title: z.ZodString;
13
- magnitude: z.ZodNumber;
13
+ magnitude: z.ZodNullable<z.ZodNumber>;
14
14
  magnitude_type: z.ZodString;
15
15
  time: z.ZodString;
16
16
  updated: z.ZodString;
@@ -18,13 +18,15 @@ export declare const earthquakeGetFeed: import("@cyanheads/mcp-ts-core").ToolDef
18
18
  week: "week";
19
19
  month: "month";
20
20
  }>>;
21
+ limit: z.ZodOptional<z.ZodNumber>;
22
+ cursor: z.ZodOptional<z.ZodString>;
21
23
  }, z.core.$strip>, z.ZodObject<{
22
24
  count: z.ZodNumber;
23
25
  generated_at: z.ZodString;
24
26
  events: z.ZodArray<z.ZodObject<{
25
27
  id: z.ZodString;
26
28
  title: z.ZodString;
27
- magnitude: z.ZodNumber;
29
+ magnitude: z.ZodNullable<z.ZodNumber>;
28
30
  magnitude_type: z.ZodString;
29
31
  time: z.ZodString;
30
32
  updated: z.ZodString;
@@ -58,6 +60,9 @@ export declare const earthquakeGetFeed: import("@cyanheads/mcp-ts-core").ToolDef
58
60
  readonly when: "USGS feed endpoint returns non-2xx or times out.";
59
61
  readonly recovery: "Try a smaller time_window, or use earthquake_search as a fallback.";
60
62
  }], {
63
+ readonly totalCount: z.ZodOptional<z.ZodNumber>;
64
+ readonly truncated: z.ZodOptional<z.ZodBoolean>;
65
+ readonly nextCursor: z.ZodOptional<z.ZodString>;
61
66
  readonly notice: z.ZodOptional<z.ZodString>;
62
67
  }>;
63
68
  //# sourceMappingURL=earthquake-get-feed.tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"earthquake-get-feed.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-get-feed.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiH5B,CAAC"}
1
+ {"version":3,"file":"earthquake-get-feed.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/earthquake-get-feed.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAU3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6M5B,CAAC"}