Add input_cost_trend / input_cost_series MCP tools (EIA diesel)
CI / test (push) Successful in 17s
CI / build-push (push) Successful in 6s

Real input price + WoW/YoY change + seasonal for diesel ($/gal). Formatters now
handle the item/label payload shape. Changelog updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-30 12:35:32 -04:00
parent 47cac9b521
commit 457cdad2fb
5 changed files with 81 additions and 8 deletions
+13
View File
@@ -118,6 +118,19 @@ def test_fmt_price_trend_diesel_units():
assert "$5.520/gal" in out # 3-decimal $/gal formatting
def test_fmt_input_cost_payload_shape():
# Input-cost payload uses item/label and has no geo.
payload = {"item": "diesel", "label": "retail diesel", "unit": "$/gal", "source": "EIA",
"trend": {"period": "2026-05-25", "value_cents": 552, "prev_cents": 560,
"change_cents": -8, "change_pct": -1.4, "yoy_cents": 349,
"yoy_change_cents": 203, "yoy_pct": 58.2, "seasonal": None,
"recent_direction": "down", "baseline_years": 10, "points": 1680}}
out = fmt.fmt_price_trend(payload)
assert "diesel — retail diesel" in out # item/label header, no geo segment
assert "$5.520/gal" in out
assert "+58.2%" in out # YoY surfaced
def test_fmt_inputs_lime_table():
payload = {
"product": "lime", "count": 2,