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 -5
View File
@@ -118,8 +118,10 @@ Authentication is implemented with `Flask-HTTPAuth`. The current code checks `BE
`mcp_server.py` provides a local stdio-only Model Context Protocol server. It is
a thin adapter over the same domain services used by Flask: article lookup,
direct roll calculation, and transport analysis. The available PoC tools are
`get_article`, `calculate_roll_diameter`, and `analyze_transport_capacity`.
direct roll calculation, material-weight calculation, and transport analysis.
The available PoC tools are `get_article`, `search_articles`,
`calculate_material_weight`, `calculate_roll_diameter`, and
`analyze_transport_capacity`.
Install the pinned dependencies, including `mcp==1.26.0`, in the existing
environment, then start it with:
@@ -136,11 +138,19 @@ Tool calling semantics:
- `get_article` accepts textual `article_number` values (including leading
zeroes) and an optional `article_name_hint`.
- `search_articles` deterministically returns master-data candidates for a
product name or designation. Its ordering is retrieval relevance, not a
product recommendation: when multiple candidates remain, callers must ask
the user to select an article number rather than choosing one.
- `calculate_material_weight` calculates material-only weight from roll length,
width, and area weight. It requires no core diameter, does not infer one, and
cannot return a roll diameter or a core-inclusive total weight.
- `calculate_roll_diameter` uses `roll_length_m` for the material length on one
roll. Diameter and thickness inputs are in mm; `width_m` is in m;
`area_weight_g_m2` is in g/m². It always requests the available kilogram
result and, on success, returns `transport_roll_inputs`, the browser-equivalent
transport bundle.
`area_weight_g_m2` is in g/m². It requires a known positive core diameter;
use `calculate_material_weight` when the core is unknown and only material
weight is needed. On success, it returns `transport_roll_inputs`, the
browser-equivalent transport bundle.
- `analyze_transport_capacity` uses roll/core diameters in mm; roll width and
transport dimensions in m; and roll/payload weights in kg.
`product_length_m` is the material length represented by one roll, used only