Skip to content

160-tool MCP server for real-time global intelligence from free public APIs: markets, liquidity, prediction markets, SEC filings, conflict, military, aircraft-cohort early warning, migration and border flows, cyber, climate, news and more. Dated observation history, 29 research prompts, cited briefs, geofences, SSE dashboard. MIT, no paid API keys.

election-watch: say the calendar is a fixed table

Phoenix Agent (mac-studio)9747f7c240bb
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d6909c5..be878fe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -383,6 +383,12 @@ source here, and no proxy is substituted for any of these measures.
store when `FRED_API_KEY` is not set) and history-recall (the history
store and the collector's run log). The source-health scope points to
`intel_collection_health` for the run history it does not read.
+- election-watch presented `intel_election_calendar` as upcoming
+ elections. It is a hand-kept table of 18 rows dated 2025-01 to
+ 2029-04, most already past; an uncovered country returns an empty list
+ with no note; past entries keep a proximity risk; and the country
+ filter also matches part of a name (RUS returns Belarus). The step and
+ limits now say each of these. The code is unchanged.
### Added: tropical cyclone forecast tracks
- `intel_cyclones` and `intel_jtwc_cyclones` take `include_forecast`
diff --git a/src/world_intel_mcp/guide_prompts.py b/src/world_intel_mcp/guide_prompts.py
index 3ca9e1c..38eac78 100644
--- a/src/world_intel_mcp/guide_prompts.py
+++ b/src/world_intel_mcp/guide_prompts.py
@@ -1242,7 +1242,8 @@ PROMPTS: tuple[ResearchPrompt, ...] = (
steps=(
Step(
"intel_election_calendar",
- "upcoming elections and their proximity risk",
+ "entries from a hand-kept election table of 18 rows dated "
+ "2025-01 to 2029-04, each with a status and a proximity risk",
args=(("country", "{country}"),),
),
Step(
@@ -1277,6 +1278,15 @@ PROMPTS: tuple[ResearchPrompt, ...] = (
),
),
limits=(
+ "The calendar is a fixed table, not a feed. An empty list means "
+ "the country is not in it, not that no election is due; say the "
+ "calendar does not cover it.",
+ "Entries with status past have already happened. Leave them out "
+ "of upcoming elections: their proximity risk scores the days "
+ "after an election like the days before it.",
+ "The country filter also matches part of a country name (RUS "
+ "returns Belarus), so keep only entries whose iso3 is the code "
+ "you asked for.",
"Proximity risk rises as an election nears; it is a stated "
"heuristic, not a forecast of unrest or of the result.",
"Reddit and prediction markets reflect their own participants, "
diff --git a/src/world_intel_mcp/tests/test_guide.py b/src/world_intel_mcp/tests/test_guide.py
index 60e7ac9..ccfe773 100644
--- a/src/world_intel_mcp/tests/test_guide.py
+++ b/src/world_intel_mcp/tests/test_guide.py
@@ -1887,3 +1887,26 @@ def test_prompts_point_to_the_tools_that_answer_them_best(registered) -> None:
assert calls["intel_history_backfill"] == {"provider": "fred", "series": [series]}
assert calls["intel_series_history"] == {"series_key": f"backfill:fred:{series}"}
assert "(intel_collection_health)" in " ".join(guide._HEALTH_SCOPE)
+
+
+async def test_election_watch_says_what_the_calendar_table_is() -> None:
+ from world_intel_mcp.config.countries import UPCOMING_ELECTIONS
+ from world_intel_mcp.sources import elections
+
+ dates = sorted(e["date"] for e in UPCOMING_ELECTIONS)
+ text = " ".join(_text("election-watch").split())
+ assert (
+ f"hand-kept election table of {len(UPCOMING_ELECTIONS)} rows dated "
+ f"{dates[0][:7]} to {dates[-1][:7]}"
+ ) in text
+ # An uncovered country is an empty list with no note.
+ uncovered = await elections.fetch_election_calendar(None, country="JPN")
+ assert uncovered["elections"] == [] and "note" not in uncovered and "error" not in uncovered
+ assert "An empty list means the country is not in it" in text
+ # The filter matches part of a name; past entries keep a proximity score.
+ rus = await elections.fetch_election_calendar(None, country="RUS")
+ assert [e["iso3"] for e in rus["elections"]] == ["BLR"]
+ assert "(RUS returns Belarus)" in text
+ assert elections._proximity_score(-13) == elections._proximity_score(13) > 0
+ assert "Entries with status past have already happened" in text