@cyanheads/gdelt-mcp-server 0.1.4 → 0.1.6
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 +18 -38
- package/README.md +24 -1
- package/changelog/0.1.x/0.1.5.md +29 -0
- package/changelog/0.1.x/0.1.6.md +33 -0
- package/changelog/template.md +9 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-coverage-breakdown.tool.d.ts +9 -8
- package/dist/mcp-server/tools/definitions/get-coverage-breakdown.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-coverage-breakdown.tool.js +17 -14
- package/dist/mcp-server/tools/definitions/get-coverage-breakdown.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-coverage-timeline.tool.d.ts +10 -8
- package/dist/mcp-server/tools/definitions/get-coverage-timeline.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-coverage-timeline.tool.js +16 -9
- package/dist/mcp-server/tools/definitions/get-coverage-timeline.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tone-distribution.tool.d.ts +5 -3
- package/dist/mcp-server/tools/definitions/get-tone-distribution.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tone-distribution.tool.js +11 -7
- package/dist/mcp-server/tools/definitions/get-tone-distribution.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tv-clips.tool.d.ts +5 -4
- package/dist/mcp-server/tools/definitions/get-tv-clips.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tv-clips.tool.js +11 -11
- package/dist/mcp-server/tools/definitions/get-tv-clips.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tv-context.tool.d.ts +5 -4
- package/dist/mcp-server/tools/definitions/get-tv-context.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tv-context.tool.js +9 -9
- package/dist/mcp-server/tools/definitions/get-tv-context.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tv-trending.tool.d.ts +4 -3
- package/dist/mcp-server/tools/definitions/get-tv-trending.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-tv-trending.tool.js +10 -9
- package/dist/mcp-server/tools/definitions/get-tv-trending.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/list-tv-stations.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/list-tv-stations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-articles.tool.d.ts +6 -5
- package/dist/mcp-server/tools/definitions/search-articles.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-articles.tool.js +14 -17
- package/dist/mcp-server/tools/definitions/search-articles.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-tv.tool.d.ts +5 -3
- package/dist/mcp-server/tools/definitions/search-tv.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-tv.tool.js +10 -7
- package/dist/mcp-server/tools/definitions/search-tv.tool.js.map +1 -1
- package/dist/services/gdelt/gdelt-tv-service.js +1 -1
- package/dist/services/gdelt/gdelt-tv-service.js.map +1 -1
- package/package.json +9 -4
- package/server.json +9 -3
package/CLAUDE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** gdelt-mcp-server
|
|
4
|
-
**Version:** 0.1.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.
|
|
4
|
+
**Version:** 0.1.6
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.16`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
@@ -50,7 +50,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
50
50
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
51
51
|
- **Check `ctx.elicit` / `ctx.sample`** for presence before calling.
|
|
52
52
|
- **Secrets in env vars only** — never hardcoded.
|
|
53
|
-
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed
|
|
53
|
+
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
@@ -128,6 +128,10 @@ export const reviewCode = prompt('review_code', {
|
|
|
128
128
|
});
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
### Server instructions
|
|
132
|
+
|
|
133
|
+
`createApp({ instructions })` — optional server-level orientation, sent to clients on every `initialize` as session-level context. Use it for deployment guidance (connection aliases, regional notes, scope hints) instead of repeating the same context across tool descriptions. Client adoption is uneven, but there's no downside when set.
|
|
134
|
+
|
|
131
135
|
### Server config
|
|
132
136
|
|
|
133
137
|
```ts
|
|
@@ -178,6 +182,8 @@ Handlers throw — the framework catches, classifies, and formats.
|
|
|
178
182
|
**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.
|
|
179
183
|
|
|
180
184
|
```ts
|
|
185
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
186
|
+
|
|
181
187
|
errors: [
|
|
182
188
|
{ reason: 'no_match', code: JsonRpcErrorCode.NotFound,
|
|
183
189
|
when: 'No item matched the query',
|
|
@@ -265,9 +271,13 @@ Available skills:
|
|
|
265
271
|
| `add-service` | Scaffold a new service integration |
|
|
266
272
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
267
273
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
274
|
+
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
268
275
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
276
|
+
| `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
|
|
269
277
|
| `devcheck` | Lint, format, typecheck, audit |
|
|
270
278
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
279
|
+
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
280
|
+
| `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
271
281
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
272
282
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
273
283
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
@@ -296,7 +306,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
296
306
|
| `bun run rebuild` | Clean + build |
|
|
297
307
|
| `bun run clean` | Remove build artifacts |
|
|
298
308
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
299
|
-
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, re-audit
|
|
309
|
+
| `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. |
|
|
300
310
|
| `bun run tree` | Generate directory structure doc |
|
|
301
311
|
| `bun run format` | Auto-fix formatting |
|
|
302
312
|
| `bun run test` | Run tests |
|
|
@@ -314,40 +324,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
314
324
|
|
|
315
325
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
316
326
|
|
|
317
|
-
**README install badges
|
|
318
|
-
|
|
319
|
-
| Client | Mechanism |
|
|
320
|
-
|:-------|:----------|
|
|
321
|
-
| Claude Desktop | Browser downloads the `.mcpb` from the latest GitHub Release; OS file handler routes it to Claude Desktop, which opens the install dialog. No deep-link URL scheme yet — this is the canonical path. |
|
|
322
|
-
| Cursor | Official `https://cursor.com/en/install-mcp` endpoint with base64 JSON config. |
|
|
323
|
-
| VS Code / Insiders | Official `vscode:mcp/install?...` deep link, wrapped in `https://vscode.dev/redirect?url=` so GitHub-rendered markdown doesn't strip the non-HTTP scheme. |
|
|
324
|
-
| Claude Code / Codex | CLI only (`claude mcp add` / `codex mcp add`); no URL scheme. |
|
|
325
|
-
|
|
326
|
-
```markdown
|
|
327
|
-
[](https://github.com/<OWNER>/<REPO>/releases/latest/download/<PACKAGE_NAME>.mcpb)
|
|
328
|
-
[](https://cursor.com/en/install-mcp?name=<PACKAGE_NAME>&config=<BASE64_CONFIG>)
|
|
329
|
-
[](https://vscode.dev/redirect?url=vscode:mcp/install?<URLENCODED_JSON>)
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
Both install links route through HTTPS endpoints (`cursor.com/en/install-mcp` and `vscode.dev/redirect`) — GitHub-rendered markdown strips non-HTTP URL schemes from anchors, so a raw `cursor://` or `vscode:` link won't click through from github.com.
|
|
333
|
-
|
|
334
|
-
Generate the encoded configs (replace `<PACKAGE_NAME>` and add env vars for any required API keys):
|
|
335
|
-
|
|
336
|
-
```bash
|
|
337
|
-
# Cursor: base64-encoded JSON. Split command/args, add env when keys are needed.
|
|
338
|
-
echo -n '{"command":"npx","args":["-y","<PACKAGE_NAME>"],"env":{"API_KEY":"your-api-key"}}' | base64
|
|
339
|
-
# Without env (no required keys):
|
|
340
|
-
echo -n '{"command":"npx","args":["-y","<PACKAGE_NAME>"]}' | base64
|
|
341
|
-
|
|
342
|
-
# VS Code: URL-encoded JSON. Same shape plus a `name` field.
|
|
343
|
-
node -p 'encodeURIComponent(JSON.stringify({name:"<SHORT_NAME>",command:"npx",args:["-y","<PACKAGE_NAME>"],env:{API_KEY:"your-api-key"}}))'
|
|
344
|
-
# Without env:
|
|
345
|
-
node -p 'encodeURIComponent(JSON.stringify({name:"<SHORT_NAME>",command:"npx",args:["-y","<PACKAGE_NAME>"]}))'
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
Both clients use the same `{command, args, env}` shape (matching `mcp.json` schema). VS Code adds a top-level `name` field. Omit `env` entirely when no API keys are needed — don't include empty objects or framework-only vars like `MCP_TRANSPORT_TYPE`.
|
|
349
|
-
|
|
350
|
-
The Claude Desktop badge requires the bundle to ship with a stable filename — `bun run bundle` outputs `dist/<PACKAGE_NAME>.mcpb`, and `release-and-publish` attaches that file to the GitHub Release. `releases/latest/download/<PACKAGE_NAME>.mcpb` then redirects to the most recent release.
|
|
327
|
+
**README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `skills/polish-docs-meta/references/readme.md`.
|
|
351
328
|
|
|
352
329
|
---
|
|
353
330
|
|
|
@@ -402,4 +379,7 @@ import { getMyService } from '@/services/my-domain/my-service.js';
|
|
|
402
379
|
- [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
|
|
403
380
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
404
381
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
382
|
+
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = package name; `interface.shortDescription` from `package.json` description
|
|
383
|
+
- [ ] `.codex-plugin/mcp.json` updated — server name key matches `package.json` name; env vars added for any required API keys
|
|
384
|
+
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry with server name key, env vars for any required API keys
|
|
405
385
|
- [ ] `npm run devcheck` passes
|
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/gdelt-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/gdelt-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -19,6 +19,12 @@
|
|
|
19
19
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
+
<div align="center">
|
|
23
|
+
|
|
24
|
+
**Public Hosted Server:** [https://gdelt.caseyjhand.com/mcp](https://gdelt.caseyjhand.com/mcp)
|
|
25
|
+
|
|
26
|
+
</div>
|
|
27
|
+
|
|
22
28
|
---
|
|
23
29
|
|
|
24
30
|
## Tools
|
|
@@ -156,6 +162,23 @@ Agent-friendly output:
|
|
|
156
162
|
|
|
157
163
|
## Getting started
|
|
158
164
|
|
|
165
|
+
### Public Hosted Instance
|
|
166
|
+
|
|
167
|
+
A public instance is available at `https://gdelt.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"mcpServers": {
|
|
172
|
+
"gdelt": {
|
|
173
|
+
"type": "streamable-http",
|
|
174
|
+
"url": "https://gdelt.caseyjhand.com/mcp"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Self-Hosted / Local
|
|
181
|
+
|
|
159
182
|
Add the following to your MCP client configuration file.
|
|
160
183
|
|
|
161
184
|
```json
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "mcp-ts-core ^0.9.13: HTTP 413 body cap, session-init gate, quieter error logs, GET /mcp keywords; public landing page; hosted endpoint"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.1.5 — 2026-05-28
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`MCP_HTTP_MAX_BODY_BYTES`** — configurable inbound body cap on the HTTP endpoint (default 1 MiB); oversized requests rejected with `413` before SDK parsing. Documented in `.env.example`. (via mcp-ts-core 0.9.13)
|
|
12
|
+
- **`landing.requireAuth: false`** — full tool/resource/prompt inventory served to unauthenticated callers on `GET /mcp`.
|
|
13
|
+
- **`server.json` `remotes`** — hosted endpoint `https://gdelt.caseyjhand.com/mcp` registered for MCP Registry discovery.
|
|
14
|
+
- **README hosted-instance section** — public instance documented with Streamable HTTP config snippet.
|
|
15
|
+
- **`package.json` keywords** — `typescript`, `bun`, `stdio`, `streamable-http` added for npm discoverability.
|
|
16
|
+
- **GET /mcp `keywords`** — consumer `package.json` keywords now surfaced on the HTTP status response. (via mcp-ts-core 0.9.12)
|
|
17
|
+
- **`.claude-plugin/` and `.codex-plugin/`** — plugin metadata files scaffolded.
|
|
18
|
+
|
|
19
|
+
## Fixed
|
|
20
|
+
|
|
21
|
+
- **HTTP session-init gate** — stateful HTTP mode now rejects requests arriving without `Mcp-Session-Id` with `400`, preventing uninitialized session minting. (via mcp-ts-core 0.9.10)
|
|
22
|
+
- **`httpErrorHandler` log-level split** — expected client errors (401, 403, 400, 404) now emit at `warning` instead of full error pipeline with stack traces, reducing noise. (via mcp-ts-core 0.9.10)
|
|
23
|
+
- **`gdelt-tv-service.ts`** — station filter string concatenation converted to template literal.
|
|
24
|
+
|
|
25
|
+
## Changed
|
|
26
|
+
|
|
27
|
+
- **Dependency bumps:**
|
|
28
|
+
- `@cyanheads/mcp-ts-core` ^0.9.9 → ^0.9.13
|
|
29
|
+
- `@biomejs/biome` ^2.4.15 → ^2.4.16
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "enrichment adoption: query/filter echoes, result counts, and empty-result guidance surface in a typed enrichment block on all search and analysis tools"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.1.6 — 2026-05-30
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`enrichment` block** — all search, analysis, and list tools now surface query echoes, result totals, and empty-result guidance in a typed `enrichment` block that reaches both `structuredContent` JSON and the `content[]` markdown trailer. Single-record getters (`gdelt_get_event`, `gdelt_list_tv_stations`) and pure-compute tools are unaffected.
|
|
12
|
+
|
|
13
|
+
- **`structuredContent` field renames** — the following fields moved from `output` into `enrichment`; value and presence are preserved in both channels:
|
|
14
|
+
|
|
15
|
+
| Tool | Old key (`output`) | New key (`enrichment`) |
|
|
16
|
+
|:-----|:-------------------|:-----------------------|
|
|
17
|
+
| `gdelt_search_articles` | `query` | `effectiveQuery` |
|
|
18
|
+
| `gdelt_search_articles` | `totalReturned` | `totalCount` |
|
|
19
|
+
| `gdelt_search_tv` | `query` | `effectiveQuery` |
|
|
20
|
+
| `gdelt_get_coverage_breakdown` | `query` | `effectiveQuery` |
|
|
21
|
+
| `gdelt_get_coverage_breakdown` | `seriesCount` | `totalCount` |
|
|
22
|
+
| `gdelt_get_coverage_breakdown` | `breakdownBy` | `breakdownBy` (moved to enrichment) |
|
|
23
|
+
| `gdelt_get_coverage_timeline` | `query` | `effectiveQuery` |
|
|
24
|
+
| `gdelt_get_tone_distribution` | `query` | `effectiveQuery` |
|
|
25
|
+
| `gdelt_get_tv_clips` | `query` | `effectiveQuery` |
|
|
26
|
+
| `gdelt_get_tv_clips` | `totalReturned` | `totalCount` |
|
|
27
|
+
| `gdelt_get_tv_context` | `query` | `effectiveQuery` |
|
|
28
|
+
| `gdelt_get_tv_trending` | `totalCount` (in `output`) | `totalCount` (in `enrichment`) |
|
|
29
|
+
|
|
30
|
+
Additionally, `gdelt_search_tv`, `gdelt_get_coverage_timeline`, `gdelt_get_tone_distribution`, and `gdelt_get_tv_context` gain a new `enrichment.totalCount` field.
|
|
31
|
+
|
|
32
|
+
- **Dependency bumps:**
|
|
33
|
+
- `@cyanheads/mcp-ts-core` ^0.9.13 → ^0.9.16
|
package/changelog/template.md
CHANGED
|
@@ -19,6 +19,14 @@ breaking: false
|
|
|
19
19
|
# `## Security` section below. Flagged as `Security` in the rollup so
|
|
20
20
|
# users can triage upgrade urgency at a glance.
|
|
21
21
|
security: false
|
|
22
|
+
|
|
23
|
+
# Optional free-form notes for maintenance agents processing this release.
|
|
24
|
+
# Not rendered in CHANGELOG — consumed by agents running `maintenance` on
|
|
25
|
+
# downstream servers. Use for adoption instructions that don't fit the
|
|
26
|
+
# human-facing sections: new files to create, fields to populate, one-time
|
|
27
|
+
# migration steps. Omit the field entirely when there's nothing to say.
|
|
28
|
+
# agent-notes: |
|
|
29
|
+
# <instructions for downstream maintenance agents>
|
|
22
30
|
---
|
|
23
31
|
|
|
24
32
|
# <version> — YYYY-MM-DD
|
|
@@ -35,7 +43,7 @@ security: false
|
|
|
35
43
|
name the symbol, state what changed, stop. Use a second sentence only when
|
|
36
44
|
it carries weight. If a bullet feels long, it is.
|
|
37
45
|
|
|
38
|
-
Cut: mechanism walkthroughs (those belong in JSDoc, AGENTS.md, or the
|
|
46
|
+
Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
|
|
39
47
|
relevant skill), ceremonial framings ("This release introduces…",
|
|
40
48
|
backwards-compat paragraphs), file-by-file test enumerations, internal
|
|
41
49
|
implementation notes. Prefer code/symbol names over English re-explanations.
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,8 @@ await createApp({
|
|
|
23
23
|
],
|
|
24
24
|
resources: [],
|
|
25
25
|
prompts: [],
|
|
26
|
+
// Public catalog — serve full tool/resource/prompt inventory to unauthenticated callers.
|
|
27
|
+
landing: { requireAuth: false },
|
|
26
28
|
instructions: 'GDELT MCP Server — global news and TV transcript analysis.\n' +
|
|
27
29
|
'- gdelt_search_articles: full-text news search (last 3 months, 65+ languages)\n' +
|
|
28
30
|
'- gdelt_get_coverage_timeline: when did coverage spike? (use mode volume_with_articles for signal detection)\n' +
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,SAAS,CAAC;IACd,KAAK,EAAE;QACL,mBAAmB;QACnB,wBAAwB;QACxB,wBAAwB;QACxB,yBAAyB;QACzB,aAAa;QACb,eAAe;QACf,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;KACpB;IACD,SAAS,EAAE,EAAE;IACb,OAAO,E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AAyF;IACzF,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B,YAAY,EACV,8DAA8D;QAC9D,iFAAiF;QACjF,gHAAgH;QAChH,iFAAiF;QACjF,6EAA6E;QAC7E,6EAA6E;QAC7E,+EAA+E;QAC/E,oEAAoE;QACpE,yFAAyF;QACzF,yFAAyF;QACzF,8EAA8E;IAEhF,KAAK,CAAC,IAAI;QACR,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;QACvC,eAAe,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;QAC7C,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAC7D,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -15,11 +15,6 @@ export declare const gdeltGetCoverageBreakdown: import("@cyanheads/mcp-ts-core")
|
|
|
15
15
|
startDatetime: z.ZodOptional<z.ZodString>;
|
|
16
16
|
endDatetime: z.ZodOptional<z.ZodString>;
|
|
17
17
|
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
-
query: z.ZodString;
|
|
19
|
-
breakdownBy: z.ZodEnum<{
|
|
20
|
-
language: "language";
|
|
21
|
-
country: "country";
|
|
22
|
-
}>;
|
|
23
18
|
dateResolution: z.ZodEnum<{
|
|
24
19
|
hour: "hour";
|
|
25
20
|
day: "day";
|
|
@@ -35,8 +30,6 @@ export declare const gdeltGetCoverageBreakdown: import("@cyanheads/mcp-ts-core")
|
|
|
35
30
|
date: z.ZodString;
|
|
36
31
|
value: z.ZodNumber;
|
|
37
32
|
}, z.core.$strip>>>;
|
|
38
|
-
seriesCount: z.ZodNumber;
|
|
39
|
-
notice: z.ZodOptional<z.ZodString>;
|
|
40
33
|
}, z.core.$strip>, readonly [{
|
|
41
34
|
readonly reason: "no_breakdown_data";
|
|
42
35
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
@@ -48,5 +41,13 @@ export declare const gdeltGetCoverageBreakdown: import("@cyanheads/mcp-ts-core")
|
|
|
48
41
|
readonly when: "GDELT DOC API is unreachable or rate-limited.";
|
|
49
42
|
readonly retryable: true;
|
|
50
43
|
readonly recovery: "Wait at least 5 seconds before retrying — GDELT enforces 1 request per 5 seconds.";
|
|
51
|
-
}]
|
|
44
|
+
}], {
|
|
45
|
+
readonly effectiveQuery: z.ZodString;
|
|
46
|
+
readonly breakdownBy: z.ZodEnum<{
|
|
47
|
+
language: "language";
|
|
48
|
+
country: "country";
|
|
49
|
+
}>;
|
|
50
|
+
readonly totalCount: z.ZodNumber;
|
|
51
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}>;
|
|
52
53
|
//# sourceMappingURL=get-coverage-breakdown.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-coverage-breakdown.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-breakdown.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"get-coverage-breakdown.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-breakdown.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqNpC,CAAC"}
|
|
@@ -59,8 +59,6 @@ export const gdeltGetCoverageBreakdown = tool('gdelt_get_coverage_breakdown', {
|
|
|
59
59
|
.describe('End datetime in GDELT format YYYYMMDDHHMMSS. Must pair with startDatetime.'),
|
|
60
60
|
}),
|
|
61
61
|
output: z.object({
|
|
62
|
-
query: z.string().describe('Echoed query string.'),
|
|
63
|
-
breakdownBy: z.enum(['language', 'country']).describe('Breakdown dimension used.'),
|
|
64
62
|
dateResolution: z.enum(['hour', 'day']).describe('Temporal resolution of data points.'),
|
|
65
63
|
topSeries: z
|
|
66
64
|
.array(z
|
|
@@ -86,12 +84,20 @@ export const gdeltGetCoverageBreakdown = tool('gdelt_get_coverage_breakdown', {
|
|
|
86
84
|
.describe('A single aggregated data point for the "Other" bucket.'))
|
|
87
85
|
.optional()
|
|
88
86
|
.describe('Combined time series for all series beyond the top 10. Omitted when all series fit.'),
|
|
89
|
-
|
|
87
|
+
}),
|
|
88
|
+
// Agent-facing context — query echo, breakdown dimension, total series count, and notice on empty results.
|
|
89
|
+
// Reaches structuredContent and content[] automatically; never in the domain return.
|
|
90
|
+
enrichment: {
|
|
91
|
+
effectiveQuery: z.string().describe('Echoed query string for use in follow-up calls.'),
|
|
92
|
+
breakdownBy: z
|
|
93
|
+
.enum(['language', 'country'])
|
|
94
|
+
.describe('Breakdown dimension used for this response.'),
|
|
95
|
+
totalCount: z.number().describe('Total number of series returned before truncation to top 10.'),
|
|
90
96
|
notice: z
|
|
91
97
|
.string()
|
|
92
98
|
.optional()
|
|
93
|
-
.describe('Recovery hint when no data was returned. Absent on successful responses.'),
|
|
94
|
-
}
|
|
99
|
+
.describe('Recovery hint when no breakdown data was returned. Absent on successful responses.'),
|
|
100
|
+
},
|
|
95
101
|
async handler(input, ctx) {
|
|
96
102
|
ctx.log.info('gdelt_get_coverage_breakdown', {
|
|
97
103
|
query: input.query,
|
|
@@ -139,28 +145,24 @@ export const gdeltGetCoverageBreakdown = tool('gdelt_get_coverage_breakdown', {
|
|
|
139
145
|
}
|
|
140
146
|
const allDates = topSeries.flatMap((s) => s.data.map((d) => d.date));
|
|
141
147
|
const dateResolution = inferDateResolution(allDates);
|
|
148
|
+
ctx.enrich.echo(input.query);
|
|
149
|
+
ctx.enrich.total(allSeries.length);
|
|
150
|
+
ctx.enrich({ breakdownBy: input.breakdownBy });
|
|
142
151
|
ctx.log.info('gdelt_get_coverage_breakdown completed', {
|
|
143
152
|
totalSeries: allSeries.length,
|
|
144
153
|
topSeriesCount: topSeries.length,
|
|
145
154
|
});
|
|
146
155
|
return {
|
|
147
|
-
query: input.query,
|
|
148
|
-
breakdownBy: input.breakdownBy,
|
|
149
156
|
dateResolution,
|
|
150
157
|
topSeries,
|
|
151
158
|
...(otherAggregated ? { otherAggregated } : {}),
|
|
152
|
-
seriesCount: allSeries.length,
|
|
153
159
|
};
|
|
154
160
|
},
|
|
155
161
|
format: (result) => {
|
|
156
162
|
const lines = [
|
|
157
|
-
`## GDELT Coverage Breakdown
|
|
158
|
-
`**Query:** ${result.query}`,
|
|
159
|
-
`**Total series:** ${result.seriesCount} | **Showing top:** ${result.topSeries.length}`,
|
|
163
|
+
`## GDELT Coverage Breakdown`,
|
|
160
164
|
`**Date Resolution:** ${result.dateResolution}`,
|
|
161
165
|
];
|
|
162
|
-
if (result.notice)
|
|
163
|
-
lines.push(`\n> ${result.notice}`);
|
|
164
166
|
for (const s of result.topSeries) {
|
|
165
167
|
const total = s.data.reduce((sum, d) => sum + d.value, 0);
|
|
166
168
|
lines.push(`\n### ${s.label} (total: ${total.toFixed(2)})`);
|
|
@@ -172,7 +174,8 @@ export const gdeltGetCoverageBreakdown = tool('gdelt_get_coverage_breakdown', {
|
|
|
172
174
|
if (result.otherAggregated) {
|
|
173
175
|
const otherTotal = result.otherAggregated.reduce((sum, d) => sum + d.value, 0);
|
|
174
176
|
const otherPeak = result.otherAggregated.reduce((max, d) => (d.value > max.value ? d : max), result.otherAggregated[0] ?? { date: '', value: 0 });
|
|
175
|
-
lines.push(`\n### Other
|
|
177
|
+
lines.push(`\n### Other`);
|
|
178
|
+
lines.push(`Total: ${otherTotal.toFixed(2)}`);
|
|
176
179
|
if (otherPeak.date)
|
|
177
180
|
lines.push(`Peak: ${otherPeak.value.toFixed(3)} at ${otherPeak.date}`);
|
|
178
181
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-coverage-breakdown.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-breakdown.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,oFAAoF;AACpF,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IAC5E,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,8FAA8F;QAC9F,iEAAiE;QACjE,8FAA8F;QAC9F,kEAAkE;QAClE,mGAAmG;QACnG,yFAAyF;QACzF,mDAAmD;IACrD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAExD,MAAM,EAAE;QACN;YACE,MAAM,EAAE,mBAAmB;YAC3B,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,2CAA2C;YACjD,QAAQ,EACN,oFAAoF;SACvF;QACD;YACE,MAAM,EAAE,mBAAmB;YAC3B,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;YACzC,IAAI,EAAE,+CAA+C;YACrD,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,mFAAmF;SAC9F;KACF;IAED,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,4EAA4E;YAC1E,oEAAoE,CACvE;QACH,WAAW,EAAE,CAAC;aACX,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;aAC7B,QAAQ,CACP,mEAAmE;YACjE,2CAA2C,CAC9C;QACH,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uDAAuD;YACrD,mEAAmE,CACtE;QACH,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4EAA4E,CAAC;QACzF,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4EAA4E,CAAC;KAC1F,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,
|
|
1
|
+
{"version":3,"file":"get-coverage-breakdown.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-breakdown.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,oFAAoF;AACpF,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IAC5E,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,8FAA8F;QAC9F,iEAAiE;QACjE,8FAA8F;QAC9F,kEAAkE;QAClE,mGAAmG;QACnG,yFAAyF;QACzF,mDAAmD;IACrD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAExD,MAAM,EAAE;QACN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AAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -17,12 +17,6 @@ export declare const gdeltGetCoverageTimeline: import("@cyanheads/mcp-ts-core").
|
|
|
17
17
|
endDatetime: z.ZodOptional<z.ZodString>;
|
|
18
18
|
smoothing: z.ZodOptional<z.ZodNumber>;
|
|
19
19
|
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
-
query: z.ZodString;
|
|
21
|
-
mode: z.ZodEnum<{
|
|
22
|
-
volume: "volume";
|
|
23
|
-
volume_with_articles: "volume_with_articles";
|
|
24
|
-
tone: "tone";
|
|
25
|
-
}>;
|
|
26
20
|
dateResolution: z.ZodEnum<{
|
|
27
21
|
hour: "hour";
|
|
28
22
|
day: "day";
|
|
@@ -38,7 +32,6 @@ export declare const gdeltGetCoverageTimeline: import("@cyanheads/mcp-ts-core").
|
|
|
38
32
|
}, z.core.$strip>>>;
|
|
39
33
|
}, z.core.$strip>>;
|
|
40
34
|
}, z.core.$strip>>;
|
|
41
|
-
notice: z.ZodOptional<z.ZodString>;
|
|
42
35
|
}, z.core.$strip>, readonly [{
|
|
43
36
|
readonly reason: "no_timeline_data";
|
|
44
37
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
@@ -50,5 +43,14 @@ export declare const gdeltGetCoverageTimeline: import("@cyanheads/mcp-ts-core").
|
|
|
50
43
|
readonly when: "GDELT DOC API is unreachable or rate-limited.";
|
|
51
44
|
readonly retryable: true;
|
|
52
45
|
readonly recovery: "Wait at least 5 seconds before retrying — GDELT enforces 1 request per 5 seconds.";
|
|
53
|
-
}]
|
|
46
|
+
}], {
|
|
47
|
+
readonly effectiveQuery: z.ZodString;
|
|
48
|
+
readonly mode: z.ZodEnum<{
|
|
49
|
+
volume: "volume";
|
|
50
|
+
volume_with_articles: "volume_with_articles";
|
|
51
|
+
tone: "tone";
|
|
52
|
+
}>;
|
|
53
|
+
readonly totalCount: z.ZodNumber;
|
|
54
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}>;
|
|
54
56
|
//# sourceMappingURL=get-coverage-timeline.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-coverage-timeline.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-timeline.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"get-coverage-timeline.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-timeline.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkNnC,CAAC"}
|
|
@@ -68,8 +68,6 @@ export const gdeltGetCoverageTimeline = tool('gdelt_get_coverage_timeline', {
|
|
|
68
68
|
'Reduces noise for spotty topics.'),
|
|
69
69
|
}),
|
|
70
70
|
output: z.object({
|
|
71
|
-
query: z.string().describe('Echoed query string.'),
|
|
72
|
-
mode: z.enum(['volume', 'volume_with_articles', 'tone']).describe('Timeline mode used.'),
|
|
73
71
|
dateResolution: z
|
|
74
72
|
.enum(['hour', 'day'])
|
|
75
73
|
.describe('Temporal resolution of the data points — hour for short windows, day for longer.'),
|
|
@@ -100,11 +98,20 @@ export const gdeltGetCoverageTimeline = tool('gdelt_get_coverage_timeline', {
|
|
|
100
98
|
})
|
|
101
99
|
.describe('A single time series with a label and data points.'))
|
|
102
100
|
.describe('One or more time series (typically one for volume/tone, one per label for breakdowns).'),
|
|
101
|
+
}),
|
|
102
|
+
// Agent-facing context — query echo, mode used, date span covered, and notice on empty results.
|
|
103
|
+
// Reaches structuredContent and content[] automatically; never in the domain return.
|
|
104
|
+
enrichment: {
|
|
105
|
+
effectiveQuery: z.string().describe('Echoed query string for use in follow-up calls.'),
|
|
106
|
+
mode: z
|
|
107
|
+
.enum(['volume', 'volume_with_articles', 'tone'])
|
|
108
|
+
.describe('Timeline mode used for this response.'),
|
|
109
|
+
totalCount: z.number().describe('Total number of data points across all series.'),
|
|
103
110
|
notice: z
|
|
104
111
|
.string()
|
|
105
112
|
.optional()
|
|
106
|
-
.describe('Recovery hint when no data was returned. Absent on successful responses.'),
|
|
107
|
-
}
|
|
113
|
+
.describe('Recovery hint when no timeline data was returned. Absent on successful responses.'),
|
|
114
|
+
},
|
|
108
115
|
async handler(input, ctx) {
|
|
109
116
|
ctx.log.info('gdelt_get_coverage_timeline', { query: input.query, mode: input.mode });
|
|
110
117
|
const svc = getGdeltDocService();
|
|
@@ -131,21 +138,21 @@ export const gdeltGetCoverageTimeline = tool('gdelt_get_coverage_timeline', {
|
|
|
131
138
|
// Infer date resolution from data point spacing
|
|
132
139
|
const allDates = series.flatMap((s) => s.data.map((d) => d.date));
|
|
133
140
|
const dateResolution = inferDateResolution(allDates);
|
|
141
|
+
const totalPoints = series.reduce((sum, s) => sum + s.data.length, 0);
|
|
142
|
+
ctx.enrich.echo(input.query);
|
|
143
|
+
ctx.enrich.total(totalPoints);
|
|
144
|
+
ctx.enrich({ mode: input.mode });
|
|
134
145
|
ctx.log.info('gdelt_get_coverage_timeline completed', {
|
|
135
146
|
seriesCount: series.length,
|
|
136
147
|
pointCount: series[0]?.data.length ?? 0,
|
|
137
148
|
});
|
|
138
|
-
return {
|
|
149
|
+
return { dateResolution, series };
|
|
139
150
|
},
|
|
140
151
|
format: (result) => {
|
|
141
152
|
const lines = [
|
|
142
153
|
`## GDELT Coverage Timeline`,
|
|
143
|
-
`**Query:** ${result.query}`,
|
|
144
|
-
`**Mode:** ${result.mode}`,
|
|
145
154
|
`**Date Resolution:** ${result.dateResolution}`,
|
|
146
155
|
];
|
|
147
|
-
if (result.notice)
|
|
148
|
-
lines.push(`\n> ${result.notice}`);
|
|
149
156
|
for (const s of result.series) {
|
|
150
157
|
lines.push(`\n### ${s.label}`);
|
|
151
158
|
const peakPoint = s.data.reduce((max, d) => (Math.abs(d.value) > Math.abs(max.value) ? d : max), s.data[0] ?? { date: '', value: 0, articles: undefined });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-coverage-timeline.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-timeline.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,6BAA6B,EAAE;IAC1E,KAAK,EAAE,6BAA6B;IACpC,WAAW,EACT,8GAA8G;QAC9G,+FAA+F;QAC/F,oGAAoG;QACpG,iGAAiG;QACjG,mDAAmD;QACnD,iHAAiH;QACjH,4GAA4G;QAC5G,8CAA8C;IAChD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAExD,MAAM,EAAE;QACN;YACE,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,yDAAyD;YAC/D,QAAQ,EAAE,gFAAgF;SAC3F;QACD;YACE,MAAM,EAAE,mBAAmB;YAC3B,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;YACzC,IAAI,EAAE,+CAA+C;YACrD,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,mFAAmF;SAC9F;KACF;IAED,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,4EAA4E;YAC1E,2EAA2E,CAC9E;QACH,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,QAAQ,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC;aAChD,OAAO,CAAC,QAAQ,CAAC;aACjB,QAAQ,CACP,sEAAsE;YACpE,iGAAiG;YACjG,sDAAsD,CACzD;QACH,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uDAAuD;YACrD,mEAAmE,CACtE;QACH,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4EAA4E,CAAC;QACzF,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4EAA4E,CAAC;QACzF,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,wEAAwE;YACtE,kCAAkC,CACrC;KACJ,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,
|
|
1
|
+
{"version":3,"file":"get-coverage-timeline.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-coverage-timeline.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,M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M,CAAC,IAAI,OAAO,EAAE,CAAC;gBACxB,MAAM,YAAY,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,EAAE,CAAC,CAAC;gBAChE,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;oBACvB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;wBACvC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;oBAC3C,CAAC;gBACH,CAAC;YACH,CAAC;YACD,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,cAAc,CAAC,CAAC;QAC9E,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -11,7 +11,6 @@ export declare const gdeltGetToneDistribution: import("@cyanheads/mcp-ts-core").
|
|
|
11
11
|
startDatetime: z.ZodOptional<z.ZodString>;
|
|
12
12
|
endDatetime: z.ZodOptional<z.ZodString>;
|
|
13
13
|
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
-
query: z.ZodString;
|
|
15
14
|
histogram: z.ZodArray<z.ZodObject<{
|
|
16
15
|
bin: z.ZodNumber;
|
|
17
16
|
count: z.ZodNumber;
|
|
@@ -25,7 +24,6 @@ export declare const gdeltGetToneDistribution: import("@cyanheads/mcp-ts-core").
|
|
|
25
24
|
peakPositiveBin: z.ZodNumber;
|
|
26
25
|
neutralPct: z.ZodNumber;
|
|
27
26
|
}, z.core.$strip>;
|
|
28
|
-
notice: z.ZodOptional<z.ZodString>;
|
|
29
27
|
}, z.core.$strip>, readonly [{
|
|
30
28
|
readonly reason: "no_tone_data";
|
|
31
29
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
@@ -37,5 +35,9 @@ export declare const gdeltGetToneDistribution: import("@cyanheads/mcp-ts-core").
|
|
|
37
35
|
readonly when: "GDELT DOC API is unreachable or rate-limited.";
|
|
38
36
|
readonly retryable: true;
|
|
39
37
|
readonly recovery: "Wait at least 5 seconds before retrying — GDELT enforces 1 request per 5 seconds.";
|
|
40
|
-
}]
|
|
38
|
+
}], {
|
|
39
|
+
readonly effectiveQuery: z.ZodString;
|
|
40
|
+
readonly totalCount: z.ZodNumber;
|
|
41
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}>;
|
|
41
43
|
//# sourceMappingURL=get-tone-distribution.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-tone-distribution.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-tone-distribution.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"get-tone-distribution.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-tone-distribution.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwKnC,CAAC"}
|