Migrate Grafana tools to new tool design#3081
Open
alzimmermsft wants to merge 1 commit into
Open
Conversation
alzimmermsft
requested review from
a team,
arunrab,
micha31r and
weng5e
as code owners
July 17, 2026 14:57
alzimmermsft
requested review from
KarishmaGhiya,
RickWinter,
g2vinay,
jairmyree,
jongio,
joshfree and
tmeschter
July 17, 2026 14:57
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Grafana workspace listing tool to the newer attribute-based options/binding model (moving away from the old RegisterOptions/BindOptions + ParseResult approach), and updates the toolset to align with the newer SubscriptionCommand<TOptions, TResult> pattern. It also includes a small, unrelated cleanup in the Insights toolset and adds a server changelog entry.
Changes:
- Migrated
WorkspaceListCommandto the new options binding flow (Optionattributes +SubscriptionCommand<TOptions, TResult>) and removed directSystem.CommandLineusage from the Grafana toolset. - Updated Grafana options + tests to use the new subscription-command testing base and option model.
- Removed now-unneeded global-usings usage patterns in Grafana and Insights (replacing with per-file
usingwhere needed) and updated project references to$(RepoRoot).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.Insights/src/Services/InsightsService.cs | Adds explicit System.Text.Json import after removing global usings. |
| tools/Azure.Mcp.Tools.Insights/src/GlobalUsings.cs | Removes global using for System.Text.Json (file deleted). |
| tools/Azure.Mcp.Tools.Insights/src/Commands/InsightsGetCommand.cs | Adds explicit System.Text.Json import; removes unused extension import. |
| tools/Azure.Mcp.Tools.Insights/src/Azure.Mcp.Tools.Insights.csproj | Switches Core project reference to $(RepoRoot) form. |
| tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.Tests/WorkspaceListCommandTests.cs | Updates tests to use SubscriptionCommandUnitTestsBase and new test helpers namespace. |
| tools/Azure.Mcp.Tools.Grafana/src/Services/Models/ManagedGrafanaData.cs | Simplifies JSON deserialization helper to use source-gen JsonTypeInfo. |
| tools/Azure.Mcp.Tools.Grafana/src/Options/Workspace/WorkspaceListOptions.cs | Replaces inheritance-based options with flat [Option]/[OptionContainer] POCO implementing ISubscriptionOption. |
| tools/Azure.Mcp.Tools.Grafana/src/GlobalUsings.cs | Removes global using for System.CommandLine (file deleted). |
| tools/Azure.Mcp.Tools.Grafana/src/Commands/Workspace/WorkspaceListCommand.cs | Migrates command execution signature to ExecuteAsync(context, options, ct) and new subscription command base. |
| tools/Azure.Mcp.Tools.Grafana/src/Azure.Mcp.Tools.Grafana.csproj | Removes direct System.CommandLine package reference; switches Core project reference to $(RepoRoot). |
| servers/Azure.Mcp.Server/changelog-entries/1784300177737.yaml | Adds a changelog entry (currently needs description alignment with actual changes). |
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?
Migrates Grafana tools to new design where Register and Bind options are based on
Optionattributes.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