Update export tool discovery description for Azure Terraform tools - #3737
Draft
Yun Liu (liuwuliuyun) wants to merge 1 commit into
Draft
Yun Liu (liuwuliuyun) wants to merge 1 commit into
Yun Liu (liuwuliuyun) wants to merge 1 commit into
Conversation
Make export intent visible in namespace and individual tool descriptions while preserving local command generation. Cover discovery, routing, provider forwarding, installation help, and HTTP restrictions with regression tests. Disambiguate tools that competed for the same prompts by keying each description on its distinguishing selection signal. The aztfexport resource tool leads with the full Azure resource ID shape and states it exports only that resource, while the resourcegroup tool keys on a named resource group. The azurerm and azapi documentation tools state that they read reference documentation rather than querying live Azure resources, and identify their inputs by the azurerm_ prefix and the ARM namespace format respectively. The conftest workspace and plan tools distinguish a folder of Terraform .tf source files from an already generated tfplan.json. Validated with the tool description evaluator against the azureterraform prompts, which improved top-choice selection from 70.0% to 93.3%, with all prompts remaining above the 0.40 confidence bar. Add a checked-in Vally specification covering the prompts reported in the issue plus the tool pairs that compete for similar prompts. The conftest prompts in e2eTestPrompts.md are marked context-required and are therefore skipped by generated specifications, so the checked-in specification is the only Vally coverage for them. Pin the disambiguating phrases with unit tests so that rewording a description cannot silently regress tool selection. Addresses microsoft#3553 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
In namespace mode, the Azure Terraform export prompts in
e2eTestPrompts.mddid not select theaztfexporttools. The tools worked; the model did not pick them. The namespace description advertised "aztfexport command generation" without saying what aztfexport does, and several tools in the namespace competed for the same prompts.This PR keys each description on the signal that distinguishes its tool from its nearest competitor:
aztfexport resourceaztfexport resourcegroupazurerm getazurerm_prefix; states it reads reference docs rather than querying live resourcesazapi getMicrosoft.Storage/storageAccounts); same live-resource disclaimerconftest workspace/conftest plan.tfsource files from a generatedtfplan.jsonBehavior is unchanged. These tools still only generate commands for local execution and never execute an export or modify Azure resources.
Validation
Real model. Ran the checked-in Vally spec against
gpt-5.6-sol, the model named in the issue, through the namespace tool: 10/10 stimuli passed, including all three prompts reported as broken. Every run routed throughazmcp-azureterraform, the namespace path the issue says failed.ToolDescriptionEvaluator. Top-choice selection across the 30 azureterraform prompts went from 70.0% to 93.3%, with all prompts at 0.40 or above and in the top 3. The resource-ID prompt moved from rank 2 to rank 1.
Two prompts still miss on top-choice, both pre-existing and both for
azapi_get:Microsoft.Storage/storageAccountsloses tostorage_account_get, and one AzAPI prompt loses toazurerm_get. Both remain within the top 3 and above 0.40. Fixing them means editing tools outside this area, so they are left for a follow-up.Tests
AztfexportToolLoadingTests— namespace and all-tools discovery, routing, provider forwarding, installation help, HTTP-mode filteringAzureTerraformToolDescriptionTests— pins the disambiguating phrases so rewording cannot silently regress selectiontools/Azure.Mcp.Tools.AzureTerraform/tests/eval.yaml— checked-in Vally spec. The conftest prompts are markedcontext-requiredine2eTestPrompts.mdand are skipped by generated specs, so this file is their only Vally coverage.189/189 unit tests pass.
Notes for reviewers
azapi get. This is deliberate and measured: removing the duplication scored 90.0% instead of 93.3% and broke a passing prompt. Embeddings match on token overlap, so the repeated literals are doing retrieval work.GitHub issue number?
Fixes #3553
Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentation — not applicable, the README does not list these tools individuallyREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1— not applicable, no README changeToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.json— not applicable, no tools added or renamedbreaking-changelabel — not applicable, no renamesservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI) — produced no changes, as this PR edits only descriptive comments and not tool metadataservers/Azure.Mcp.Server/docs/e2eTestPrompts.md