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.

Guide: mark the instability index as needing ACLED credentials

Phoenix Agent (mac-studio)0bc3044cb76d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dae29d8..f6f5d0b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -327,6 +327,14 @@ source here, and no proxy is substituted for any of these measures.
- `intel_internet_outages` returned an empty list with no marker when
neither Cloudflare Radar nor IODA answered; it now carries `error`,
`degraded` and reason `outages_unavailable`.
+- The guide did not mark `intel_instability_index` as needing ACLED
+ credentials, though without a `country_code` it returns the same
+ credentials error as the other ACLED tools. It now carries
+ `[needs ACLED_EMAIL, ACLED_PASSWORD]`, and the keyed-source note says a
+ `country_code` call still scores without ACLED and lists
+ `acled_unconfigured` in `data_gaps`. A new test calls every conflict and
+ intelligence tool with no keys set and checks that each one whose error
+ names a key is marked.
### Added: tropical cyclone forecast tracks
- `intel_cyclones` and `intel_jtwc_cyclones` take `include_forecast`
diff --git a/src/world_intel_mcp/guide.py b/src/world_intel_mcp/guide.py
index f8b2e53..cf378ca 100644
--- a/src/world_intel_mcp/guide.py
+++ b/src/world_intel_mcp/guide.py
@@ -115,9 +115,17 @@ KEYED_SOURCES: tuple[KeyedSource, ...] = (
"ACLED",
("ACLED_EMAIL", "ACLED_PASSWORD"),
"ACLED event, unrest and risk tools return an error naming the missing "
- "credentials. When both are set but the sign-in request fails, the "
+ "credentials, and so does intel_instability_index without a "
+ "country_code. With a country_code the index still scores, without "
+ "its unrest and conflict inputs, and lists acled_unconfigured in "
+ "data_gaps. When both are set but the sign-in request fails, the "
"error says ACLED sign-in failed instead (reason acled_auth_failed).",
- needed_by=("intel_acled_events", "intel_unrest_events", "intel_risk_scores"),
+ needed_by=(
+ "intel_acled_events",
+ "intel_unrest_events",
+ "intel_risk_scores",
+ "intel_instability_index",
+ ),
),
KeyedSource(
"UCDP",
diff --git a/src/world_intel_mcp/tests/test_guide.py b/src/world_intel_mcp/tests/test_guide.py
index e16efcd..d704aec 100644
--- a/src/world_intel_mcp/tests/test_guide.py
+++ b/src/world_intel_mcp/tests/test_guide.py
@@ -1597,3 +1597,72 @@ def test_source_health_scope_explains_the_breaker_counters() -> None:
for term in ("failing_sources", "failures is the count of failed calls since the last success",
"total_successes", "total_failures"):
assert term in scope, term
+
+
+async def test_every_conflict_and_intelligence_tool_naming_a_key_is_marked(
+ monkeypatch, tmp_path
+) -> None:
+ """The reverse of the check above: a tool whose error names a keyed
+ variable when that variable is unset must carry [needs ...] in the
+ guide. Every upstream request is refused with 401, and rate-limit
+ waits are skipped."""
+ import asyncio as _asyncio
+ import json as _json
+
+ import httpx
+
+ async def _no_wait(*args, **kwargs) -> None:
+ return None
+
+ monkeypatch.setattr(_asyncio, "sleep", _no_wait)
+
+ from world_intel_mcp import runtime
+ from world_intel_mcp.fetcher import Fetcher
+ from world_intel_mcp.tools import ALL_HANDLERS, conflict, intelligence
+
+ keyed = {var for ks in guide.KEYED_SOURCES for var in ks.env}
+ for var in keyed:
+ monkeypatch.delenv(var, raising=False)
+ refuse = httpx.MockTransport(lambda request: httpx.Response(401))
+ client = httpx.AsyncClient(transport=refuse)
+ # intel_country_brief opens its own client for a local model; it gets
+ # the same refusal, so nothing leaves the process.
+ real_client = httpx.AsyncClient
+
+ def _offline_client(*args, **kwargs):
+ kwargs.pop("proxy", None)
+ kwargs["transport"] = refuse
+ return real_client(*args, **kwargs)
+
+ monkeypatch.setattr(httpx, "AsyncClient", _offline_client)
+ cache = Cache(db_path=tmp_path / "reverse.db")
+ monkeypatch.setattr(runtime, "fetcher", Fetcher(cache, CircuitBreaker(), max_retries=0, client=client))
+ sample = {
+ "intel_aircraft_details": {"icao24": "abc123"},
+ "intel_aircraft_batch": {"icao24_list": ["abc123"]},
+ }
+ named: dict[str, list[str]] = {}
+ called = 0
+ try:
+ for module in (conflict, intelligence):
+ for tool in module.TOOLS:
+ result = await ALL_HANDLERS[tool.name](sample.get(tool.name, {}))
+ called += 1
+ error = _json.dumps(result.get("error") or "")
+ found = sorted(var for var in keyed if var in error)
+ if found:
+ named[tool.name] = found
+ finally:
+ await client.aclose()
+ cache.close()
+ assert called == len(conflict.TOOLS) + len(intelligence.TOOLS) == 24
+ marked = {tool: sorted(env) for tool, env in guide._NEEDS.items() if tool in named}
+ assert named == marked
+ assert sorted(named) == [
+ "intel_acled_events",
+ "intel_instability_index",
+ "intel_risk_scores",
+ "intel_ucdp_events",
+ "intel_unrest_events",
+ ]