Skip to content

Consolidate KeyVault get/list tools#1653

Merged
g2vinay merged 15 commits intomicrosoft:mainfrom
g2vinay:kv-consolidate-get-list-tools
Feb 12, 2026
Merged

Consolidate KeyVault get/list tools#1653
g2vinay merged 15 commits intomicrosoft:mainfrom
g2vinay:kv-consolidate-get-list-tools

Conversation

@g2vinay
Copy link
Copy Markdown
Contributor

@g2vinay g2vinay commented Feb 5, 2026

No description provided.

@g2vinay g2vinay force-pushed the kv-consolidate-get-list-tools branch from 3e88fd2 to 7fe5a6b Compare February 9, 2026 23:53
@g2vinay g2vinay marked this pull request as ready for review February 9, 2026 23:54
@g2vinay g2vinay requested review from a team, JonathanCrd and vcolin7 as code owners February 9, 2026 23:54
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 consolidates Azure Key Vault get and list operations by removing the dedicated list commands (keys/secrets/certificates) and extending the existing get commands to also support listing when the name argument is omitted.

Changes:

  • Removed Key Vault list commands/options/tests for keys, secrets, and certificates.
  • Updated Key Vault get commands to treat the name option as optional and list items when not provided.
  • Updated tool consolidation + one core tools-list test to reflect the new command surface area.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.UnitTests/Secret/SecretListCommandTests.cs Removed tests for deleted secret list command.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.UnitTests/Secret/SecretGetCommandTests.cs Updated to validate both “get single” and “list names” behaviors via secret get.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.UnitTests/Key/KeyListCommandTests.cs Removed tests for deleted key list command.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.UnitTests/Key/KeyGetCommandTests.cs Updated to validate both “get single” and “list names” behaviors via key get (incl. managed keys flag).
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.UnitTests/Certificate/CertificateListCommandTests.cs Removed tests for deleted certificate list command.
tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.UnitTests/Certificate/CertificateGetCommandTests.cs Updated to validate list-via-get behavior and error handling.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Secret/SecretListOptions.cs Removed options type for deleted secret list command.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Key/KeyListOptions.cs Removed options type for deleted key list command.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Key/KeyGetOptions.cs Added IncludeManagedKeys to support list-via-get.
tools/Azure.Mcp.Tools.KeyVault/src/Options/Certificate/CertificateListOptions.cs Removed options type for deleted certificate list command.
tools/Azure.Mcp.Tools.KeyVault/src/KeyVaultSetup.cs Removed DI + registration for Key Vault list commands.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretListCommand.cs Removed secret list command implementation.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretGetCommand.cs Added list-via-get behavior and updated result shape.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/KeyVaultJsonContext.cs Updated source-gen types for new/nested result models (removed list result models).
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyListCommand.cs Removed key list command implementation.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs Added list-via-get behavior (incl. include-managed) and updated result shape.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateListCommand.cs Removed certificate list command implementation.
tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateGetCommand.cs Added list-via-get behavior and updated result shape.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Partial doc edits around Key Vault list commands (still needs alignment with removed commands).
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Tools/UnitTests/ToolsListCommandTests.cs Updated expected known Key Vault command from list to get.
core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json Removed Key Vault list tools from consolidated mapping and adjusted Key Vault tool grouping.

Comment thread tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateGetCommand.cs Outdated
Comment thread servers/Azure.Mcp.Server/docs/azmcp-commands.md Outdated
Comment thread tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretGetCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs Outdated
- Update e2eTestPrompts.md: change keyvault_*_list to keyvault_*_get for listing prompts
- Update ToolDescriptionEvaluator README and prompts.json: consolidate list prompts into get tool definitions
- Update KeyVaultCommandTests.cs: update live tests to use consolidated get commands for list operations

This completes the KeyVault get/list consolidation by ensuring all documentation, test prompts, and tests reference the consolidated commands.
@g2vinay g2vinay requested a review from a team as a code owner February 10, 2026 01:09
Changed error logging from 'is null' to 'string.IsNullOrEmpty()' to match
the execution logic. This ensures error messages accurately reflect the
operation being performed (listing vs getting a specific item).

Without this fix, if a parameter is an empty string, the code would list
items but log errors as if getting a specific item, creating misleading
error messages.

Affected commands:
- SecretGetCommand.cs (line 105)
- KeyGetCommand.cs (line 108)
- CertificateGetCommand.cs (line 113)
Copy link
Copy Markdown
Contributor

@alzimmermsft alzimmermsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a CHANGELOG entry

Comment thread tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.KeyVault/src/Commands/KeyVaultJsonContext.cs Outdated
Copy link
Copy Markdown
Contributor

@vcolin7 vcolin7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of Alan's comments, the changes look good to me. I'd like to see the results of TDE testing (a screenshot should suffice) to see we did not introduce any regressions with tool description updates :)

Comment thread eng/tools/ToolDescriptionEvaluator/prompts/prompts.json
Comment thread servers/Azure.Mcp.Server/changelog-entries/1770772586899.yaml
@github-project-automation github-project-automation Bot moved this from Untriaged to In Progress in Azure MCP Server Feb 12, 2026
@g2vinay g2vinay merged commit 50cf173 into microsoft:main Feb 12, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Feb 12, 2026
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants