From 6a4958c7e48118c90ee319bc32a80661177a99ac Mon Sep 17 00:00:00 2001 From: Achyuth Maddala Sitaram <66455292+achyuth-ms@users.noreply.github.com> Date: Thu, 6 Nov 2025 11:52:37 -0800 Subject: [PATCH 1/2] addressed tests bugs --- servers/Azure.Mcp.Server/CHANGELOG.md | 3 ++- tools/Azure.Mcp.Tools.Sql/src/Commands/BaseDatabaseCommand.cs | 3 ++- tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/Azure.Mcp.Server/CHANGELOG.md b/servers/Azure.Mcp.Server/CHANGELOG.md index cf965afbd8..63e2445b87 100644 --- a/servers/Azure.Mcp.Server/CHANGELOG.md +++ b/servers/Azure.Mcp.Server/CHANGELOG.md @@ -24,9 +24,10 @@ The Azure MCP Server updates automatically by default whenever a new release com ### Bugs Fixed +- Fixed test failures in CI for SQL commands for `BaseSqlCommand` (--server option) and `BaseDatabaseCommand` (--database option) by using `.AsRequired()` extension method for consistent validation. [[#943](https://github.com/microsoft/mcp/issues/943), [#1013](https://github.com/microsoft/mcp/issues/1013)] - Avoid spawning child processes per namespace for consolidated mode [[#1002](https://github.com/microsoft/mcp/pull/1002)] - Improvement to learning experience by ignoring `command` parameter, which resulted in neither learning nor a tool call to happen. Learning is now always invoked when `learn=true` is passed. [[#1057](https://github.com/microsoft/mcp/pull/1057)] -- Adds descriptions to the tools metadata, to ensure enough information is present in the cli to generate docs for metadata. [[#1043](https://github.com/microsoft/mcp/pull/1043)] +- Adds descriptions to the tools metadata, to ensure enough information is present in the cli to generate docs for metadata. [[#1043](https://github.com/microsoft/mcp/pull/1043)] ### Other Changes diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseDatabaseCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseDatabaseCommand.cs index df09c522ea..ef2d245dc0 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseDatabaseCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseDatabaseCommand.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using Azure.Mcp.Core.Commands; using Azure.Mcp.Core.Extensions; +using Azure.Mcp.Core.Models.Option; using Azure.Mcp.Tools.Sql.Options; using Microsoft.Extensions.Logging; @@ -16,7 +17,7 @@ public abstract class BaseDatabaseCommand< protected override void RegisterOptions(Command command) { base.RegisterOptions(command); - command.Options.Add(SqlOptionDefinitions.Database); + command.Options.Add(SqlOptionDefinitions.Database.AsRequired()); } protected override TOptions BindOptions(ParseResult parseResult) diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs index 9297f641dd..739963817c 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs @@ -21,7 +21,7 @@ protected override void RegisterOptions(Command command) { base.RegisterOptions(command); command.Options.Add(OptionDefinitions.Common.ResourceGroup.AsRequired()); - command.Options.Add(SqlOptionDefinitions.Server); + command.Options.Add(SqlOptionDefinitions.Server.AsRequired()); } protected override TOptions BindOptions(ParseResult parseResult) From 8e6001c54f103101991a622f329041e380135e6d Mon Sep 17 00:00:00 2001 From: Achyuth Maddala Sitaram <66455292+achyuth-ms@users.noreply.github.com> Date: Thu, 6 Nov 2025 14:38:15 -0800 Subject: [PATCH 2/2] revert to validate in CI pipeline --- tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs index 739963817c..9297f641dd 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/BaseSqlCommand.cs @@ -21,7 +21,7 @@ protected override void RegisterOptions(Command command) { base.RegisterOptions(command); command.Options.Add(OptionDefinitions.Common.ResourceGroup.AsRequired()); - command.Options.Add(SqlOptionDefinitions.Server.AsRequired()); + command.Options.Add(SqlOptionDefinitions.Server); } protected override TOptions BindOptions(ParseResult parseResult)