Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions eng/tools/ToolDescriptionEvaluator/prompts/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,14 @@
"Search for Microsoft products in the marketplace",
"Show me marketplace products from publisher <publisher_name>"
],
"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",
Expand Down
4 changes: 2 additions & 2 deletions servers/Azure.Mcp.Server/docs/azmcp-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ azmcp marketplace product get --subscription <subscription> \
```bash
# Get best practices for secure, production-grade Azure usage
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp get bestpractices get --resource <resource> --action <action>
azmcp get azure bestpractices get --resource <resource> --action <action>

# Resource options:
# general - General Azure best practices
Expand All @@ -1319,7 +1319,7 @@ azmcp get bestpractices get --resource <resource> --action <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:
Expand Down
28 changes: 14 additions & 14 deletions servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down