Migrate Device Registry tools to new tool design#3088
Merged
alzimmermsft merged 1 commit intoJul 18, 2026
Merged
Conversation
alzimmermsft
requested review from
RickWinter,
chidozieononiwu,
conniey,
hallipr,
msalaman,
saikoumudi and
xirzec
July 17, 2026 20:49
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the Azure.Mcp.Tools.DeviceRegistry toolset to the newer command/options pattern where CLI options are derived from [Option] / [OptionContainer] attributes, removing the legacy RegisterOptions / BindOptions and System.CommandLine dependency.
Changes:
- Converted
NamespaceListCommandto the two-genericSubscriptionCommand<TOptions, TResult>pattern and switched options binding to[Option]attributes. - Simplified Device Registry service/model JSON (property naming + source-gen context usage) and removed legacy option/command scaffolding (
*OptionDefinitions,Base*Command,System.CommandLineglobal using). - Updated unit tests to use
SubscriptionCommandUnitTestsBasefor the new command shape.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.Tests/Namespace/NamespaceListCommandTests.cs | Updates command test base class/imports to align with the new subscription command pattern. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/Models/DeviceRegistryNamespaceData.cs | Renames JSON-mapped properties and simplifies FromJson deserialization via source-gen context. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/DeviceRegistryService.cs | Removes logger/try-catch wrapper; keeps a direct ExecuteResourceQueryAsync call and updated model mapping. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/Namespace/NamespaceListOptions.cs | Replaces legacy base options with a flat [Option]-based options POCO. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/DeviceRegistryOptionDefinitions.cs | Removes legacy System.CommandLine option definition for namespace. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/BaseDeviceRegistryOptions.cs | Removes legacy base options class inheriting SubscriptionOptions. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Models/DeviceRegistryNamespaceInfo.cs | Removes explicit JsonPropertyName attributes from the public response model. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/GlobalUsings.cs | Removes System.CommandLine global using. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/Namespace/NamespaceListCommand.cs | Migrates command to SubscriptionCommand<TOptions, TResult> with attribute-bound options and source-gen response serialization. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/DeviceRegistryJsonContext.cs | Simplifies the source-gen context declaration and ensures result/model types are registered. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/BaseDeviceRegistryCommand.cs | Removes legacy subscription command base class. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Azure.Mcp.Tools.DeviceRegistry.csproj | Drops System.CommandLine package reference and adjusts the core project reference. |
| servers/Azure.Mcp.Server/changelog-entries/1784321301060.yaml | Adds a changelog entry for the Device Registry toolset change. |
conniey
approved these changes
Jul 17, 2026
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.
What does this PR do?
Migrates Device Registry tools to new design where Register and Bind options are based on
Optionattributes.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline