Harden MCP article and weight workflows

This commit is contained in:
2026-09-25 16:34:49 +02:00
parent 1169df96a8
commit 580e9caa5e
6 changed files with 181 additions and 12 deletions
+15
View File
@@ -6,6 +6,7 @@ from typing import Any
from roll_calculation import (
ArticleRepository,
calculate_material_weight,
calculate_roll,
get_article,
transport_roll_inputs_from_roll_calculation,
@@ -26,6 +27,20 @@ def search_articles_result(query: str) -> dict[str, Any]:
return ArticleRepository.load().search(query)
def calculate_material_weight_result(
*,
roll_length_m: float,
width_m: float,
area_weight_g_m2: float,
) -> dict[str, Any]:
"""Delegate material-only weight calculation to the shared domain service."""
return calculate_material_weight(
roll_length_m=roll_length_m,
width_m=width_m,
area_weight_g_m2=area_weight_g_m2,
)
def calculate_roll_diameter_result(
*,
article_number: str | None = None,