Skip to content

Migrate Event Grid tools to new tool design#3087

Merged
alzimmermsft merged 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateEventGridToolsToNewDesign
Jul 18, 2026
Merged

Migrate Event Grid tools to new tool design#3087
alzimmermsft merged 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateEventGridToolsToNewDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates Event Grid 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 20:13
@alzimmermsft
alzimmermsft requested review from a team and anannya03 as code owners July 17, 2026 20:13
@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

Migrates the Event Grid toolset to the newer options model where CLI binding/validation is driven by [Option] / [OptionContainer] attributes, removing the legacy RegisterOptions/BindOptions pattern and System.CommandLine usage.

Changes:

  • Converted Event Grid commands and option POCOs to attribute-based option binding (and adjusted unit test bases accordingly).
  • Refactored Event Grid models to records and simplified some service helper code / JSON context definitions.
  • Removed legacy Event Grid option definition infrastructure and System.CommandLine dependency from the tool project.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Topic/TopicListCommandTests.cs Switches tests to subscription-aware command test base.
tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Subscription/SubscriptionListCommandTests.cs Switches tests to subscription-aware command test base.
tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Events/EventsPublishCommandTests.cs Switches tests to subscription-aware command test base.
tools/Azure.Mcp.Tools.EventGrid/src/Services/IEventGridService.cs Updates interface imports to reference moved/used models.
tools/Azure.Mcp.Tools.EventGrid/src/Services/EventGridService.cs Updates event publishing serialization and refactors some model creation helpers.
tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicListOptions.cs Replaces inherited options with explicit [Option]-based subscription/resource-group/retry options.
tools/Azure.Mcp.Tools.EventGrid/src/Options/Subscription/SubscriptionListOptions.cs Introduces [Option]-based options (topic/location/resource-group/subscription/tenant/retry).
tools/Azure.Mcp.Tools.EventGrid/src/Options/Events/EventsPublishOptions.cs Introduces [Option]-based publish options and required non-nullable inputs.
tools/Azure.Mcp.Tools.EventGrid/src/Options/EventGridOptionDescriptions.cs Adds centralized text for Event Grid option descriptions.
tools/Azure.Mcp.Tools.EventGrid/src/Options/EventGridOptionDefinitions.cs Removes legacy System.CommandLine-based option definitions.
tools/Azure.Mcp.Tools.EventGrid/src/Options/BaseEventGridOptions.cs Removes legacy base options type.
tools/Azure.Mcp.Tools.EventGrid/src/Models/EventInputSchemas.cs Converts schema input POCOs to records for JSON (de)serialization.
tools/Azure.Mcp.Tools.EventGrid/src/Models/EventGridTopicInfo.cs Simplifies record metadata model (drops explicit JsonPropertyName attributes).
tools/Azure.Mcp.Tools.EventGrid/src/Models/EventGridSubscriptionInfo.cs Simplifies record metadata model (drops explicit JsonPropertyName attributes).
tools/Azure.Mcp.Tools.EventGrid/src/Models/EventGridEventSchema.cs Converts schema model to record form.
tools/Azure.Mcp.Tools.EventGrid/src/GlobalUsings.cs Removes Event Grid-specific global usings (previously included System.CommandLine and others).
tools/Azure.Mcp.Tools.EventGrid/src/Commands/Topic/TopicListCommand.cs Migrates to SubscriptionCommand<TOptions,TResult> with attribute-bound options.
tools/Azure.Mcp.Tools.EventGrid/src/Commands/Subscription/SubscriptionListCommand.cs Migrates to AuthenticatedCommand<TOptions,TResult> with custom validation and post-bind subscription resolution.
tools/Azure.Mcp.Tools.EventGrid/src/Commands/Events/EventsPublishCommand.cs Migrates to SubscriptionCommand<TOptions,TResult> and moves schema validation to ValidateOptions.
tools/Azure.Mcp.Tools.EventGrid/src/Commands/EventGridJsonContext.cs Updates JSON context to include models and uses file-scoped partial type form.
tools/Azure.Mcp.Tools.EventGrid/src/Commands/BaseEventGridCommand.cs Removes legacy Event Grid command base type.
tools/Azure.Mcp.Tools.EventGrid/src/Azure.Mcp.Tools.EventGrid.csproj Updates core project reference path and removes System.CommandLine package reference.
servers/Azure.Mcp.Server/changelog-entries/1784319125976.yaml Adds breaking-change entry for Event Grid tool parameter surface changes.

Comment thread tools/Azure.Mcp.Tools.EventGrid/src/Models/EventInputSchemas.cs
Comment thread tools/Azure.Mcp.Tools.EventGrid/src/Models/EventInputSchemas.cs
@alzimmermsft
alzimmermsft merged commit ec1027d into microsoft:main Jul 18, 2026
25 checks passed
@alzimmermsft
alzimmermsft deleted the MigrateEventGridToolsToNewDesign branch July 18, 2026 00:09
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.

3 participants