Skip to content

Fix azqr tool selection for compliance prompts (#2819) - #3134

Open
KarishmaGhiya wants to merge 4 commits into
microsoft:mainfrom
KarishmaGhiya:karishmaghiya/fix-azqr-tool-selection-2819
Open

Fix azqr tool selection for compliance prompts (#2819)#3134
KarishmaGhiya wants to merge 4 commits into
microsoft:mainfrom
KarishmaGhiya:karishmaghiya/fix-azqr-tool-selection-2819

Conversation

@KarishmaGhiya

Copy link
Copy Markdown
Member

Description

Fixes #2819.

In All and Namespace modes, the E2E prompts for the Azure Quick Review CLI were not triggering the expected extension_azqr tool. The prompts were instead being routed to other tools because the azqr descriptions did not surface the vocabulary users actually use, and did not disambiguate azqr from tools with overlapping "compliance"/"recommendations" language.

Root cause

The three failing prompts all contain the words "compliance" and "recommendations":

  • Check my Azure subscription for any compliance issues or recommendations
  • Provide compliance recommendations for my current Azure subscription
  • Scan my Azure subscription for compliance recommendations

The original extension_azqr description ranked #3 for all three, losing to Azure Policy (whose description contains "governance and compliance management") and Azure Advisor (which owns generic "recommendations").

Fix

Reworded the azqr tool description across all description sources so it:

  • Mirrors the users' phrasing ("scan … for compliance issues", "provide compliance recommendations").
  • Explicitly disambiguates azqr from Azure Policy assignments and Azure Advisor cost/performance/reliability recommendations.

Files changed

  • tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs[CommandMetadata] description (All mode tool description).
  • servers/Azure.Mcp.Server/src/Resources/consolidated-tools.jsonaudit_azure_resources_compliance mapped tool description (Namespace/consolidated mode).
  • tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs — extension command-group description.
  • eng/tools/ToolDescriptionEvaluator/prompts/namespace-tools.json — evaluator fixture kept in sync.
  • servers/Azure.Mcp.Server/changelog-entries/karishmaghiya-fix-azqr-tool-selection.yaml — changelog entry.

Validation

A local embedding proxy (MiniLM cosine similarity against the real competitor descriptions) was used to confirm ranking direction:

Prompt Original After fix
"…compliance issues or recommendations" #3 #1
"Provide compliance recommendations…" #3 #1
"Scan…for compliance recommendations" #3 #1

Note: the proxy uses MiniLM, not production's text-embedding-3-large. The official ToolDescriptionEvaluator should be run as the authoritative gate before merge.

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.

Improve the Azure Quick Review (azqr) tool, extension namespace, and
consolidated tool descriptions so prompts asking to scan a subscription
for compliance issues or compliance recommendations reliably select the
extension_azqr tool in All and Namespace modes. The descriptions now
mirror user phrasing and explicitly disambiguate azqr from Azure Policy
and Azure Advisor, which previously out-ranked it for these prompts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ee38628b-51ed-4861-91e1-7a07f3b5360b
Copilot AI review requested due to automatic review settings July 22, 2026 00:44
@KarishmaGhiya
KarishmaGhiya requested review from a team and jongio as code owners July 22, 2026 00:44
@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 github-actions Bot added the tools-Azd Azure Developer CLI related label Jul 22, 2026

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.

Pull request overview

This PR improves tool-selection reliability for Azure Quick Review CLI (azqr) compliance-focused prompts by rewording azqr-related tool/namespace descriptions across the sources used in All/Namespace modes and by the ToolDescriptionEvaluator, and adds a changelog entry for the fix.

Changes:

  • Updated azqr command/namespace/consolidated tool descriptions to better match user prompt vocabulary (“scan … for compliance issues/recommendations”) and disambiguate from overlapping tools.
  • Synced the ToolDescriptionEvaluator namespace fixture with the updated azqr description.
  • Added an Azure MCP Server changelog entry describing the tool-selection fix.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs Updates extension command-group description to better surface azqr compliance-scan intent.
tools/Azure.Mcp.Tools.Extension/src/Commands/AzqrCommand.cs Rewords azqr tool metadata description used in All mode for better prompt matching/disambiguation.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Updates consolidated/namespace-mode mapped tool description for azqr compliance scanning.
eng/tools/ToolDescriptionEvaluator/prompts/namespace-tools.json Keeps evaluator fixture description in sync with updated azqr tool description.
servers/Azure.Mcp.Server/changelog-entries/karishmaghiya-fix-azqr-tool-selection.yaml Adds changelog entry for the azqr tool-selection behavior fix.

Name = "azqr",
Title = "Azure Quick Review CLI Command",
Description = "Runs Azure Quick Review CLI (azqr) commands to generate compliance and security reports for Azure resources, identifying non-compliant configurations or areas for improvement. Requires a subscription id and optionally a resource group name. Returns the generated report file path. Note: azqr is different from Azure CLI (az).",
Description = "Runs Azure Quick Review CLI (azqr) to scan an Azure subscription (or resource group) for compliance issues and provide compliance recommendations. Generates a compliance and security assessment report that identifies non-compliant configurations and recommends improvements for your Azure resources. Use this whenever a user wants to scan, check, review, or assess a subscription for compliance issues or compliance recommendations, or wants recommendations to fix compliance and security problems. Requires a subscription id and optionally a resource group name. Returns the generated report file path. Note: azqr performs compliance and security scans and is different from Azure CLI (az), from Azure Policy assignments, and from Azure Advisor cost, performance, and reliability recommendations.",

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.

You can also just use the words "file paths" without specifying the file format.

"id": "",
"name": "extension_azqr",
"description": "Runs Azure Quick Review CLI (azqr) commands to generate compliance/security reports for Azure resources.\r\nThis tool should be used when the user wants to identify any non-compliant configurations or areas for improvement in their Azure resources.\r\nRequires a subscription id and optionally a resource group name. Returns the generated report file's path.\r\nNote that Azure Quick Review CLI (azqr) is different from Azure CLI (az).",
"description": "Runs Azure Quick Review CLI (azqr) to scan an Azure subscription (or resource group) for compliance issues and provide compliance recommendations. Generates a compliance and security assessment report that identifies non-compliant configurations and recommends improvements for your Azure resources. Use this whenever a user wants to scan, check, review, or assess a subscription for compliance issues or compliance recommendations, or wants recommendations to fix compliance and security problems. Requires a subscription id and optionally a resource group name. Returns the generated report file path. Note: azqr performs compliance and security scans and is different from Azure CLI (az), from Azure Policy assignments, and from Azure Advisor cost, performance, and reliability recommendations.",

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.

You can also just use the words "file paths" without specifying the file format.

Comment thread servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@g2vinay g2vinay 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.

Run Tool Description Evaluator to ensure, things are working well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools-Azd Azure Developer CLI related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[All & Namespace mode] The E2E prompt in Azure Quick Review CLI does not trigger extension_azqr tool

5 participants