Repository navigation
Add Advisor servicegroupintelligence get command - #3952
Amishi-Panwar wants to merge 3 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution Amishi-Panwar! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
🟡 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.
Ravi Gupta (ravigupta99)
left a comment
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
nit: can we be more specific - health status?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I removed health keyword from everywhere in the tool
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
Will advisor insights be the right tool for it? Or recommendation summary tool, which returns top actions for a SG?
There was a problem hiding this comment.
If user asks for specific or all insights kpi's of service group it should direct to Insights tool which serves the same purpose.
|
|
||
| internal sealed record ServiceGroupIntelligenceData( | ||
| string? Id, | ||
| string? Name, |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: adbcd085-bc05-4b4d-a3be-a785d755f9ee
cf007db to
3c2e795
Compare
Ravi Gupta (ravigupta99)
left a comment
There was a problem hiding this comment.
Please have a look at the comments.
…r-servicegroupintelligence
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: adbcd085-bc05-4b4d-a3be-a785d755f9ee




What does this PR do?
Adds
azmcp advisor servicegroupintelligence get(microsoft.advisor/servicegroupintelligence) to return the current Azure Advisor status of Service Groups.--service-group, or all Service Groups when omitted. Each Service Group has one current Advisor status record.--criticality(MissionCritical/Tier 0, BusinessCritical/Tier 1, BusinessOperational/Tier 2, Administrative/Tier 3, NotApplicable;Tier0-Tier3and0-3accepted) and--status(On Track, Attention Needed, At Risk, Critical, Unavailable).--top(default 50, max 500,areResultsTruncatedflag) and--tenant.advisorresources) with skip-token paging and Resource Graph truncation reporting; the tenant is never guessed when several are accessible.Known limitation: only Service Groups that have an Advisor status record are returned.
NotApplicablecriticality is assumed to be stored as an empty criticality (not yet observed in live data).GitHub issue number?
Fixes #3933
Validation
dotnet testof the Advisor test project: 476 passeddotnet format --verify-no-changes: cleanUpdate-AzCommandsMetadata.ps1andProcess-PackageReadMe.ps1 -Command validate-all: passedConsolidated mode lists
get_azure_advisor_service_group_statusManual live ARG runs: no filter,
--service-group commerce,--criticality "tier 0",--criticality MissionCritical --status "Attention Needed",--status "At Risk"(empty),--top 1truncationLive 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):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
Process-PackageReadMe.ps1 -Command validate-allconsolidated-tools.jsonservers/Azure.Mcp.Server/docs/azmcp-commands.mdUpdate-AzCommandsMetadata.ps1servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdInvoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess 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.