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: keep abbreviations in tool lines, maintainer notes out of summaries

Phoenix Agent (mac-studio)233b33dce63c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 00ad31d..653f45d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -350,6 +350,14 @@ source here, and no proxy is substituted for any of these measures.
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.
+- The guide's tool list cut each description at the first period
+ followed by a capital, so `intel_us_border_encounters` read just "U.S.".
+ A period that closes an abbreviation (U.S., e.g., i.e.) no longer ends
+ the line.
+- Domain summaries carried maintainer notes from module docstrings (a
+ build phase, a source file path, internal names), and newer domains had
+ no written title. Each domain now has one, and a summary is the first
+ sentence of its module docstring without build-phase notes.
### 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 2a48040..2b6a8bb 100644
--- a/src/world_intel_mcp/guide.py
+++ b/src/world_intel_mcp/guide.py
@@ -94,6 +94,14 @@ _DOMAIN_TITLES = {
"vector": "Stored history (vector store)",
"aoi": "Areas of interest, briefs and reports",
"system": "System",
+ "prediction_markets": "Prediction markets",
+ "news_signals": "News signals",
+ "liquidity": "Liquidity and money",
+ "news_market": "News and market reaction",
+ "history": "Stored history (history store)",
+ "lagged_connections": "Lagged connections between stored series",
+ "day_timeline": "Day timeline",
+ "history_backfill": "History backfill",
}
@@ -191,10 +199,15 @@ class Domain:
tools: tuple[Any, ...]
+# Notes for maintainers in a module docstring (a build phase, a pointer
+# to a source file) stay out of the guide a model reads.
+_DEVELOPER_NOTE = re.compile(r"\s*\(Phase \d+\)")
+
+
def _module_summary(module: Any) -> str:
doc = (module.__doc__ or "").strip()
first_paragraph = doc.split("\n\n", 1)[0]
- return " ".join(first_paragraph.split())
+ return _DEVELOPER_NOTE.sub("", _first_sentence(" ".join(first_paragraph.split())))
def domains(modules: list | None = None) -> list[Domain]:
@@ -212,10 +225,20 @@ def domains(modules: list | None = None) -> list[Domain]:
_SENTENCE_END = re.compile(r"(?<=[.!?])\s+(?=[A-Z(])")
+# A period that closes an abbreviation (U.S., e.g., i.e.) does not end a
+# sentence, though a capital may follow it.
+_ABBREVIATION = re.compile(r"(?:\b(?:[A-Za-z]\.){2,}|\b(?:etc|vs|approx|Inc|No|St)\.)$")
+
+
+def _first_sentence(text: str) -> str:
+ for end in _SENTENCE_END.finditer(text):
+ if not _ABBREVIATION.search(text[: end.start()]):
+ return text[: end.start()]
+ return text
def _one_line(description: str) -> str:
- first = _SENTENCE_END.split(" ".join(description.split()), 1)[0]
+ first = _first_sentence(" ".join(description.split()))
# Em dashes in tool descriptions become hyphens: the guide is
# published text.
return first.replace(" — ", " - ").replace("—", "-")
diff --git a/src/world_intel_mcp/tests/test_guide.py b/src/world_intel_mcp/tests/test_guide.py
index 88593dd..071957b 100644
--- a/src/world_intel_mcp/tests/test_guide.py
+++ b/src/world_intel_mcp/tests/test_guide.py
@@ -1728,3 +1728,30 @@ async def test_limit_wording_allows_a_list_that_ends_exactly_at_the_limit() -> N
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
+
+
+def test_tool_lines_do_not_stop_at_an_abbreviation() -> None:
+ lines = {
+ tool.name: guide._one_line(tool.description or "")
+ for domain in guide.domains()
+ for tool in domain.tools
+ }
+ assert lines["intel_us_border_encounters"].startswith("U.S. CBP encounters per month (")
+ assert sorted(name for name, line in lines.items() if len(line) < 20) == []
+ assert guide._first_sentence("Covers the U.S. Gulf coast, e.g. Texas. Then more.") == (
+ "Covers the U.S. Gulf coast, e.g. Texas."
+ )
+ assert guide._first_sentence("Ends here. Next one.") == "Ends here."
+
+
+def test_domain_titles_and_summaries_are_written_for_a_model() -> None:
+ """Every domain has a written title, and no summary carries notes meant
+ for maintainers (a build phase, a source file, internal names)."""
+ found = guide.domains()
+ assert sorted(d.key for d in found if d.key not in guide._DOMAIN_TITLES) == []
+ for domain in found:
+ assert not re.search(r"\.py\b|``|Phase \d|\bruntime\b", domain.summary), domain
+ assert guide._first_sentence(domain.summary) == domain.summary, domain
+ titles = {d.key: d.title for d in found}
+ assert titles["news_market"] == "News and market reaction"
+ assert titles["liquidity"] == "Liquidity and money"