Skip to content

Add Advisor servicegroupintelligence get command - #3952

Open
Amishi-Panwar wants to merge 3 commits into
microsoft:mainfrom
Amishi-Panwar:amishipanwar/advisor-servicegroupintelligence
Open

Amishi-Panwar wants to merge 3 commits into
microsoft:mainfrom
Amishi-Panwar:amishipanwar/advisor-servicegroupintelligence

Conversation

@Amishi-Panwar

@Amishi-Panwar Amishi-Panwar commented Oct 14, 2026 •

Copy link
Copy Markdown

What does this PR do?

Adds azmcp advisor servicegroupintelligence get (microsoft.advisor/servicegroupintelligence) to return the current Azure Advisor status of Service Groups.

  • Scope: one Service Group via --service-group, or all Service Groups when omitted. Each Service Group has one current Advisor status record.
  • Filters: --criticality (MissionCritical/Tier 0, BusinessCritical/Tier 1, BusinessOperational/Tier 2, Administrative/Tier 3, NotApplicable; Tier0-Tier3 and 0-3 accepted) and --status (On Track, Attention Needed, At Risk, Critical, Unavailable).
  • Options: --top (default 50, max 500, areResultsTruncated flag) and --tenant.
  • Returns Service Group name and ID, criticality, status, status description, focus description, goal (when set) and last updated time.
  • Queries Azure Resource Graph (advisorresources) with skip-token paging and Resource Graph truncation reporting; the tenant is never guessed when several are accessible.
  • Includes command registration, consolidated-tools mapping, README, docs, e2e prompts, changelog entry and unit tests.

Known limitation: only Service Groups that have an Advisor status record are returned. NotApplicable criticality is assumed to be stored as an empty criticality (not yet observed in live data).

GitHub issue number?

Fixes #3933

Validation

  • dotnet test of the Advisor test project: 476 passed

  • dotnet format --verify-no-changes: clean

  • Update-AzCommandsMetadata.ps1 and Process-PackageReadMe.ps1 -Command validate-all: passed

  • Consolidated mode lists get_azure_advisor_service_group_status

  • Manual live ARG runs: no filter, --service-group commerce, --criticality "tier 0", --criticality MissionCritical --status "Attention Needed", --status "At Risk" (empty), --top 1 truncation

  • Live tests: the Advisor test project has HasLiveTests=false, so no recorded live test was added; behavior was verified manually as above.

  • cspell not run (Node 20 locally; requires >= 22.18)

  • ToolDescriptionEvaluator (October 26, 2026, 16:17 local; advisor_servicegroupintelligence_get; all 7 prompts rank Update README.md #1):

    Prompt Rank Score
    Give me the status of my service group commerce 1 0.439796
    How is the Advisor status of service group commerce calculated? 1 0.476537
    Give me the status of all service groups 1 0.568384
    Which mission critical service groups need attention? 1 0.431773
    Which service groups are at risk? 1 0.404287
    Show me the tier 0 service groups that are in critical status 1 0.564457
    Use Advisor servicegroupintelligence get to show the status and criticality of service group 1 0.690371

    All 7 prompts score >= 0.4; minimum 0.404287. Source: local eng/tools/ToolDescriptionEvaluator/results.md.

    Routing caveat: embedding-similarity overlap remains on 4 recommendation-summary prompts (top 5 recommendations, prioritized recommendations, top actions, and lifecycle-status breakdown for a Service Group), where this tool ranks above the expected summary tool. These rankings are not actual tool-execution results.

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages
    • Added comprehensive tests for new functionality
    • Created a changelog entry
  • For MCP tool changes:
    • One tool per PR
    • Updated Azure MCP Server README documentation
    • Validated README changes with Process-PackageReadMe.ps1 -Command validate-all
    • ToolDescriptionEvaluator score of 0.4 or more (all 7 prompts rank Update README.md #1 with score >= 0.4, min 0.404287; cross-tool overlap noted above)
    • Updated consolidated-tools.json
  • Extra steps for Azure MCP Server tool changes:
    • Updated servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran Update-AzCommandsMetadata.ps1
    • Updated servers/Azure.Mcp.Server/docs/e2eTestPrompts.md

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution Amishi-Panwar! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Explicit tenant selection does not bind query authentication to that tenant, and required recorded coverage is missing.

3 open findings
What changed in this PR

Adds azmcp advisor servicegroupintelligence get so agents can retrieve Service Group health through Azure Advisor, addressing #3933.

Changes:

  • Adds scoped health queries, criticality/status filters, pagination and result limits.
  • Registers the command and serialization models.
  • Adds unit tests, documentation, prompts and a changelog entry.
File Description
tools/​Azure.Mcp.Tools.Advisor/​tests/​Azure.Mcp.Tools.Advisor.Tests/​Services/​AdvisorServiceGroupIntelligenceServiceTests.cs Tests query construction, parsing and pagination.
tools/​Azure.Mcp.Tools.Advisor/​tests/​Azure.Mcp.Tools.Advisor.Tests/​ServiceGroupIntelligence/​ServiceGroupIntelligenceGetCommandTests.cs Tests validation and service invocation.
tools/​Azure.Mcp.Tools.Advisor/​src/​Services/​Models/​ServiceGroupIntelligenceKpiData.cs Defines KPI wire data.
tools/​Azure.Mcp.Tools.Advisor/​src/​Services/​Models/​ServiceGroupIntelligenceDataProperties.cs Defines health record properties.
tools/​Azure.Mcp.Tools.Advisor/​src/​Services/​Models/​ServiceGroupIntelligenceData.cs Deserializes Resource Graph records.
tools/​Azure.Mcp.Tools.Advisor/​src/​Services/​IAdvisorServiceGroupIntelligenceService.cs Defines the query contract.
tools/​Azure.Mcp.Tools.Advisor/​src/​Services/​AdvisorServiceGroupIntelligenceService.cs Implements queries and result processing.
tools/​Azure.Mcp.Tools.Advisor/​src/​Options/​ServiceGroupIntelligence/​ServiceGroupIntelligenceGetOptions.cs Declares command options.
tools/​Azure.Mcp.Tools.Advisor/​src/​Models/​AdvisorServiceGroupStatus.cs Defines returned health status.
tools/​Azure.Mcp.Tools.Advisor/​src/​Commands/​ServiceGroupIntelligence/​ServiceGroupIntelligenceGetCommand.cs Implements command execution and validation.
tools/​Azure.Mcp.Tools.Advisor/​src/​Commands/​AdvisorJsonContext.cs Registers serialization types.
tools/​Azure.Mcp.Tools.Advisor/​src/​AdvisorSetup.cs Registers the service and command.
servers/​Azure.Mcp.Server/​src/​Resources/​consolidated-tools.json Exposes the consolidated tool.
servers/​Azure.Mcp.Server/​README.md Adds usage examples.
servers/​Azure.Mcp.Server/​docs/​e2eTestPrompts.md Adds tool-selection prompts.
servers/​Azure.Mcp.Server/​docs/​azmcp-commands.md Documents command syntax and behavior.
servers/​Azure.Mcp.Server/​changelog-entries/​amishipanwar-advisor-servicegroupintelligence-get.yaml Announces the feature.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ravigupta99 Ravi Gupta (ravigupta99) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please have a look at the comments.

| advisor_remediation_get | Get the Advisor remediation package for recommendation type id <recommendation-type-id> and return its post-remediation verification checks | none |
| advisor_remediation_get | Get the Azure CLI commands to remediate recommendation type id \<recommendation-type-id> | none |
| advisor_servicegroupintelligence_get | Give me the status of my service group commerce | none |
| advisor_servicegroupintelligence_get | Give me the status of all service groups | none |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How will this scenario work? Will this tool be called multiple times in a loop with the names of all service groups the customer has access to?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same for the other scenarios which are querying across service groups - the "which service groups" questions - is it expected that the github copilot agent will call this tool multiple times with different parameters, i.e names of all service groups the customer has access to?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The ARG query we are using will be called with no filter of service group. So the same query will work as list status for all service groups visible to user and has status data, when used without any service group filter.

},
{
"name": "get_azure_advisor_service_group_status",
"description": "Get the current Azure Advisor status of Service Groups. Use for questions about the status of a Service Group, which Service Groups need attention, or which mission-critical Service Groups are at risk. Provide the service group name for one Service Group; when omitted, all Service Groups are returned. Optionally filter by criticality (MissionCritical, BusinessCritical, BusinessOperational, Administrative) and by status (On Track, Attention Needed, At Risk, Critical, Unavailable), and cap results with top. Returns each Service Group with its name and ID, criticality, status, status description, a description of where to focus, and last updated time. For aggregated KPIs such as idle resources or zonal resiliency use the insights tool instead.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: can we be more specific - health status?

@Amishi-Panwar Amishi-Panwar Oct 15, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We specifically have to avoid health keyword as it is very general and could conflict with other tools.
By design, 'health' word is changed to 'status' everywhere, that's why we call it status and insights now everywhere.

@Amishi-Panwar Amishi-Panwar Oct 15, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I removed health keyword from everywhere in the tool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For example, the snippet, "which service groups need attention" - our intention here is that the tool should return status, but a customer could use this wanting to see the outstanding recommendations for an SG - how are we ensuring that the intent and scenario of this tool doesn't impact the routing for already existing tools, the recommendation list and recommendation summary?

"for example 'which mission-critical Service Groups need attention' maps to --criticality MissionCritical --status 'Attention Needed'. " +
"Cap results with --top (default 50, max 500). " +
"Each result returns the Service Group name and ID, criticality, status, status description, a description of where to focus, the goal when set, and last updated time. " +
"For aggregated KPIs such as idle resources or zonal resiliency use advisor insight list instead.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will advisor insights be the right tool for it? Or recommendation summary tool, which returns top actions for a SG?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If user asks for specific or all insights kpi's of service group it should direct to Insights tool which serves the same purpose.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it also impact the routing for already existing recommendations_list tool? For example, today if I ask about unused resources (same as idle resources), it queries the recommendations_list tool to get a list:

Image


internal sealed record ServiceGroupIntelligenceData(
string? Id,
string? Name,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add type as well for completeness - it will be constant here, but still Id, Name, Type and Properties are the standard schema for any ARM/ARG Model.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: adbcd085-bc05-4b4d-a3be-a785d755f9ee
@Amishi-Panwar
Amishi-Panwar force-pushed the amishipanwar/advisor-servicegroupintelligence branch from cf007db to 3c2e795 Compare October 15, 2026 07:59

@ravigupta99 Ravi Gupta (ravigupta99) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please have a look at the comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: adbcd085-bc05-4b4d-a3be-a785d755f9ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Advisor servicegroupintelligence get command (Service Group status)

3 participants