Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes and strengthens command-line validation across multiple MCP tools by moving input checks into System.CommandLine validators, simplifying response/result construction, and aligning JSON/option access patterns.
Changes:
- Added
command.Validators.Add(...)blocks to enforce required/compatible option combinations and removed equivalent runtime checks fromExecuteAsync. - Simplified result creation patterns (e.g.,
new(...), object initializers) and removed redundantStatus = OK/ empty message assignments where defaults already apply. - Updated Cosmos query validation to return error strings for validator consumption (instead of throwing) and adjusted tests accordingly.
Reviewed changes
Copilot reviewed 57 out of 57 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Table/TableNamespaceListCommand.cs | Adds option validators for workspace/item requirements; removes runtime 400 responses. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Table/TableNamespaceGetCommand.cs | Makes namespace required and adds validators; removes runtime validation. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Table/TableListCommand.cs | Makes namespace required and adds validators; removes runtime validation. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Table/TableGetCommand.cs | Makes namespace required and adds validators; removes runtime validation. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Table/TableConfigGetCommand.cs | Adds validators for workspace/item requirements; removes runtime validation. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Item/OneLakeItemListDfsCommand.cs | Adds validator for workspace requirement; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Item/OneLakeItemListCommand.cs | Adds validator for workspace requirement; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Item/OneLakeItemDataListCommand.cs | Adds validator for workspace requirement; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/PathListCommand.cs | Adds workspace/item validators; uses null-forgiving where validated; simplifies result construction. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/FileWriteCommand.cs | Adds validators for workspace/item + mutually exclusive content sources + file existence; simplifies content selection. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/FileReadCommand.cs | Adds workspace/item validators; removes runtime ArgumentException and redundant OK status assignment. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/FileDeleteCommand.cs | Adds workspace/item validators; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/DirectoryDeleteCommand.cs | Adds workspace/item validators; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/DirectoryCreateCommand.cs | Adds workspace/item validators; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/BlobPutCommand.cs | Adds workspace/item validators; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/BlobListCommand.cs | Adds workspace/item validators; uses null-forgiving where validated; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/BlobGetCommand.cs | Adds workspace/item validators; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/File/BlobDeleteCommand.cs | Adds workspace/item validators; removes runtime ArgumentException. |
| tools/Fabric.Mcp.Tools.Core/src/Commands/ItemCreateCommand.cs | Adds validator requiring workspace identifier; removes runtime ArgumentException. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseRetrieveCommand.cs | Adds message parsing validation in the validator; makes ParseMessage static and adjusts error messages. |
| tools/Azure.Mcp.Tools.MySql/src/Commands/MySqlListCommand.cs | Adds validator for --database requiring --server; reorders validation vs binding; simplifies results. |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/SendBrownfieldAnalysisCommand.cs | Updates option retrieval to name-based lookup; removes redundant OK/message assignments. |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/OrchestratorStartCommand.cs | Updates option retrieval to name-based lookup; removes redundant OK/message assignments. |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/OrchestratorNextCommand.cs | Updates option retrieval to name-based lookup; removes redundant OK/message assignments. |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/ListLearningResourcesCommand.cs | Removes redundant OK/message assignments. |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/GetLearningResourceCommand.cs | Updates option retrieval to name-based lookup; removes redundant OK/message assignments. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsQueryCommand.cs | Normalizes raw string literal usage in Description. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsDefinitionsCommand.cs | Normalizes raw string literal usage in Description. |
| tools/Azure.Mcp.Tools.KeyVault/src/Commands/Admin/AdminSettingsGetCommand.cs | Simplifies ResponseResult.Create construction. |
| tools/Azure.Mcp.Tools.Functions/src/Commands/Template/TemplateGetCommand.cs | Removes redundant OK/message assignments; minor cleanup. |
| tools/Azure.Mcp.Tools.Functions/src/Commands/Project/ProjectGetCommand.cs | Removes redundant OK/message assignments; minor cleanup. |
| tools/Azure.Mcp.Tools.Functions/src/Commands/Language/LanguageListCommand.cs | Removes redundant OK/message assignments; minor cleanup. |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionUpdateCommand.cs | Simplifies result creation and record shape (relies on camelCase JSON context). |
| tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs | Simplifies result creation formatting. |
| tools/Azure.Mcp.Tools.Extension/src/Commands/CliInstallCommand.cs | Moves CLI type normalization/validation into validator; simplifies execute path and result creation. |
| tools/Azure.Mcp.Tools.Extension/src/Commands/CliGenerateCommand.cs | Moves CLI type validation into validator; simplifies execute path and result creation. |
| tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs | Removes redundant null-check and OK status assignment; uses null-forgiving where validated elsewhere. |
| tools/Azure.Mcp.Tools.Extension/src/Commands/AzCommand.cs | Removes redundant null-check; uses null-forgiving for validated option. |
| tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceUpdateCommand.cs | Simplifies result creation; removes redundant OK status assignment. |
| tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/Namespace/NamespaceListCommand.cs | Simplifies result creation; switches exception type patterns to unqualified RequestFailedException. |
| tools/Azure.Mcp.Tools.Deploy/src/Commands/Architecture/DiagramGenerateCommand.cs | Adds validator for required raw topology input; simplifies binding and deserialization flow. |
| tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.UnitTests/CosmosQueryValidatorTests.cs | Updates unit tests for string-returning validator method. |
| tools/Azure.Mcp.Tools.Cosmos/src/Validation/CosmosQueryValidator.cs | Changes validation API to return error message strings (or null) instead of throwing. |
| tools/Azure.Mcp.Tools.Cosmos/src/Commands/ItemQueryCommand.cs | Moves Cosmos SQL validation into command validator and removes runtime validation block. |
| tools/Azure.Mcp.Tools.ConfidentialLedger/src/Commands/Entries/LedgerEntryGetCommand.cs | Adds missing copyright/license header. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskUpdateCommand.cs | Simplifies result creation; switches exception type patterns to unqualified Azure types. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs | Adds option-combination validator; removes runtime ArgumentException checks; simplifies result creation; switches exception type patterns. |
| tools/Azure.Mcp.Tools.CloudArchitect/src/Commands/Design/DesignCommand.cs | Improves description formatting, adds validators, and adjusts JSON state deserialization handling. |
| tools/Azure.Mcp.Tools.AzureTerraformBestPractices/src/Commands/AzureTerraformBestPracticesGetCommand.cs | Removes redundant OK/message assignments. |
| tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/RequestCommand.cs | Simplifies result record and construction; removes runtime required-argument checks. |
| tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/GetGuidanceCommand.cs | Simplifies result record and construction. |
| tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/BestPracticesCommand.cs | Removes runtime null checks and makes helper methods static; relies on existing validator. |
| tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AIAppBestPracticesCommand.cs | Removes redundant OK/message assignments. |
| core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantService.cs | Simplifies null-check/throw patterns for tenant name/id resolution. |
| core/Azure.Mcp.Core/src/Services/Azure/ResourceGroup/ResourceGroupService.cs | Removes broad try/catch wrappers; simplifies return construction and caching flow. |
| core/Azure.Mcp.Core/src/Areas/Subscription/Commands/SubscriptionListCommand.cs | Simplifies result creation. |
| core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupListCommand.cs | Always returns an (possibly empty) list result rather than null results. |
tools/Fabric.Mcp.Tools.OneLake/src/Commands/Table/TableNamespaceGetCommand.cs
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.Deploy/src/Commands/Architecture/DiagramGenerateCommand.cs
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.CloudArchitect/src/Commands/Design/DesignCommand.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs
Outdated
Show resolved
Hide resolved
anuchandy
reviewed
Mar 17, 2026
tools/Azure.Mcp.Tools.Deploy/src/Commands/Architecture/DiagramGenerateCommand.cs
Show resolved
Hide resolved
tools/Fabric.Mcp.Tools.OneLake/src/Commands/Table/TableNamespaceGetCommand.cs
Show resolved
Hide resolved
anuchandy
approved these changes
Mar 18, 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?
Reviews tool
Commandfiles for validation and other miscellaneous inconsistencies with tool development guidelines.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabel/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline