33from __future__ import annotations
44
55from netlicensing_mcp .client import nl_delete , nl_get , nl_post
6+ from netlicensing_mcp .tools .helpers import strip_output_fields
67
78
89async def list_products (filter_str : str | None = None ) -> dict :
@@ -13,12 +14,12 @@ async def list_products(filter_str: str | None = None) -> dict:
1314 params : dict [str , str ] = {}
1415 if filter_str :
1516 params ["filter" ] = filter_str
16- return await nl_get ("/product" , params or None )
17+ return strip_output_fields ( await nl_get ("/product" , params or None ) )
1718
1819
1920async def get_product (product_number : str ) -> dict :
2021 """Get a single product by its number."""
21- return await nl_get (f"/product/{ product_number } " )
22+ return strip_output_fields ( await nl_get (f"/product/{ product_number } " ) )
2223
2324
2425async def create_product (
@@ -38,6 +39,9 @@ async def create_product(
3839 vat_mode: GROSS | NET
3940 licensee_auto_create: if true, non-existing licensees are created on first validation.
4041 licensee_secret_mode: DISABLED | PREDEFINED | CLIENT
42+
43+ Note: 'logo' is intentionally not passed — omitting it avoids accidentally
44+ clearing an existing product logo on the NetLicensing server.
4145 """
4246 data : dict [str , str ] = {
4347 "number" : number ,
@@ -55,7 +59,7 @@ async def create_product(
5559 data ["vatMode" ] = vat_mode
5660 if licensee_secret_mode :
5761 data ["licenseeSecretMode" ] = licensee_secret_mode
58- return await nl_post ("/product" , data )
62+ return strip_output_fields ( await nl_post ("/product" , data ) )
5963
6064
6165async def update_product (
@@ -72,6 +76,9 @@ async def update_product(
7276 """Update fields of an existing product.
7377
7478 licensee_secret_mode: DISABLED | PREDEFINED | CLIENT
79+
80+ Note: 'logo' is intentionally not passed — omitting it preserves the
81+ existing product logo on the NetLicensing server.
7582 """
7683 data : dict [str , str ] = {}
7784 if name is not None :
@@ -90,7 +97,7 @@ async def update_product(
9097 data ["vatMode" ] = vat_mode
9198 if licensee_secret_mode is not None :
9299 data ["licenseeSecretMode" ] = licensee_secret_mode
93- return await nl_post (f"/product/{ product_number } " , data )
100+ return strip_output_fields ( await nl_post (f"/product/{ product_number } " , data ) )
94101
95102
96103async def delete_product (product_number : str , force_cascade : bool = False ) -> str :
0 commit comments