Skip to content

[BUG] Azure Terraform aztfexport descriptions cause placeholder resource IDs and indirect tool routing #3813

Closed

Description

@liuwuliuyun

Describe the bug

The Azure Terraform tool descriptions do not tell the model enough about the aztfexport tools. The azureterraform namespace description mentions only "aztfexport command generation" without saying what it exports. The aztfexport resource and aztfexport resourcegroup descriptions do not say what distinguishes each tool or what to do when a required input is missing.

As a result, the tools are selected, but not reliably in the right way:

  • For a request with no resource ID, the model calls azureterraform_aztfexport_resource with an invented placeholder ID instead of asking for the ID.
  • In all-tools mode, the model always calls a best-practices tool before the export tool, which adds a round trip to every export request.

Expected behavior

  • For "Generate an aztfexport command to export a single Azure resource to Terraform" (clarification-required in e2eTestPrompts.md), the agent asks for the resource ID and does not invoke the tool with an invented ID.
  • For export prompts that name a resource ID or resource group, the agent selects the matching aztfexport command directly, forwards provider=azapi when requested, and never selects the other export command.
  • The namespace description states what aztfexport exports, so namespace-mode discovery reflects the tool's purpose.

Actual behavior

Tested on main at 09dce10e7, before #3737, with gpt-5.6-sol, the model named in #3553:

Prompt Mode Result
Generate an aztfexport command to export a single Azure resource to Terraform namespace 4 of 5 runs called azureterraform_aztfexport_resource with a placeholder ID, such as /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/<resource-provider>/<resource-type>/<resource-name>
Export tasks from #3553 and the resource ID prompt (4 prompts) all tools The export tool was the first Azure MCP tool in 0 of 9 sessions with tool calls; azureterraformbestpractices_get always ran first. Mean session time was 53.0 s.
Export all resources in resource group my-rg to Terraform; export with the azapi provider; export by resource ID namespace and all tools The expected command was selected in 15 of 15 namespace runs and 9 of 9 all-tools runs.

Reproduction Steps

  1. Build Azure MCP Server from main at 09dce10e7.
  2. Start the server with azmcp server start --mode namespace, then repeat with --mode all.
  3. Connect an agent using gpt-5.6-sol with the server as its only MCP server and no custom instructions.
  4. Send each prompt in a fresh session:
    • Generate an aztfexport command to export a single Azure resource to Terraform
    • Export all resources in resource group my-rg to Terraform
    • Export resource group my-rg to Terraform using the azapi provider
    • Export the resource /subscriptions/<subscription>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<account> to Terraform
  5. Inspect the MCP tool calls:
    • For the first prompt, check whether resource-id contains a placeholder.
    • In all-tools mode, check which Azure MCP tool the agent calls first.

No Azure credentials or aztfexport installation are needed. Without aztfexport, the export tools return installation guidance, which does not affect tool selection.

Environment

  • Hosting platform: Windows, local stdio transport
  • Azure MCP Server: built from source at 09dce10e7, Debug build
  • Agent: GitHub Copilot SDK 1.0.11 with Copilot runtime 1.0.80, as bundled with Vally 0.16.0, not VS Code agent mode
  • Model: gpt-5.6-sol
  • Sample: 64 sessions comparing 09dce10e7 with Update export tool discovery description for Azure Terraform tools #3737. Each prompt and build ran 5 times in namespace mode and 3 times in all-tools mode. Model output is nondeterministic, so these rates are indicative only.

Fix proposed in #3737.

Activity

  1. added
    needs-team-triageWorkflow: This issue needs the team to triage.
    questionFurther information is requested
    and removed
    needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.
    on Sep 30, 2026
  2. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @microsoft/azure-mcp.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions