Create Event Grid Topic MCP tool#2744
Open
anannya03 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Azure Event Grid “topic create” capability to the EventGrid toolset and wires it into the Azure MCP server surface area, with unit + recorded coverage and documentation updates.
Changes:
- Introduces
TopicCreateCommand(with options + JSON source-gen wiring) and a correspondingIEventGridService.CreateTopicAsyncimplementation. - Adds unit tests and a recorded end-to-end test for
eventgrid_topic_create, plus updates the recorded-test assets tag. - Updates Azure server tool catalog + docs (
consolidated-tools.json, README prompts,azmcp-commands.md, e2e prompts) and adds a changelog entry.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Topic/TopicCreateCommandTests.cs | Adds unit tests covering Topic create command behavior and validation. |
| tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/EventGridCommandTests.cs | Adds recorded test for eventgrid_topic_create. |
| tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/assets.json | Updates recorded-test assets tag. |
| tools/Azure.Mcp.Tools.EventGrid/src/Services/IEventGridService.cs | Extends service contract with CreateTopicAsync. |
| tools/Azure.Mcp.Tools.EventGrid/src/Services/EventGridService.cs | Implements topic creation in the Event Grid service. |
| tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicCreateOptions.cs | Adds options model for topic creation. |
| tools/Azure.Mcp.Tools.EventGrid/src/EventGridSetup.cs | Registers the new command in DI and command tree. |
| tools/Azure.Mcp.Tools.EventGrid/src/Commands/Topic/TopicCreateCommand.cs | Adds the new eventgrid topic create command implementation + metadata. |
| tools/Azure.Mcp.Tools.EventGrid/src/Commands/EventGridJsonContext.cs | Registers the create-command result type for source-generated JSON serialization. |
| servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json | Adds a consolidated tool mapping entry for topic create. |
| servers/Azure.Mcp.Server/README.md | Adds an example prompt for creating an Event Grid topic. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds E2E prompts for the new tool. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Documents azmcp eventgrid topic create usage. |
| servers/Azure.Mcp.Server/changelog-entries/1779838409065.yaml | Adds changelog entry for the new feature. |
Comment on lines
+536
to
+543
| public async Task<EventGridTopicInfo?> CreateTopicAsync( | ||
| string topic, | ||
| string resourceGroup, | ||
| string location, | ||
| string subscription, | ||
| string? tenant = null, | ||
| RetryPolicyOptions? retryPolicy = null, | ||
| CancellationToken cancellationToken = default) |
Comment on lines
+545
to
+552
| var subscriptionResource = await _subscriptionService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); | ||
| var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); | ||
|
|
||
| var topicData = new EventGridTopicData(new Azure.Core.AzureLocation(location)) | ||
| { | ||
| InputSchema = EventGridInputSchema.EventGridSchema, | ||
| PublicNetworkAccess = EventGridPublicNetworkAccess.Enabled | ||
| }; |
Comment on lines
+19
to
+20
| Destructive = false, | ||
| Idempotent = true, |
Comment on lines
+33
to
+36
| command.Options.Add(EventGridOptionDefinitions.TopicName.AsRequired()); | ||
| command.Options.Add(OptionDefinitions.Common.ResourceGroup.AsRequired()); | ||
| command.Options.Add(EventGridOptionDefinitions.Location.AsRequired()); | ||
| } |
Comment on lines
+2090
to
+2093
| "destructive": { | ||
| "value": false, | ||
| "description": "This tool performs only additive updates without deleting or modifying existing resources." | ||
| }, |
Comment on lines
+2094
to
+2097
| "idempotent": { | ||
| "value": true, | ||
| "description": "Running this operation multiple times with the same arguments produces the same result without additional effects." | ||
| }, |
|
|
||
| ```bash | ||
| # Create an Azure Event Grid topic in a specified resource group and location | ||
| # ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ❌ ReadOnly | ❌ Secret | ❌ LocalRequired |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
[Provide a clear, concise description of the changes][Add additional context, screenshots, or information that helps reviewers]GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline