Skip to content

Instantly share code, notes, and snippets.

@samirsaci
Created November 9, 2025 13:41
Show Gist options
  • Select an option

  • Save samirsaci/e5254c665a3577f8a4afa35609a1344d to your computer and use it in GitHub Desktop.

Select an option

Save samirsaci/e5254c665a3577f8a4afa35609a1344d to your computer and use it in GitHub Desktop.
MCP Server Supply Chain Optimisation - Doc String Describe Output
"""
OUTPUT (matches your service schema)
------------------------------------
The service returns { "input_params": {...}, "output_results": {...} }.
Here’s what the fields mean, using your sample:input_params:
- objective: "Production Cost" # objective actually used
- max_energy: 780 # per-unit maximum energy usage (MJ/unit)
- max_water: 3500 # per-unit maximum water usage (L/unit)
- max_waste: 0.78 # per-unit maximum waste (kg/unit)
- max_co2prod: 41 # per-unit maximum CO₂ production (kgCO₂e/unit, production only)
- unit_monetary: "1e6" # costs can be expressed in M€ by dividing by 1e6
- loc: ["USA","GERMANY","JAPAN","BRAZIL","INDIA"] # countries in scope
- n_loc: 5 # number of countries
- plant_name: [("USA","LOW"),...,("INDIA","HIGH")] # decision keys for plant opening
- prod_name: [(i,j) for i in loc for j in loc] # decision keys for flows i→j
- total_demand: 48950 # total market demand (units)
output_results:
- plant_opening: {"USA-LOW":0, ... "INDIA-HIGH":1}
Binary open/close by (country-capacity). Example above opens:
INDIA-LOW, JAPAN-HIGH, BRAZIL-HIGH, INDIA-HIGH.
- flow_volumes: {"INDIA-USA":15500, "BRAZIL-USA":12500, "JAPAN-JAPAN":15000, ...}
Optimal shipment plan (units) from production country to market.
- local_prod, export_prod, total_prod: 18050, 30900, 48950
Local vs. export volume with total = demand feasibility check.
- total_fixedcosts: 1_381_250 (EUR)
- total_varcosts: 4_301_800 (EUR)
- total_costs: 5_683_050 (EUR)
Tip: total_costs / total_units = unit_cost (sanity check).
- total_units: 48950
- unit_cost: 116.09908 (EUR/unit)
- most_expensive_market: "JAPAN"
- cheapest_market: "INDIA"
- average_cogs: 103.6097 (EUR/unit across markets)
- unit_energy: 722.4208 (MJ/unit)
- unit_water: 3318.284 (L/unit)
- unit_waste: 0.6153 (kg/unit)
- unit_co2: 35.5485 (kgCO₂e/unit)
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment