From 93403ccb2ce181f4c6f257719c08814904535873 Mon Sep 17 00:00:00 2001 From: Victor Colin Amador Date: Thu, 19 Mar 2026 22:00:23 -0700 Subject: [PATCH 1/6] Updated CLI extension command descriptions --- tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs | 5 +---- .../src/Commands/CliGenerateCommand.cs | 2 +- .../src/Commands/CliInstallCommand.cs | 2 +- tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs | 6 +++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs b/tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs index e76bcbc738..62839dd3ec 100644 --- a/tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs +++ b/tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs @@ -32,10 +32,7 @@ public sealed class AzqrCommand(ILogger logger, ISubscriptionServic public override string Description => """ - Runs Azure Quick Review CLI (azqr) commands to generate compliance/security reports for Azure resources. - This tool should be used when the user wants to identify any non-compliant configurations or areas for improvement in their Azure resources. - Requires a subscription id and optionally a resource group name. Returns the generated report file's path. - Note that Azure Quick Review CLI (azqr) is different from Azure CLI (az). + Runs Azure Quick Review CLI (azqr) commands to generate compliance and security reports for Azure resources, identifying non-compliant configurations or areas for improvement. Requires a subscription id and optionally a resource group name. Returns the generated report file path. Note: azqr is different from Azure CLI (az). """; public override string Title => CommandTitle; diff --git a/tools/Azure.Mcp.Tools.Extension/src/Commands/CliGenerateCommand.cs b/tools/Azure.Mcp.Tools.Extension/src/Commands/CliGenerateCommand.cs index b0403682eb..2290c5c373 100644 --- a/tools/Azure.Mcp.Tools.Extension/src/Commands/CliGenerateCommand.cs +++ b/tools/Azure.Mcp.Tools.Extension/src/Commands/CliGenerateCommand.cs @@ -24,7 +24,7 @@ public sealed class CliGenerateCommand(ILogger logger, ICliG public override string Description => """ - This tool can generate Azure CLI commands to be used with the corresponding CLI tool to accomplish a goal described by the user. This tool incorporates knowledge of the CLI tool beyond what the LLM knows. Always use this tool to generate the CLI command when the user asks for such CLI commands or wants to use the CLI tool to accomplish something. + Generate Azure CLI (az) commands used to accomplish a goal described by the user. This tool incorporates CLI knowledge beyond what you know. Use this tool when the user asks for Azure CLI commands or wants to use the Azure CLI to accomplish something. """; public override string Title => CommandTitle; diff --git a/tools/Azure.Mcp.Tools.Extension/src/Commands/CliInstallCommand.cs b/tools/Azure.Mcp.Tools.Extension/src/Commands/CliInstallCommand.cs index d8df461eb3..614d210146 100644 --- a/tools/Azure.Mcp.Tools.Extension/src/Commands/CliInstallCommand.cs +++ b/tools/Azure.Mcp.Tools.Extension/src/Commands/CliInstallCommand.cs @@ -24,7 +24,7 @@ public sealed class CliInstallCommand(ILogger logger, ICliIns public override string Description => """ - This tool can provide installation instructions for the specified CLI tool among Azure CLI (az), Azure Developer CLI (azd) and Azure Functions Core Tools CLI (func). It incorporates knowledge of the CLI tool beyond what the LLM knows. Use this tool to get installation instructions if you attempt to use the CLI tool but it isn't installed. + Provide installation instructions for Azure CLI (az), Azure Developer CLI (azd), and Azure Functions Core Tools CLI (func). This tool incorporates CLI knowledge beyond what you know. Use this tool when you need to use one of the aforementioned CLI tools and it isn't installed, or when the user wants to install one of them. """; public override string Title => CommandTitle; diff --git a/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs b/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs index 3616343e5c..1135f2062a 100644 --- a/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs +++ b/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs @@ -34,8 +34,8 @@ public CommandGroup RegisterCommands(IServiceProvider serviceProvider) bool exposeExternalProcessCommands = ShouldExposeExternalProcessCommands(serviceProvider); string description = exposeExternalProcessCommands - ? "Extension commands for additional Azure tooling functionality. Includes running Azure Quick Review (azqr) commands directly from the MCP server to get service recommendations, generating Azure CLI commands from user intent, and getting installation instructions for Azure CLI, Azure Developer CLI and Azure Core Function Tools CLI." - : "Extension commands for additional Azure tooling functionality. Includes generating Azure CLI commands from user intent, and getting installation instructions for Azure CLI, Azure Developer CLI and Azure Core Function Tools CLI."; + ? "Extension commands for CLI tooling related to Azure. Includes running Azure Quick Review (azqr) for compliance reports, generating Azure CLI commands from user intent, and providing installation instructions for Azure CLI (az), Azure Developer CLI (azd), and Azure Functions Core Tools (func)." + : "Extension commands for CLI tooling related to Azure. Includes generating Azure CLI commands from user intent and providing installation instructions for Azure CLI (az), Azure Developer CLI (azd), and Azure Functions Core Tools (func)."; var extension = new CommandGroup(Name, description, Title); @@ -45,7 +45,7 @@ public CommandGroup RegisterCommands(IServiceProvider serviceProvider) extension.AddCommand(azqr.Name, azqr); } - var cli = new CommandGroup("cli", "Commands for helping users to use CLI tools for Azure services operations. Includes operations for generating Azure CLI commands and getting installation instructions for Azure CLI, Azure Developer CLI and Azure Core Function Tools CLI."); + var cli = new CommandGroup("cli", "Commands for helping users to use CLI tools for Azure services operations. Includes operations for generating Azure CLI commands and getting installation instructions for Azure CLI (az), Azure Developer CLI (azd), and Azure Core Function Tools CLI (func)."); extension.AddSubGroup(cli); var cliGenerateCommand = serviceProvider.GetRequiredService(); cli.AddCommand(cliGenerateCommand.Name, cliGenerateCommand); From 3348c9fae1cbf608929b8e528ff2973feb378e0c Mon Sep 17 00:00:00 2001 From: Victor Colin Amador Date: Thu, 19 Mar 2026 22:00:47 -0700 Subject: [PATCH 2/6] Updated `azure-rules.txt` to disambiguate fro `bestpractices` --- .../src/Resources/azure-rules.txt | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt b/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt index a70ac1a8c8..d116e26ffc 100644 --- a/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt +++ b/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt @@ -1,18 +1,9 @@ Azure MCP server usage rules: - Use Azure Tools: When handling requests related to Azure, always use your tools. -- Use Azure Code Gen Best Practices: When generating code for Azure or any Azure services, running terminal commands for Azure, -or performing operations related to Azure, invoke your `bestpractices` tool if available. -- Use Azure Deployment Best Practices: When deploying to Azure or preparing applications for deployment to Azure, -invoke your `bestpractices` tool if available. +- If a user wants to use, install, or generate commands for the Azure CLI (az), Azure Developer CLI (azd), Azure Functions Core Tools CLI (func), or Azure Quick Review CLI (azqr), use your `extension` tools first. +- Use Azure Code Gen Best Practices: When generating code for Azure or any Azure services, running terminal commands for Azure, or performing operations related to Azure, invoke your `bestpractices` tool if available. +- Use Azure Deployment Best Practices: When deploying to Azure or preparing applications for deployment to Azure, invoke your `bestpractices` tool if available. - Only call your `bestpractices` tool when you are sure the user is discussing Azure; do not call it otherwise. -- Use Azure AI App Code Generation Best Practices: When generating code for AI applications, AI agents, workflows, -or chatbots, invoke your `get_azure_bestpractices_ai_app` command (under `get_azure_bestpractices` tool) if tool available. -Call this tool first before creating any plans, todos or code. -Only call this command when the user is discussing AI app development with Microsoft Foundry, Azure, Microsoft -agent framework SDK, or without specifying any technology. Do NOT call it when the user specifies other technology -or when performing Azure resource operations. -- Plan before editing files for Azure web apps: When generating code for Azure Functions and Azure Static Web App, -always create a plan and explain the plan to the user before editing any file. Proceed with editing the files -after getting consent from the user. -- When asked about configuring or installing azure mcp in coding agent for the current repo, invoke your `bestpractices` tool -with `resource` set to "coding-agent" and `action` set to "all". \ No newline at end of file +- Use Azure AI App Code Generation Best Practices: When generating code for AI applications, AI agents, workflows, or chatbots, invoke your `get_azure_bestpractices_ai_app` command (under `get_azure_bestpractices` tool) if tool available. Call this tool first before creating any plans, todos or code. Only call this command when the user is discussing AI app development with Microsoft Foundry, Azure, Microsoft agent framework SDK, or without specifying any technology. Do NOT call it when the user specifies other technology or when performing Azure resource operations. +- Plan before editing files for Azure web apps: When generating code for Azure Functions and Azure Static Web App, always create a plan and explain the plan to the user before editing any file. Proceed with editing the files after getting consent from the user. +- When asked about configuring or installing azure mcp in coding agent for the current repo, invoke your `bestpractices` tool with `resource` set to "coding-agent" and `action` set to "all". \ No newline at end of file From 28d312747ab596be3a48454231b42c744e5faeee Mon Sep 17 00:00:00 2001 From: Victor Colin Amador Date: Thu, 19 Mar 2026 22:00:59 -0700 Subject: [PATCH 3/6] Updated prompts for manual testing --- servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md b/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md index 112a3d153a..2fc86f99ee 100644 --- a/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md +++ b/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md @@ -132,10 +132,10 @@ This file contains prompts used for end-to-end testing to ensure each tool is in | Tool Name | Test Prompt | |:----------|:----------| -| extension_cli_generate | Create a Storage account with name using Azure CLI | +| extension_cli_generate | What's the Azure CLI command for getting a storage account's details? | | extension_cli_generate | List all virtual machines in my subscription using Azure CLI | -| extension_cli_generate | Show me the details of the storage account with Azure CLI commands | -| extension_cli_install | | +| extension_cli_generate | Show me the details of the storage account using Azure CLI commands | +| extension_cli_install | \ | | extension_cli_install | How to install azd | | extension_cli_install | What is Azure Functions Core tools and how to install it | From b52eb381384a8b95e633306ddc68e91e8fc8fd17 Mon Sep 17 00:00:00 2001 From: Victor Colin Amador Date: Thu, 19 Mar 2026 22:06:36 -0700 Subject: [PATCH 4/6] Added changelog entry --- servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml diff --git a/servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml b/servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml new file mode 100644 index 0000000000..fbecde8af7 --- /dev/null +++ b/servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml @@ -0,0 +1,4 @@ +pr: 2131 +changes: + - section: "Breaking Changes" + description: "Improved descriptions of the `extension_azqr`, `extension_cli_generate`, and `extension_cli_install` tools, as well as the base Azure rules around them fed to agents for better tool selection." \ No newline at end of file From 787a7b8b5cc8ae70d14d9a57c99356956c1d6216 Mon Sep 17 00:00:00 2001 From: Victor Colin Amador Date: Thu, 19 Mar 2026 22:08:13 -0700 Subject: [PATCH 5/6] Removed trailing white spaces --- servers/Azure.Mcp.Server/src/Resources/azure-rules.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt b/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt index d116e26ffc..2166feb8c2 100644 --- a/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt +++ b/servers/Azure.Mcp.Server/src/Resources/azure-rules.txt @@ -1,8 +1,8 @@ Azure MCP server usage rules: - Use Azure Tools: When handling requests related to Azure, always use your tools. - If a user wants to use, install, or generate commands for the Azure CLI (az), Azure Developer CLI (azd), Azure Functions Core Tools CLI (func), or Azure Quick Review CLI (azqr), use your `extension` tools first. -- Use Azure Code Gen Best Practices: When generating code for Azure or any Azure services, running terminal commands for Azure, or performing operations related to Azure, invoke your `bestpractices` tool if available. -- Use Azure Deployment Best Practices: When deploying to Azure or preparing applications for deployment to Azure, invoke your `bestpractices` tool if available. +- Use Azure Code Gen Best Practices: When generating code for Azure or any Azure services, running terminal commands for Azure, or performing operations related to Azure, invoke your `bestpractices` tool if available. +- Use Azure Deployment Best Practices: When deploying to Azure or preparing applications for deployment to Azure, invoke your `bestpractices` tool if available. - Only call your `bestpractices` tool when you are sure the user is discussing Azure; do not call it otherwise. - Use Azure AI App Code Generation Best Practices: When generating code for AI applications, AI agents, workflows, or chatbots, invoke your `get_azure_bestpractices_ai_app` command (under `get_azure_bestpractices` tool) if tool available. Call this tool first before creating any plans, todos or code. Only call this command when the user is discussing AI app development with Microsoft Foundry, Azure, Microsoft agent framework SDK, or without specifying any technology. Do NOT call it when the user specifies other technology or when performing Azure resource operations. - Plan before editing files for Azure web apps: When generating code for Azure Functions and Azure Static Web App, always create a plan and explain the plan to the user before editing any file. Proceed with editing the files after getting consent from the user. From 34d3372e590b413d41b95f28a26255a6269cc8dc Mon Sep 17 00:00:00 2001 From: vcolin7 Date: Fri, 20 Mar 2026 13:40:02 -0700 Subject: [PATCH 6/6] Update 1773983185044.yaml --- servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml b/servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml index fbecde8af7..f8634b56b9 100644 --- a/servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml +++ b/servers/Azure.Mcp.Server/changelog-entries/1773983185044.yaml @@ -1,4 +1,4 @@ pr: 2131 changes: - - section: "Breaking Changes" - description: "Improved descriptions of the `extension_azqr`, `extension_cli_generate`, and `extension_cli_install` tools, as well as the base Azure rules around them fed to agents for better tool selection." \ No newline at end of file + - section: "Other Changes" + description: "Improved descriptions of the `extension_azqr`, `extension_cli_generate`, and `extension_cli_install` tools, as well as the base Azure rules around them fed to agents for better tool selection."