MCP Tools in Drills: Drill Run Get and Drill Run Resource Get - #3318
MCP Tools in Drills: Drill Run Get and Drill Run Resource Get#3318dynamicdhx wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Tool Descriptor Evaluator ResultsTest 1Expected Tool: Results
Test 2Expected Tool: Results
Test 3Expected Tool: Results
Test 4Expected Tool: Results
|
There was a problem hiding this comment.
Pull request overview
Adds Azure Resilience Management drill run and drill run resource/target retrieval capabilities to the ResilienceManagement toolset, wiring new commands through the tool registration and updating Azure MCP Server documentation/metadata.
Changes:
- Added
azmcp resilience drill run getandazmcp resilience drill run resource getcommands (plus options, JSON serialization context, and unit tests). - Extended
IResilienceManagementService/ResilienceManagementServicewith DrillRun and DrillRunTarget list/get operations. - Updated server docs/metadata (consolidated tool mapping, e2e prompts, azmcp command reference) and added changelog entries.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/Runs/Resources/DrillRunResourceGetCommandTests.cs | New unit tests for drill run resource list/get behavior and error handling. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/Runs/DrillRunGetCommandTests.cs | New unit tests for drill run list/get behavior and error handling. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs | Implements ARM-backed list/get for drill runs and drill run targets. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs | Adds service interface methods for drill runs and drill run targets. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/ResilienceManagementSetup.cs | Registers new commands and adds drill run and drill run resource command groups. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Runs/Resources/DrillRunResourceGetOptions.cs | New options POCO for drill run resource get. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Runs/DrillRunGetOption.cs | New options POCO for drill run get. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/ResilienceManagementJsonContext.cs | Registers new command result types for source-generated JSON serialization (AOT). |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/Runs/Resources/DrillRunResourceGetCommand.cs | New command to list/get drill run targets (resources). |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/Runs/DrillRunGetCommand.cs | New command to list/get drill runs. |
| servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json | Updates consolidated tool description + mapped tool list to include new drill run tools. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds e2e prompt coverage rows for the two new tools. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Documents the two new CLI command shapes. |
| servers/Azure.Mcp.Server/changelog-entries/copilot-add-drill-run-resource-get.yaml | Changelog entry for drill run resource get tool. |
| servers/Azure.Mcp.Server/changelog-entries/copilot-add-drill-run-get.yaml | Changelog entry for drill run get tool. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| RequestFailedException reqEx when reqEx.Status == (int)HttpStatusCode.Forbidden => | ||
| "Authorization failed getting the drill run. Verify that you have access.", | ||
| RequestFailedException reqEx when reqEx.Status == (int)HttpStatusCode.NotFound => | ||
| "Drill run not found. Verify the drill run, drill, and service group exist and you have access.", | ||
| RequestFailedException => "Failed to get the drill run. Verify the drill run, drill, and service group, then retry.", |
| RequestFailedException reqEx when reqEx.Status == (int)HttpStatusCode.Forbidden => | ||
| "Authorization failed getting the drill run resource. Verify that you have access.", | ||
| RequestFailedException reqEx when reqEx.Status == (int)HttpStatusCode.NotFound => | ||
| "Drill run resource not found. Verify the resource, drill run, drill, and service group exist and you have access.", | ||
| RequestFailedException => "Failed to get the drill run resource. Verify the resource, drill run, drill, and service group, then retry.", |
| services.AddSingleton<DrillGetCommand>(); | ||
| services.AddSingleton<DrillResourceGetCommand>(); | ||
| services.AddSingleton<DrillRunGetCommand>(); | ||
| services.AddSingleton<DrillRunResourceGetCommand>(); |
ba4a907 to
d1a6902
Compare
|
|
||
| namespace Azure.Mcp.Tools.ResilienceManagement.Options.Drills.Runs.Resources; | ||
|
|
||
| public sealed class DrillRunResourceGetOptions |
There was a problem hiding this comment.
Nit: rename this file to DrillRunResourceGetOption.cs (singular) to match the sibling DrillRunGetOption.cs and the toolset convention (DrillGetOption.cs, DrillResourceGetOption.cs). The class name stays DrillRunResourceGetOptions.
|
|
||
| protected override string GetErrorMessage(Exception ex) => ex switch | ||
| { | ||
| KeyNotFoundException => "Drill run not found. Verify the drill run name, drill, service group, and that you have access.", |
There was a problem hiding this comment.
This KeyNotFoundException arm looks unreachable. GetDrillRunAsync calls the ARM GetAsync, which throws RequestFailedException with Status 404 on a missing run (already handled below), not KeyNotFoundException. Consider removing this arm (and the analogous one in DrillRunResourceGetCommand), or point to the path that actually throws it.
|
|
||
| protected override string GetErrorMessage(Exception ex) => ex switch | ||
| { | ||
| KeyNotFoundException => "Drill run resource not found. Verify the resource name, drill run, drill, service group, and that you have access.", |
There was a problem hiding this comment.
Same as DrillRunGetCommand: this KeyNotFoundException arm is unreachable — the ARM GetAsync throws RequestFailedException (Status 404) on a missing resource, not KeyNotFoundException. Drop it or reference the code path that throws it.
|
|
||
| # Get a run of a drill, or list all runs of the drill (omit --name) | ||
| # ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired | ||
| azmcp resilience drill run get --subscription <subscription> \ |
There was a problem hiding this comment.
These commands are service-group-scoped and don't expose a --subscription option, so documenting --subscription <subscription> here is inaccurate (and would be rejected under strict unknown-parameter handling). Note the existing drill get / drill resource get blocks above have the same line, so this is a pre-existing pattern — ideally fix all four together.
| } | ||
|
|
||
| [Fact] | ||
| public async Task Should_list_drill_runs() |
There was a problem hiding this comment.
These four new TestType=Live recorded tests were added, but assets.json isn't updated in this PR (Tag is still ..._cb0c443485), so there are no recordings for them. The default PR build runs recorded tests in playback (Test-Code.ps1 -TestType All applies no trait filter), so with no recordings they fail — which is what's reddening the test legs of mcp - pullrequest. The live pipeline needs to run to record these interactions and bump the assets Tag.
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