Skip to content

Commit 0936787

Browse files
authored
feat: add azure agent code gen best practice tool (#1031)
feat: add agent code gen best practice into azure mcp
1 parent 6099f33 commit 0936787

File tree

21 files changed

+3517
-2316
lines changed

21 files changed

+3517
-2316
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
# ServiceLabel: %tools-AppService
6666
# ServiceOwners: @ArthurMa1978 @weidongxu-microsoft
6767

68+
# PRLabel: %tools-AIBestPractices
69+
/tools/Azure.Mcp.Tools.AzureAIBestPractices/ @XiaofuHuang @microsoft/azure-mcp
70+
71+
# ServiceLabel: %tools-AIBestPractices
72+
# ServiceOwners: @XiaofuHuang
73+
6874
# PRLabel: %tools-BestPractices
6975
/tools/Azure.Mcp.Tools.AzureBestPractices/ @g2vinay @conniey @fanyang-mono @microsoft/azure-mcp
7076

AzureMcp.sln

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fabric.Mcp.Tools.PublicApi.
549549
EndProject
550550
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Mcp.Tools.Postgres.LiveTests", "tools\Azure.Mcp.Tools.Postgres\tests\Azure.Mcp.Tools.Postgres.LiveTests\Azure.Mcp.Tools.Postgres.LiveTests.csproj", "{BF0354AE-3748-A8DC-F79D-B21FDDEDDFAE}"
551551
EndProject
552+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Azure.Mcp.Tools.AzureAIBestPractices", "Azure.Mcp.Tools.AzureAIBestPractices", "{156D9C17-61FD-98D6-32C0-065B406D0434}"
553+
EndProject
554+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5D760DD8-DBA3-B865-9021-FDE8FD3497A8}"
555+
EndProject
556+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Mcp.Tools.AzureAIBestPractices", "tools\Azure.Mcp.Tools.AzureAIBestPractices\src\Azure.Mcp.Tools.AzureAIBestPractices.csproj", "{87C51120-6A0A-4D14-B644-1787DB6C6D6E}"
557+
EndProject
558+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{50124EEC-97B0-320E-80D4-8464D7692B22}"
559+
EndProject
560+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Mcp.Tools.AzureAIBestPractices.UnitTests", "tools\Azure.Mcp.Tools.AzureAIBestPractices\tests\Azure.Mcp.Tools.AzureAIBestPractices.UnitTests\Azure.Mcp.Tools.AzureAIBestPractices.UnitTests.csproj", "{BE8CFF4C-E536-43DB-9D01-001E9A052D37}"
552561
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{319B94CD-694C-16E8-9E3A-9577B99158DD}"
553562
EndProject
554563
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Mcp.Server.UnitTests", "servers\Azure.Mcp.Server\tests\Azure.Mcp.Server.UnitTests\Azure.Mcp.Server.UnitTests.csproj", "{ADF14627-FCB5-4BD3-B65F-DDCC3A3F727C}"
@@ -2087,6 +2096,30 @@ Global
20872096
{BF0354AE-3748-A8DC-F79D-B21FDDEDDFAE}.Release|x64.Build.0 = Release|Any CPU
20882097
{BF0354AE-3748-A8DC-F79D-B21FDDEDDFAE}.Release|x86.ActiveCfg = Release|Any CPU
20892098
{BF0354AE-3748-A8DC-F79D-B21FDDEDDFAE}.Release|x86.Build.0 = Release|Any CPU
2099+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2100+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
2101+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Debug|x64.ActiveCfg = Debug|Any CPU
2102+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Debug|x64.Build.0 = Debug|Any CPU
2103+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Debug|x86.ActiveCfg = Debug|Any CPU
2104+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Debug|x86.Build.0 = Debug|Any CPU
2105+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
2106+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Release|Any CPU.Build.0 = Release|Any CPU
2107+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Release|x64.ActiveCfg = Release|Any CPU
2108+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Release|x64.Build.0 = Release|Any CPU
2109+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Release|x86.ActiveCfg = Release|Any CPU
2110+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E}.Release|x86.Build.0 = Release|Any CPU
2111+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2112+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Debug|Any CPU.Build.0 = Debug|Any CPU
2113+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Debug|x64.ActiveCfg = Debug|Any CPU
2114+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Debug|x64.Build.0 = Debug|Any CPU
2115+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Debug|x86.ActiveCfg = Debug|Any CPU
2116+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Debug|x86.Build.0 = Debug|Any CPU
2117+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Release|Any CPU.ActiveCfg = Release|Any CPU
2118+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Release|Any CPU.Build.0 = Release|Any CPU
2119+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Release|x64.ActiveCfg = Release|Any CPU
2120+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Release|x64.Build.0 = Release|Any CPU
2121+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Release|x86.ActiveCfg = Release|Any CPU
2122+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37}.Release|x86.Build.0 = Release|Any CPU
20902123
{ADF14627-FCB5-4BD3-B65F-DDCC3A3F727C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20912124
{ADF14627-FCB5-4BD3-B65F-DDCC3A3F727C}.Debug|Any CPU.Build.0 = Debug|Any CPU
20922125
{ADF14627-FCB5-4BD3-B65F-DDCC3A3F727C}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -2373,6 +2406,11 @@ Global
23732406
{294AC723-70DA-F50A-2C7A-AC6C0AEA0A62} = {9072C7AF-9EB2-E481-3974-77957587AC76}
23742407
{D3F46C2D-3AFD-FD9C-9C6A-180B1514DD2F} = {294AC723-70DA-F50A-2C7A-AC6C0AEA0A62}
23752408
{BF0354AE-3748-A8DC-F79D-B21FDDEDDFAE} = {37B0CE47-14C8-F5BF-BDDD-13EEBE580A88}
2409+
{156D9C17-61FD-98D6-32C0-065B406D0434} = {07C2787E-EAC7-C090-1BA3-A61EC2A24D84}
2410+
{5D760DD8-DBA3-B865-9021-FDE8FD3497A8} = {156D9C17-61FD-98D6-32C0-065B406D0434}
2411+
{87C51120-6A0A-4D14-B644-1787DB6C6D6E} = {5D760DD8-DBA3-B865-9021-FDE8FD3497A8}
2412+
{50124EEC-97B0-320E-80D4-8464D7692B22} = {156D9C17-61FD-98D6-32C0-065B406D0434}
2413+
{BE8CFF4C-E536-43DB-9D01-001E9A052D37} = {50124EEC-97B0-320E-80D4-8464D7692B22}
23762414
{319B94CD-694C-16E8-9E3A-9577B99158DD} = {F7E192D1-DE6C-42A2-B52F-02849D482450}
23772415
{ADF14627-FCB5-4BD3-B65F-DDCC3A3F727C} = {319B94CD-694C-16E8-9E3A-9577B99158DD}
23782416
EndGlobalSection

core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ sure the user is discussing Azure Functions; do not call it otherwise.
1212
- Use Azure Functions Deployment Best Practices: When deploying Azure Functions apps to Azure or preparing for
1313
the deployment, invoke your `bestpractices` tool if available. Only call this tool when you are sure the user
1414
is discussing Azure; do not call it otherwise.
15+
- Use Azure AI Code Generation Best Practices: When generating code for AI applications, AI agents, workflows,
16+
or chatbots in Azure, invoke your `azureaibestpractices` tool if available. Only call this tool when you are sure
17+
the user is discussing Azure and code generation; do not call it for Azure resource operations.
1518
- Use Azure SWA Best Practices: When working with static web apps, invoke your `bestpractices` tool if available.
1619
Only call this tool when you are sure the user is discussing Azure; do not call it otherwise.
1720
- Plan before editing files for Azure web apps: When generating code for Azure Functions and Azure Static Web App,

core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@
982982
},
983983
{
984984
"name": "get_azure_best_practices",
985-
"description": "Retrieve Azure best practices and infrastructure schema for code generation, deployment, and operations. Covers general Azure practices, Azure Functions best practices, Terraform configurations, Bicep template schemas, deployment best practices and AI Foundry sdk code samples.",
985+
"description": "Retrieve Azure best practices and infrastructure schema for code generation, deployment, and operations. Covers general Azure practices, Azure Functions best practices, AI app development best practices, Terraform configurations, Bicep template schemas, deployment best practices and AI Foundry sdk code samples.",
986986
"toolMetadata": {
987987
"destructive": {
988988
"value": false,
@@ -1010,6 +1010,7 @@
10101010
}
10111011
},
10121012
"mappedToolList": [
1013+
"azureaibestpractices_get",
10131014
"azureterraformbestpractices_get",
10141015
"bicepschema_get",
10151016
"get_bestpractices_get",

eng/tools/ToolDescriptionEvaluator/prompts.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,24 @@
99
"List all agents in my Azure AI Foundry resource",
1010
"Show me the available agents in my Azure AI Foundry resource"
1111
],
12+
"foundry_agents_create": [
13+
"Create a new Azure AI Foundry agent using instructions in the active editor"
14+
],
1215
"foundry_agents_query-and-evaluate": [
1316
"Query and evaluate an agent in my Azure AI Foundry resource for task_adherence"
1417
],
18+
"foundry_agents_get-sdk-sample": [
19+
"Create a CLI app that can talk to an Azure AI Foundry Agent using Python SDK"
20+
],
21+
"foundry_threads_create": [
22+
"Create an Azure AI Foundry thread to hold the conversation"
23+
],
24+
"foundry_threads_list": [
25+
"List my AI Foundry threads"
26+
],
27+
"foundry_threads_get-messages": [
28+
"Show me the messages in the AI Foundry thread with id <thread_id>"
29+
],
1530
"foundry_knowledge_index_list": [
1631
"List all knowledge indexes in my AI Foundry project",
1732
"Show me the knowledge indexes in my AI Foundry project"
@@ -526,6 +541,13 @@
526541
"Search for Microsoft products in the marketplace",
527542
"Show me marketplace products from publisher <publisher_name>"
528543
],
544+
"azureaibestpractices_get": [
545+
"Get best practices for building AI applications in Azure",
546+
"Show me the best practices for Azure AI Foundry agents code generation",
547+
"Get guidance for building agents with Azure AI Foundry",
548+
"Create an AI app that helps me to manage travel queries.",
549+
"Create an AI app that helps me to manage travel queries in Azure AI Foundry"
550+
],
529551
"get_bestpractices_get": [
530552
"Get the latest Azure code generation best practices",
531553
"Get the latest Azure deployment best practices",

0 commit comments

Comments
 (0)