Fix Pricing Table / custom properties handling#7
Merged
Conversation
…meters Enable passing LM-specific parameters like 'skudef' and 'skus' through a general custom_properties mechanism. This allows: - Creating ProductModules with PricingTable model and SKU definitions via skudef - Creating/updating LicenseTemplates with pricing plan configurations via skus - Passing any other custom properties as key-value pairs Updated tools: - netlicensing_create_product_module: added custom_properties parameter - netlicensing_update_product_module: added custom_properties parameter - netlicensing_create_license_template: added custom_properties parameter - netlicensing_update_license_template: added custom_properties parameter Updated helper functions: - product_modules.create_product_module() - product_modules.update_product_module() - license_templates.create_license_template() - license_templates.update_license_template() Fixes: NetLicensing-MCP refusing to create PricingTable entities due to missing support for LM-specific parameters. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
TODO: Review and update README.md and pyproject.toml to ensure the project is fully managed with uv and follows current uv project conventions.
There was a problem hiding this comment.
Pull request overview
This PR adds support for passing arbitrary NetLicensing custom properties (needed for PricingTable-related fields like skudef / skus) through the MCP server into the underlying tool payloads, and extends tests accordingly. It also updates server documentation around include_raw behavior and adds a VS Code pytest configuration.
Changes:
- Add
custom_properties: dict[str, str] | Noneto ProductModule and LicenseTemplate create/update tool functions and wire it through the MCP tool wrappers. - Extend unit tests to assert custom properties are included in the request payload.
- Update
include_rawdocumentation text and add.vscode/settings.jsonplus a.gitignoreentry for a local Claude Desktop config symlink.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_tools.py |
Adds coverage asserting custom properties are forwarded into request payloads. |
src/netlicensing_mcp/tools/product_modules.py |
Adds custom_properties payload merging for ProductModule create/update. |
src/netlicensing_mcp/tools/license_templates.py |
Adds custom_properties payload merging for LicenseTemplate create/update. |
src/netlicensing_mcp/server.py |
Wires custom_properties through MCP tool wrappers; updates include_raw docs wording. |
.vscode/settings.json |
Enables pytest configuration for local VS Code usage. |
.gitignore |
Ignores a local, regenerable Claude Desktop config symlink. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
r-brown
approved these changes
Jun 24, 2026
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
src/netlicensing_mcp/server.py:1201
netlicensing_update_license_templateonly treatsprice/currency/activeas “sensitive” when they are passed via explicit parameters. Right now a caller can bypass the confirmation-token flow by setting these fields viacustom_properties(e.g.custom_properties={"price": "0.01"}), which would update revenue/availability-impacting fields without confirmation.
try:
sensitive = price is not None or bool(currency) or active is not None
Comment on lines
+44
to
46
| from netlicensing_mcp.tools.helpers import CustomPropertyValue | ||
|
|
||
| # Configure logging to output to stdout |
Comment on lines
121
to
124
| if node_secret_mode is not None: | ||
| data["nodeSecretMode"] = node_secret_mode | ||
| merge_custom_properties(data, custom_properties) | ||
| return await nl_post(f"/productmodule/{module_number}", data) |
Comment on lines
5
to
+6
| from netlicensing_mcp.client import nl_delete, nl_get, nl_post | ||
| from netlicensing_mcp.tools.helpers import CustomPropertyValue, merge_custom_properties |
Comment on lines
151
to
156
| if quantity is not None: | ||
| data["quantity"] = str(quantity) | ||
| if grace_period is not None: | ||
| data["gracePeriod"] = str(grace_period).lower() | ||
| merge_custom_properties(data, custom_properties) | ||
| return await nl_post(f"/licensetemplate/{template_number}", data) |
Comment on lines
+765
to
+776
| @pytest.mark.asyncio | ||
| async def test_update_license_template_custom_properties_conflict(): | ||
| from netlicensing_mcp.client import NetLicensingError | ||
| from netlicensing_mcp.tools.license_templates import update_license_template | ||
|
|
||
| with pytest.raises(NetLicensingError) as exc_info: | ||
| await update_license_template( | ||
| "LT01", | ||
| price=29.99, | ||
| custom_properties={"price": "0.01"}, | ||
| ) | ||
| assert "price" in str(exc_info.value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.