Skip to content

Conversation

@ankiga-MSFT
Copy link
Member

@ankiga-MSFT ankiga-MSFT commented Jan 19, 2026

What does this PR do?

Onboard Azure Advisor MCP Tool - List Advisor Recommendations

GitHub issue number?

1517

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Azure Advisor MCP tool to list Azure Advisor recommendations in a subscription. The implementation follows the established patterns in the codebase for Azure resource querying using Azure Resource Graph.

Changes:

  • Added new Azure.Mcp.Tools.Advisor tool with service layer, commands, models, and unit tests
  • Integrated the Advisor tool into Azure.Mcp.Server with proper service registration
  • Updated documentation (README, command list, test prompts, consolidated tools) to include the new Advisor functionality

Reviewed changes

Copilot reviewed 28 out of 30 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Advisor/src/Azure.Mcp.Tools.Advisor.csproj Project file for the new Advisor tool with package references
tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs Service implementation for querying Advisor recommendations via Azure Resource Graph
tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs Service interface definition
tools/Azure.Mcp.Tools.Advisor/src/Services/Models/*.cs Data models for parsing Advisor recommendation responses
tools/Azure.Mcp.Tools.Advisor/src/Commands/BaseAdvisorCommand.cs Base command class with subscription and resource group options
tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs Command implementation for listing recommendations
tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs JSON serialization context for AOT compatibility
tools/Azure.Mcp.Tools.Advisor/src/Models/Recommendation.cs Public recommendation model returned to users
tools/Azure.Mcp.Tools.Advisor/src/Options/*.cs Options classes for command parameters
tools/Azure.Mcp.Tools.Advisor/src/AdvisorSetup.cs Service registration and command group setup
tools/Azure.Mcp.Tools.Advisor/src/AssemblyInfo.cs InternalsVisibleTo configuration for test projects
tools/Azure.Mcp.Tools.Advisor/src/GlobalUsings.cs Global using directives
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.UnitTests/*.cs Unit test implementation with comprehensive coverage
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.UnitTests/Azure.Mcp.Tools.Advisor.UnitTests.csproj Unit test project file
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.LiveTests/Azure.Mcp.Tools.Advisor.LiveTests.csproj Live test project file (no test implementation)
tools/Azure.Mcp.Tools.Advisor/tests/test-resources.bicep Empty test resources file (appropriate for Advisor which doesn't need specific resources)
tools/Azure.Mcp.Tools.Advisor/tests/test-resources-post.ps1 Empty post-deployment script
servers/Azure.Mcp.Server/src/Program.cs Registration of AdvisorSetup in the main server
servers/Azure.Mcp.Server/README.md Updated documentation to include Advisor in service list and examples
servers/Azure.Mcp.Server/docs/azmcp-commands.md Added Advisor commands documentation
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Added test prompts for Advisor tool
servers/Azure.Mcp.Server/changelog-entries/1768817429669.yaml Changelog entry for the new feature
core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json Added Advisor tool definition and fixed formatting
eng/tools/ToolDescriptionEvaluator/prompts/prompts.json Added test prompts for tool description evaluation
AzureMcp.sln Added Advisor projects to the solution
.github/CODEOWNERS Added code ownership for Advisor tool

Comment on lines 1 to 16
using System.CommandLine;
using System.Net;
using System.Text.Json;
using Azure.Mcp.Core.Options;
using Azure.Mcp.Tools.Advisor.Commands;
using Azure.Mcp.Tools.Advisor.Commands.Recommendation;
using Azure.Mcp.Tools.Advisor.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Models.Command;
using NSubstitute;
using Xunit;

namespace Azure.Mcp.Tools.Advisor.UnitTests.Recommendation;

public class RecommendationGetCommandTests
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name "RecommendationGetCommandTests.cs" doesn't match the test class name "RecommendationGetCommandTests" which tests "RecommendationListCommand". According to coding guidelines, the file should be renamed to "RecommendationListCommandTests.cs" to match both the class name and the command being tested.

Copilot uses AI. Check for mistakes.

namespace Azure.Mcp.Tools.Advisor.UnitTests.Recommendation;

public class RecommendationGetCommandTests
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test class name "RecommendationGetCommandTests" is inconsistent with the command class name "RecommendationListCommand". The test class should be named "RecommendationListCommandTests" to maintain naming consistency and make it easier to identify which command is being tested.

Copilot uses AI. Check for mistakes.
@ankiga-MSFT ankiga-MSFT marked this pull request as draft January 19, 2026 18:12
@ankiga-MSFT
Copy link
Member Author

@ankiga-MSFT please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

@ankiga-MSFT ankiga-MSFT marked this pull request as ready for review January 20, 2026 07:38
@KarishmaGhiya
Copy link
Member

KarishmaGhiya commented Jan 23, 2026

@ankiga-MSFT The PR looks good to me. I had a few questions:

  1. Were you able to run end-to-end tests and live tests for this tool?
  2. What was the tool description evaluation score?
  3. Please make sure you have followed all the steps and requested the permissions that are mentioned on the Internal Onboarding Guide for Microsoft employees

@ankiga-MSFT
Copy link
Member Author

@ankiga-MSFT The PR looks good to me. I had a few questions:

  1. Were you able to run end-to-end tests and live tests for this tool?
  2. What was the tool description evaluation score?
  3. Please make sure you have followed all the steps and requested the permissions that are mentioned on the Internal Onboarding Guide for Microsoft employees
  1. E2E tests were run successfully. Live Tests are not applicable for Advisor.
  2. The score is 0.4281
  3. Yes, followed the steps and onboarding instructions.

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure MCP Server Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants