Skip to content

[Doc Gap] aks_cluster_get — --resource-group incorrectly shown as required in azmcp-commands.md #2930

Description

@github-actions

Documentation Gap

Server: Azure.Mcp.Server
Tool directory: tools/Azure.Mcp.Tools.Aks
Triggered by: commit 09c3a3f2b2 / PR #2852 by @msalaman
Changed files:

  • tools/Azure.Mcp.Tools.Aks/src/Commands/Cluster/ClusterGetCommand.cs
  • tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs
  • tools/Azure.Mcp.Tools.Aks/src/Options/Cluster/ClusterGetOptions.cs

What Changed

PR #2852 refactored AksService to use BaseAzureResourceService (Azure Resource Graph queries) instead of direct ARM API calls. As part of this change:

  1. The validation that required --resource-group when --cluster was specified was removed from ClusterGetCommand.cs
  2. The ValidateRequiredParameters call in the single-cluster path was updated to only require clusterName (not resourceGroup)
  3. ClusterGetOptions.ResourceGroup is string? — it has always been optional at the options level, but the validation and service logic now fully honors this optionality

The cluster can now be looked up by name across all resource groups in a subscription without needing --resource-group.

Gaps Found

  • azmcp-commands.md AKS cluster get command signature shows --resource-group as a required parameter (no brackets), but it is now optional:

    # Current (incorrect):
    azmcp aks cluster get --subscription <subscription> \
                          --resource-group <resource-group> \
                          [--cluster <cluster>]
    # Correct (after PR #2852):
    azmcp aks cluster get --subscription <subscription> \
                          [--resource-group <resource-group>] \
                          [--cluster <cluster>]

Files to Update

  • servers/Azure.Mcp.Server/docs/azmcp-commands.md

Context

Removed validation from ClusterGetCommand.cs (PR #2852 diff):

-        if (!string.IsNullOrEmpty(options.Cluster) && string.IsNullOrEmpty(options.ResourceGroup))
-        {
-            validationResult.Errors.Add("When specifying a cluster name, the --resource-group option is required.");
-        }

Updated ValidateRequiredParameters in AksService.cs (PR #2852 diff):

-            ValidateRequiredParameters((nameof(resourceGroup), resourceGroup), (nameof(clusterName), clusterName));
+            ValidateRequiredParameters((nameof(clusterName), clusterName));

ClusterGetOptions.cs confirms ResourceGroup is optional:

[Option(OptionDescriptions.ResourceGroup)]
public string? ResourceGroup { get; set; }  // nullable = optional

Note: Related open issue #2921 (filed before PR #2852 merged) incorrectly states in its implementation guide that "The AKS command signatures remain accurate." That issue covers --auth-method exclusion and does not address the --resource-group optionality gap introduced by PR #2852.

📐 Implementation Guide

This section contains step-by-step instructions for a coding agent to implement the changes described above.

Step 1: Modify files

File: servers/Azure.Mcp.Server/docs/azmcp-commands.md

Locate the Azure Kubernetes Service (AKS) Operations section. Find this block:

# Gets Azure Kubernetes Service (AKS) cluster details
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp aks cluster get --subscription <subscription> \
                      --resource-group <resource-group> \
                      [--cluster <cluster>]

Replace it with:

# Gets Azure Kubernetes Service (AKS) cluster details
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp aks cluster get --subscription <subscription> \
                      [--resource-group <resource-group>] \
                      [--cluster <cluster>]

The only change is wrapping --resource-group <resource-group> in square brackets to indicate it is optional.

Step 2: Verify documentation structure

servers/Azure.Mcp.Server/docs/azmcp-commands.md — confirm:

  • The azmcp aks cluster get signature shows [--resource-group <resource-group>] (with brackets, indicating optional)
  • The azmcp aks nodepool get signature is unchanged (it still requires --resource-group and --cluster)
  • No other AKS-related changes are needed

Step 3: Validate

Run these commands in order. Each must succeed before proceeding to the next:

  1. dotnet build servers/Azure.Mcp.Server/ — confirms the server project compiles cleanly
  2. dotnet build tools/Azure.Mcp.Tools.Aks/src/ — confirms the AKS toolset compiles
  3. dotnet test tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/ --filter "TestType!=Live" — runs unit tests for the AKS toolset
  4. .\eng\common\spelling\Invoke-Cspell.ps1 — checks spelling in modified documentation

Next Steps

Tip

Ready for automated implementation? Assign this issue to @copilot to have Copilot coding agent implement the changes described in the Implementation Guide above

Generated by Documentation Updater · ● 8M ·

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

Status
Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions