Skip to content

Return explicit empty subscription list result#508

Merged
JasonYeMSFT merged 2 commits intomicrosoft:mainfrom
JasonYeMSFT:chuye/explicit-empty-subscription-list-result
Sep 24, 2025
Merged

Return explicit empty subscription list result#508
JasonYeMSFT merged 2 commits intomicrosoft:mainfrom
JasonYeMSFT:chuye/explicit-empty-subscription-list-result

Conversation

@JasonYeMSFT
Copy link
Copy Markdown
Member

What does this PR do?

This PR mades the SubscriptionListCommand follow the pattern to coalesce null into empty enumerable for empty subscription list result to avoid confusing the LLM.

GitHub issue number?

#165

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Updated command list in /docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 modifies the SubscriptionListCommand to always return an explicit empty list instead of null when no subscriptions are found, improving consistency for LLM consumers.

  • Updates command logic to return empty enumerable instead of null for empty subscription results
  • Updates corresponding unit test to verify the new behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
SubscriptionListCommand.cs Removes null coalescing logic to always return a response result with subscription data
SubscriptionListCommandTests.cs Updates test name and assertion to verify non-null results for empty subscription lists

@joshfree joshfree added this to the 2025-09 milestone Sep 19, 2025
@joshfree joshfree added the server-Azure.Mcp Azure.Mcp.Server label Sep 19, 2025
@joshfree joshfree moved this from Untriaged to In Progress in Azure MCP Server Sep 19, 2025
@JasonYeMSFT JasonYeMSFT force-pushed the chuye/explicit-empty-subscription-list-result branch from ea8d1bf to b79e660 Compare September 23, 2025 21:22
@JasonYeMSFT JasonYeMSFT merged commit cee6368 into microsoft:main Sep 24, 2025
26 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Sep 24, 2025
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Sep 27, 2025
* Return explicit empty subscription list result

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

Labels

server-Azure.Mcp Azure.Mcp.Server

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants