Skip to content

Create Event Grid Topic MCP tool#2744

Open
anannya03 wants to merge 2 commits into
microsoft:mainfrom
anannya03:create-event-grid-topic
Open

Create Event Grid Topic MCP tool#2744
anannya03 wants to merge 2 commits into
microsoft:mainfrom
anannya03:create-event-grid-topic

Conversation

@anannya03

Copy link
Copy Markdown
Contributor

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

  • 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

@anannya03 anannya03 changed the title event grid create topic Create Event Grid Topic MCP tool May 28, 2026
@KarishmaGhiya KarishmaGhiya marked this pull request as ready for review June 11, 2026 21:56
@KarishmaGhiya KarishmaGhiya requested a review from a team as a code owner June 11, 2026 21:56
Copilot AI review requested due to automatic review settings June 11, 2026 21:56
@KarishmaGhiya KarishmaGhiya requested a review from a team as a code owner June 11, 2026 21:56

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

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 corresponding IEventGridService.CreateTopicAsync implementation.
  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants