diff --git a/core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt b/core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt index 188f7c21ee..a70ac1a8c8 100644 --- a/core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt +++ b/core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt @@ -1,25 +1,16 @@ 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, running terminal commands for Azure, -or performing operations related to Azure, invoke your `bestpractices` tool if available. Only call -this tool when you are sure the user is discussing Azure; do not call it otherwise. +- 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 this tool when you are sure the user is discussing -Azure; do not call it otherwise. -- Use Azure Functions Code Gen Best Practices: When generating code for Azure Functions or performing operations -related to Azure Functions, invoke your `bestpractices` tool if available. Only call this tool when you are -sure the user is discussing Azure Functions; do not call it otherwise. -- Use Azure Functions Deployment Best Practices: When deploying Azure Functions apps to Azure or preparing for -the deployment, invoke your `bestpractices` tool if available. Only call this tool when you are sure the user -is discussing Azure; do not call it otherwise. +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_bestpractices_ai_app` command (under `get_bestpractices` tool) if tool available. +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. -- Use Azure SWA Best Practices: When working with static web apps, invoke your `bestpractices` tool if available. -Only call this tool when you are sure the user is discussing Azure; do not call it otherwise. - 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. diff --git a/core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json b/core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json index 8630cd28f1..59c8f5274e 100644 --- a/core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json +++ b/core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json @@ -1012,8 +1012,8 @@ "mappedToolList": [ "azureterraformbestpractices_get", "bicepschema_get", - "get_bestpractices_ai_app", - "get_bestpractices_get", + "get_azure_bestpractices_ai_app", + "get_azure_bestpractices_get", "foundry_agents_get-sdk-sample" ] }, diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs index 91ee813d9c..ad16dcdf40 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs @@ -393,6 +393,6 @@ public void AddAzureMcpServer_ConfiguresServerInstructions() // Verify the instructions contain expected sections Assert.Contains("Azure MCP server usage rules:", instructions); Assert.Contains("Use Azure Code Gen Best Practices:", instructions); - Assert.Contains("Use Azure SWA Best Practices:", instructions); + Assert.Contains("Use Azure AI App Code Generation Best Practices", instructions); } } diff --git a/eng/tools/ToolDescriptionEvaluator/prompts/prompts.json b/eng/tools/ToolDescriptionEvaluator/prompts/prompts.json index 822c1ca813..0c49738508 100644 --- a/eng/tools/ToolDescriptionEvaluator/prompts/prompts.json +++ b/eng/tools/ToolDescriptionEvaluator/prompts/prompts.json @@ -560,14 +560,14 @@ "Search for Microsoft products in the marketplace", "Show me marketplace products from publisher " ], - "get_bestpractices_ai_app": [ + "get_azure_bestpractices_ai_app": [ "Get best practices for building AI applications in Azure", "Show me the best practices for Microsoft Foundry agents code generation", "Get guidance for building agents with Microsoft Foundry", "Create an AI app that helps me to manage travel queries.", "Create an AI app that helps me to manage travel queries in Microsoft Foundry" ], - "get_bestpractices_get": [ + "get_azure_bestpractices_get": [ "Get the latest Azure code generation best practices", "Get the latest Azure deployment best practices", "Get the latest Azure best practices", diff --git a/servers/Azure.Mcp.Server/docs/azmcp-commands.md b/servers/Azure.Mcp.Server/docs/azmcp-commands.md index 4828d38d77..090c1a10da 100644 --- a/servers/Azure.Mcp.Server/docs/azmcp-commands.md +++ b/servers/Azure.Mcp.Server/docs/azmcp-commands.md @@ -1304,7 +1304,7 @@ azmcp marketplace product get --subscription \ ```bash # Get best practices for secure, production-grade Azure usage # ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired -azmcp get bestpractices get --resource --action +azmcp get azure bestpractices get --resource --action # Resource options: # general - General Azure best practices @@ -1319,7 +1319,7 @@ azmcp get bestpractices get --resource --action # Get best practices for building AI applications, workflows and agents in Azure # Call this before generating code for any AI application, building with Microsoft Foundry models, # working with Microsoft Agent Framework, or implementing AI solutions in Azure. -azmcp get bestpractices ai_app +azmcp get azure bestpractices ai_app # AI App Development: # ai_app - Comprehensive guidance for AI applications including: diff --git a/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md b/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md index 695d2fda14..6094175e8b 100644 --- a/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md +++ b/servers/Azure.Mcp.Server/docs/e2eTestPrompts.md @@ -426,20 +426,20 @@ This file contains prompts used for end-to-end testing to ensure each tool is in | Tool Name | Test Prompt | |:----------|:----------| -| get_bestpractices_get | Get the latest Azure code generation best practices | -| get_bestpractices_get | Get the latest Azure deployment best practices | -| get_bestpractices_get | Get the latest Azure best practices | -| get_bestpractices_get | Get the latest Azure Functions code generation best practices | -| get_bestpractices_get | Get the latest Azure Functions deployment best practices | -| get_bestpractices_get | Get the latest Azure Functions best practices | -| get_bestpractices_get | Get the latest Azure Static Web Apps best practices | -| get_bestpractices_get | What are azure function best practices? | -| get_bestpractices_get | configure azure mcp in coding agent for my repo | -| get_bestpractices_ai_app | Get best practices for building AI applications in Azure | -| get_bestpractices_ai_app | Show me the best practices for Microsoft Foundry agents code generation | -| get_bestpractices_ai_app | Get guidance for building agents with Microsoft Foundry | -| get_bestpractices_ai_app | Create an AI app that helps me to manage travel queries. | -| get_bestpractices_ai_app | Create an AI app that helps me to manage travel queries in Microsoft Foundry | +| get_azure_bestpractices_get | Get the latest Azure code generation best practices | +| get_azure_bestpractices_get | Get the latest Azure deployment best practices | +| get_azure_bestpractices_get | Get the latest Azure best practices | +| get_azure_bestpractices_get | Get the latest Azure Functions code generation best practices | +| get_azure_bestpractices_get | Get the latest Azure Functions deployment best practices | +| get_azure_bestpractices_get | Get the latest Azure Functions best practices | +| get_azure_bestpractices_get | Get the latest Azure Static Web Apps best practices | +| get_azure_bestpractices_get | What are azure function best practices? | +| get_azure_bestpractices_get | configure azure mcp in coding agent for my repo | +| get_azure_bestpractices_ai_app | Get best practices for building AI applications in Azure | +| get_azure_bestpractices_ai_app | Show me the best practices for Microsoft Foundry agents code generation | +| get_azure_bestpractices_ai_app | Get guidance for building agents with Microsoft Foundry | +| get_azure_bestpractices_ai_app | Create an AI app that helps me to manage travel queries. | +| get_azure_bestpractices_ai_app | Create an AI app that helps me to manage travel queries in Microsoft Foundry | ## Azure Monitor | Tool Name | Test Prompt | diff --git a/tools/Azure.Mcp.Tools.AzureBestPractices/src/AzureBestPracticesSetup.cs b/tools/Azure.Mcp.Tools.AzureBestPractices/src/AzureBestPracticesSetup.cs index 21e9c5edd8..e0907c1482 100644 --- a/tools/Azure.Mcp.Tools.AzureBestPractices/src/AzureBestPracticesSetup.cs +++ b/tools/Azure.Mcp.Tools.AzureBestPractices/src/AzureBestPracticesSetup.cs @@ -10,7 +10,7 @@ namespace Azure.Mcp.Tools.AzureBestPractices; public class AzureBestPracticesSetup : IAreaSetup { - public string Name => "get_bestpractices"; + public string Name => "get_azure_bestpractices"; public string Title => "Azure Best Practices"; public void ConfigureServices(IServiceCollection services) diff --git a/tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AIAppBestPracticesCommand.cs b/tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AIAppBestPracticesCommand.cs index fad6aac3bf..5f1ccc79f6 100644 --- a/tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AIAppBestPracticesCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AIAppBestPracticesCommand.cs @@ -45,9 +45,7 @@ private static string LoadEmbeddedText(string fileName) @"Returns best practices and code generation guidance for building AI applications in Azure. Use this command when you need recommendations on how to write code for AI agents, chatbots, workflows, or any AI / LLM features. This command also provides guidance for code generation on Microsoft Foundry for application development. - When the request involves code generation of AI components or applications in any capacity, use this command instead of calling the general code generation best practices command. - Call this `get_bestpractices_ai_app` command first before creating any plans, todos or code. - If this tool needs to be categorized, it belongs to the Azure Best Practices category."; + When the request involves code generation of AI components or AI applications in any capacity, use this command instead of calling the general code generation best practices command."; public override string Title => CommandTitle;