feat: nutrient_cost tool — cheapest fertilizer per lb of N/P/K #1

Merged
claude merged 1 commits from feat/nutrient-cost into main 2026-06-04 15:58:59 -04:00
Contributor

Part 2 of planning #90 — the advisor's surface for cost-per-nutrient. Pairs with ag-bids #5 (the /api/data/nutrient-cost endpoint).

What

New MCP tool nutrient_cost(geo)agbids__nutrient_cost for the advisor. Wraps ag-monitor's /api/data/nutrient-cost and formats:

  • the cheapest source of each nutrient (N / P₂O₅ / K₂O), and
  • a ranked $/lb table (sorted by $/lb N) with grade, $/ton, and $/lb for each nutrient.

Tool docstring steers the model to use this (not input_cost_trend, which is $/ton only) when the grower asks "best buy / best nitrogen value". UAN shown as assumed 32-0-0 with a footnote.

client.nutrient_cost + fmt.fmt_nutrient_cost (+ _per_lb). 42 tests pass.

Smoke (post-deploy)

Via the advisor or directly: nutrient_cost("Cornbelt") → anhydrous cheapest N, potash cheapest K₂O.

Part 2 of planning #90 — the advisor's surface for cost-per-nutrient. Pairs with ag-bids #5 (the `/api/data/nutrient-cost` endpoint). ## What New MCP tool **`nutrient_cost(geo)`** → `agbids__nutrient_cost` for the advisor. Wraps ag-monitor's `/api/data/nutrient-cost` and formats: - the **cheapest source of each nutrient** (N / P₂O₅ / K₂O), and - a ranked `$/lb` table (sorted by $/lb N) with grade, $/ton, and $/lb for each nutrient. Tool docstring steers the model to use this (not `input_cost_trend`, which is $/ton only) when the grower asks "best buy / best nitrogen value". UAN shown as assumed 32-0-0 with a footnote. `client.nutrient_cost` + `fmt.fmt_nutrient_cost` (+ `_per_lb`). **42 tests pass.** ## Smoke (post-deploy) Via the advisor or directly: `nutrient_cost("Cornbelt")` → anhydrous cheapest N, potash cheapest K₂O.
claude added 1 commit 2026-06-04 15:52:34 -04:00
feat: nutrient_cost tool — cheapest fertilizer per lb of N/P/K
CI / test (pull_request) Successful in 18s
CI / build-push (pull_request) Has been skipped
65509a27d6
New agbids__nutrient_cost(geo) tool: wraps ag-monitor's /api/data/nutrient-cost
and formats a per-nutrient value comparison for the advisor — cheapest source of
N / P2O5 / K2O + a ranked $/lb table. This is what answers "which fertilizer is
the best nitrogen value per dollar?" (input_cost_trend is $/ton only). UAN grade
shown as assumed 32-0-0.

client.nutrient_cost + fmt.fmt_nutrient_cost (+ _per_lb). 42 tests pass.

For planning #90.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude merged commit bb4219da87 into main 2026-06-04 15:58:59 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: justin/ag-bids-mcp#1