Skip to content

Fix Pricing Table / custom properties handling#7

Merged
kkorotkov merged 9 commits into
masterfrom
feature/custom-properties-support
Jun 24, 2026
Merged

Fix Pricing Table / custom properties handling#7
kkorotkov merged 9 commits into
masterfrom
feature/custom-properties-support

Conversation

@kkorotkov

Copy link
Copy Markdown
Member

No description provided.

kkorotkov and others added 5 commits June 23, 2026 16:01
…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.
@kkorotkov kkorotkov self-assigned this Jun 24, 2026
@github-actions github-actions Bot added enhancement New feature or request mcp MCP tools/prompts labels Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] | None to 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_raw documentation text and add .vscode/settings.json plus a .gitignore entry 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.

Comment thread src/netlicensing_mcp/tools/product_modules.py Outdated
Comment thread src/netlicensing_mcp/tools/product_modules.py Outdated
Comment thread src/netlicensing_mcp/tools/license_templates.py Outdated
Comment thread src/netlicensing_mcp/tools/license_templates.py Outdated
Comment thread src/netlicensing_mcp/server.py
Comment thread src/netlicensing_mcp/server.py Outdated
Comment thread src/netlicensing_mcp/server.py Outdated
Comment thread src/netlicensing_mcp/server.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 8 changed files in this pull request and generated 10 comments.

Comment thread src/netlicensing_mcp/tools/helpers.py Outdated
Comment thread tests/test_tools.py Outdated
Comment thread src/netlicensing_mcp/tools/product_modules.py Outdated
Comment thread src/netlicensing_mcp/tools/product_modules.py Outdated
Comment thread src/netlicensing_mcp/tools/license_templates.py Outdated
Comment thread src/netlicensing_mcp/tools/license_templates.py Outdated
Comment thread src/netlicensing_mcp/server.py Outdated
Comment thread src/netlicensing_mcp/server.py Outdated
Comment thread src/netlicensing_mcp/server.py Outdated
Comment thread src/netlicensing_mcp/server.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_template only treats price/currency/active as “sensitive” when they are passed via explicit parameters. Right now a caller can bypass the confirmation-token flow by setting these fields via custom_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 thread tests/test_tools.py
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)
@kkorotkov kkorotkov merged commit 15703c9 into master Jun 24, 2026
13 checks passed
@kkorotkov kkorotkov deleted the feature/custom-properties-support branch June 24, 2026 09:58
@github-actions github-actions Bot added the bug Something isn't working label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request mcp MCP tools/prompts testing test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants