Skip to content

MCP Tools in Drills: Drill Add or Update Resources - #3371

Open
dynamicdhx wants to merge 2 commits into
mainfrom
users/dhruvbharuka/drilladd-or-update-resource
Open

MCP Tools in Drills: Drill Add or Update Resources#3371
dynamicdhx wants to merge 2 commits into
mainfrom
users/dhruvbharuka/drilladd-or-update-resource

Conversation

@dynamicdhx

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

@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

Adds a new Azure Resilience Management drill command that can add, update, or exclude drill target resources, wiring it through the toolset service layer and surfacing it through the Azure MCP Server’s tool catalog and docs.

Changes:

  • Introduces resilience_drill_resource_add-or-update command + options/model and registers it in the ResilienceManagement toolset.
  • Implements the backing service operation (AddOrUpdateDrillResourcesAsync) and AOT JSON context registrations.
  • Updates Azure MCP Server discovery surfaces (consolidated tools, command docs, e2e prompts) and adds unit + recorded integration coverage.

Reviewed changes

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

Show a summary per file
File Description
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/ResilienceManagementCommandTests.cs Adds recorded/live integration coverage for the new drill add-or-update flow.
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/Resources/DrillAddOrUpdateResourcesCommandTests.cs Adds unit tests for validation, success path, and error sanitization.
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/assets.json Updates the recorded test assets tag for the toolset.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs Implements AddOrUpdateDrillResourcesAsync using the ARM SDK drill resource LRO.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs Extends the service interface for the new drill resources operation.
tools/Azure.Mcp.Tools.ResilienceManagement/src/ResilienceManagementSetup.cs Registers the new command in DI and wires it into the resilience drill resource command group.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Resources/DrillAddOrUpdateResourcesOption.cs Defines CLI/tool options for include, update, exclude, force flags, and fault duration.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/DrillAddOrUpdateResourcesResult.cs Adds a result model for operation tracking (operationId, hasCompleted).
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/ResilienceManagementJsonContext.cs Registers new response/result types for source-generated JSON serialization (AOT-safe).
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/Resources/DrillAddOrUpdateResourcesCommand.cs Adds the tool command implementation, input validation, payload shaping, and error mapping.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Adds the new tool name so it is discoverable through consolidated tool mapping.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds e2e prompt coverage for the new tool.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents the new azmcp resilience drill resource add-or-update command.
servers/Azure.Mcp.Server/changelog-entries/dhruvbharuka-drill-add-or-update-resources.yml Adds a changelog entry announcing the new tool.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +35 to +39
[Theory]
[InlineData("--drill drill1 --fault-duration-minutes 10 --include-resources " + IncludeJson, false)]
[InlineData("--service-group sg1 --fault-duration-minutes 10 --include-resources " + IncludeJson, false)]
[InlineData("--service-group sg1 --drill drill1 --include-resources " + IncludeJson, false)]
[InlineData("--service-group sg1 --drill drill1 --fault-duration-minutes 10", false)]
Comment on lines 79 to +83
"resilience_usageplan_enrollment_create",
"resilience_recoveryplan_create",
"resilience_recoveryplan_delete",
"resilience_recoveryplan_resource_update"
"resilience_recoveryplan_resource_update",
"resilience_drill_resource_add-or-update"
@dynamicdhx

Copy link
Copy Markdown
Contributor Author

Tool Description Evaluator Results

Test 1

Expected Tool: resilience_drill_resource_add-or-update
Prompt: Add resource <resource_id> to resilience drill <drill_name> in service group <service_group> with a fault duration of <fault_duration_minutes> minutes

Results

Rank Score Tool Status
1 0.730711 resilience_drill_resource_add-or-update EXPECTED
2 0.527114 resilience_drill_get
3 0.516581 resilience_drill_resource_get
4 0.429280 resilience_drill_run_resource_get
5 0.405018 resilience_usageplan_enrollment_create

Test 2

Expected Tool: resilience_drill_resource_add-or-update
Prompt: Update or exclude the resources of resilience drill <drill_name> in service group <service_group>

Results

Rank Score Tool Status
1 0.641648 resilience_drill_resource_add-or-update EXPECTED
2 0.601242 resilience_drill_get
3 0.601011 resilience_drill_resource_get
4 0.536848 resilience_recoveryplan_resource_update
5 0.496929 resilience_drill_run_resource_get

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