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.

Prompts: a count at the limit may be cut off, not certainly

Phoenix Agent (mac-studio)6326aa503522
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ecf5277..00ad31d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -344,6 +344,12 @@ source here, and no proxy is substituted for any of these measures.
or ECB publisher history. The limit now names the backfill, the three
tools that read it, and that its values are the publisher's current
vintage.
+- sanctions-screen said a count equal to the limit means more names
+ matched, and conflict-trend and earthquake-exposure said the same of
+ their lists, but a list that ends exactly at the limit returns the same
+ count. They now say the list may have been cut off and to call again
+ with a higher limit, and sanctions-screen says `total_entities` counts
+ the entries read before the search stopped, not the size of the list.
### 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 ba02c53..1725630 100644
--- a/src/world_intel_mcp/guide_prompts.py
+++ b/src/world_intel_mcp/guide_prompts.py
@@ -351,7 +351,8 @@ PROMPTS: tuple[ResearchPrompt, ...] = (
"ACLED events in {country} over both windows. It needs "
"ACLED_EMAIL and ACLED_PASSWORD; without them it returns an "
"error naming them. limit caps the result: a count equal to the "
- "limit means the list was cut off, so say so",
+ "limit means the list may have been cut off, so say so or call "
+ "again with a higher limit",
args=(("country", "{country}"), ("days", "{span}"), ("limit", 1000)),
),
Step(
@@ -359,7 +360,7 @@ PROMPTS: tuple[ResearchPrompt, ...] = (
"protests and riots in {country} (also ACLED, same credentials), "
"kept apart from armed violence. Nearby duplicates are merged: "
"count plus deduplicated is what was fetched, and when that "
- "equals the limit the list was cut off",
+ "equals the limit the list may have been cut off",
args=(("country", "{country}"), ("days", "{span}"), ("limit", 1000)),
),
),
@@ -629,7 +630,8 @@ PROMPTS: tuple[ResearchPrompt, ...] = (
Step(
"intel_earthquakes",
"the events, newest first and at most 50 by default, so a "
- "count of 50 means older ones were cut off",
+ "count of 50 means older ones may have been cut off; call again "
+ "with a higher limit to check",
args=(("min_magnitude", "{min_magnitude}"), ("hours", "{hours}")),
),
Step(
@@ -1147,11 +1149,14 @@ PROMPTS: tuple[ResearchPrompt, ...] = (
),
limits=(
"If total_entities is 0, the list could not be read. That is a "
- "failed search, not a clean result.",
+ "failed search, not a clean result. Otherwise total_entities "
+ "counts the entries read before the search stopped, not the size "
+ "of the list.",
"Only the primary name of each entry is searched, not its "
"aliases, so a listed party under another spelling will not match.",
"Results stop at the limit (default 50): a count equal to the "
- "limit means more names matched.",
+ "limit means more names may have matched, so search again with a "
+ "higher limit before saying how many did.",
"Matching is by substring on names. A name match is not an "
"identity match, and this is not a compliance screening service. "
"Never answer that a party is not sanctioned.",
diff --git a/src/world_intel_mcp/tests/test_guide.py b/src/world_intel_mcp/tests/test_guide.py
index fd683ee..88593dd 100644
--- a/src/world_intel_mcp/tests/test_guide.py
+++ b/src/world_intel_mcp/tests/test_guide.py
@@ -1694,3 +1694,37 @@ def test_guide_says_backfilled_history_predates_collection(registered) -> None:
assert set(named) <= registered
assert "current vintage" in bullet
assert "revisions made before the backfill do not show" in " ".join(bullet.split())
+
+
+async def test_limit_wording_allows_a_list_that_ends_exactly_at_the_limit() -> None:
+ """A count equal to the limit is what an exact fit also returns, and
+ total_entities stops counting where the search stopped."""
+ from world_intel_mcp.sources import sanctions
+
+ class _ThreeAcme(_DownFetcher):
+ async def get_text(self, *args, **kwargs):
+ return "\n".join(
+ f'{i},"ACME {i}","Entity","SDGT","","","","","","","",""' for i in range(1, 4)
+ ) + '\n4,"ZENITH","Entity","SDGT","","","","","","","",""'
+
+ exact = await sanctions.fetch_sanctions_search(_ThreeAcme(), query="acme", limit=3)
+ more = await sanctions.fetch_sanctions_search(_ThreeAcme(), query="acme", limit=4)
+ # Three matches exist; limit 3 returns 3 though nothing more matched,
+ # and reads 3 of the 4 entries before it stops.
+ assert (exact["count"], exact["total_entities"]) == (3, 3)
+ assert (more["count"], more["total_entities"]) == (3, 4)
+
+ def flat(name: str) -> str:
+ return " ".join(_text(name).split())
+
+ sanctions_text = flat("sanctions-screen")
+ assert "a count equal to the limit means more names matched" not in sanctions_text
+ assert "a count equal to the limit means more names may have matched" in sanctions_text
+ assert "total_entities counts the entries read before the search stopped" in sanctions_text
+ conflict_text = flat("conflict-trend")
+ assert "the list was cut off" not in conflict_text
+ assert conflict_text.count("the list may have been cut off") == 2
+ quake_text = flat("earthquake-exposure")
+ assert "older ones were cut off" not in quake_text
+ assert "older ones may have been cut off" in quake_text