Skip to content

Migrate Confidential Ledger tools to new tool design#3092

Open
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:MigrateConfidentialLedgerToolsToNewDesign
Open

Migrate Confidential Ledger tools to new tool design#3092
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:MigrateConfidentialLedgerToolsToNewDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates Confidential Ledger tools to new design where Register and Bind options are based on Option attributes.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

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
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • 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
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • 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
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/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

@alzimmermsft alzimmermsft self-assigned this Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 22:05
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 migrates the Azure Confidential Ledger toolset from the legacy RegisterOptions/BindOptions + System.CommandLine option-definition approach to the newer design where CLI/options binding is driven by [Option] attributes on options POCOs.

Changes:

  • Refactors append/get ledger entry commands to AuthenticatedCommand<TOptions, TResult> with attribute-driven options.
  • Replaces legacy option-definition classes with [Option] attributes and updates result models to record types.
  • Removes the System.CommandLine package reference from the Confidential Ledger toolset and updates unit tests accordingly.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.Tests/LedgerEntryGetCommandTests.cs Updates tests to construct new record-based result types.
tools/Azure.Mcp.Tools.ConfidentialLedger/tests/Azure.Mcp.Tools.ConfidentialLedger.Tests/LedgerEntryAppendCommandTests.cs Updates tests to construct new record-based result types.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Services/ConfidentialLedgerService.cs Adjusts returned result construction to record constructors and minor refactor.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Options/GetEntryOptions.cs Migrates to [Option] attribute-based binding and required property semantics.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Options/ConfidentialLedgerOptionDescriptions.cs Introduces shared option description constants for [Option(Description=...)].
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Options/ConfidentialLedgerOptionDefinitions.cs Removes legacy System.CommandLine option definitions.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Options/BaseConfidentialLedgerOptions.cs Replaces legacy JSON-name option mapping with [Option] attributes.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Options/AppendEntryOptions.cs Migrates to [Option] attribute-based binding and required property semantics.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Models/LedgerEntryGetResult.cs Converts model to a record with JsonPropertyName on positional properties.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Models/AppendEntryResult.cs Converts model to a record and removes now-unused request model.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Commands/Entries/LedgerEntryGetCommand.cs Refactors command execution to the new command base + bound options approach.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Commands/Entries/LedgerEntryAppendCommand.cs Refactors command execution to the new command base + bound options approach.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Commands/ConfidentialLedgerJsonContext.cs Removes serialization registration for deleted request type; simplifies context declaration.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Commands/BaseConfidentialLedgerCommand.cs Deletes legacy base command that depended on System.CommandLine option definitions.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Azure.Mcp.Tools.ConfidentialLedger.csproj Removes System.CommandLine package reference; updates Core project reference path.
servers/Azure.Mcp.Server/changelog-entries/1784325899838.yaml Adds a changelog entry marking the breaking change for the toolset.

Comment on lines 4 to 8
using System.CommandLine;
using Azure.Mcp.Tools.ConfidentialLedger.Models;
using Azure.Mcp.Tools.ConfidentialLedger.Options;
using Azure.Mcp.Tools.ConfidentialLedger.Services;
using Microsoft.Extensions.Logging;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants