Expose product length calculation through MCP
This commit is contained in:
@@ -7,6 +7,7 @@ from typing import Any
|
||||
from rollcalc_mcp_tools import (
|
||||
analyze_transport_capacity_result,
|
||||
calculate_material_weight_result,
|
||||
calculate_product_length_result,
|
||||
calculate_roll_diameter_result,
|
||||
get_article_result,
|
||||
search_articles_result,
|
||||
@@ -46,6 +47,25 @@ def create_server() -> Any:
|
||||
area_weight_g_m2=area_weight_g_m2,
|
||||
)
|
||||
|
||||
@server.tool()
|
||||
def calculate_product_length(
|
||||
target_roll_diameter_mm: float,
|
||||
core_diameter_mm: float,
|
||||
thickness_mm: float,
|
||||
thickness_stddev_mm: float | None = None,
|
||||
width_m: float | None = None,
|
||||
area_weight_g_m2: float | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Calculate required product/roll length for a target outer roll diameter. target_roll_diameter_mm, core_diameter_mm, and thickness_mm are required and expressed in mm. Use exact article master-data values obtained through get_article when available; do not infer a missing core diameter, thickness, width, area weight, or article. thickness_stddev_mm returns deterministic minimum, average, and maximum length ranges. When both width_m (m) and area_weight_g_m2 (g/m²) are supplied, the result also includes corresponding material-weight ranges. This tool calculates length from target diameter; use calculate_roll_diameter for the reverse direction."""
|
||||
return calculate_product_length_result(
|
||||
target_roll_diameter_mm=target_roll_diameter_mm,
|
||||
core_diameter_mm=core_diameter_mm,
|
||||
thickness_mm=thickness_mm,
|
||||
thickness_stddev_mm=thickness_stddev_mm,
|
||||
width_m=width_m,
|
||||
area_weight_g_m2=area_weight_g_m2,
|
||||
)
|
||||
|
||||
@server.tool()
|
||||
def calculate_roll_diameter(
|
||||
roll_length_m: float | None = None,
|
||||
|
||||
Reference in New Issue
Block a user