Normalize command result payloads to object roots - #3165
Open
vcolin7 wants to merge 15 commits into
Open
Conversation
vcolin7
requested review from
a team,
Jackson Weber (JacksonWeber),
Achyuth Maddala Sitaram (achyuth-ms),
Arun R (arunrab),
Connie Yau (conniey),
Ji Wang (ericshape),
Vinay Gera (g2vinay),
Jeremy Frosti (jeremyfrosti),
Leighton Chen (lzchen),
Manvir Kaur (manvkaur),
Pablo Castro (pablocastro),
Radhika Gupta (rads-1996),
Rajkumar Rangaraj (rajkumar-rangaraj),
Varad Meru (vrdmr) and
xiang17
as code owners
July 28, 2026 06:14
vcolin7
requested review from
Steven Vukelich (vukelich) and
Jeff Fisher (xirzec)
July 28, 2026 06:14
vcolin7
requested review from
KarishmaGhiya,
Alan Zimmer (alzimmermsft) and
Sandeep Sen (sandeep-sen)
July 28, 2026 06:14
|
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 standardizes multiple MCP command outputs (across core, Azure tools, and Fabric tools) to consistently emit object-root JSON payloads, aligning TResult contracts and ResponseResult.Create(...) type metadata to the actual serialized shapes and ensuring the results remain AOT-safe via source-generated JsonSerializerContext registrations.
Changes:
- Replaced raw-array / singleton-array / variant-shaped results with command-specific object-root
*CommandResultwrappers. - Updated source-generated JSON contexts to register the new wrapper result types for AOT-safe serialization.
- Updated and added tests to validate the new output shapes; added breaking-change changelog entries for Azure and Fabric servers.
Reviewed changes
Copilot reviewed 75 out of 75 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Commands/Shortcut/ShortcutListCommandTests.cs | Adds test verifying shortcut list wrapper result shape. |
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Commands/Shortcut/ShortcutGetCommandTests.cs | Adds test verifying shortcut get wrapper result shape. |
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Commands/Shortcut/ShortcutCreateCommandVariantsTests.cs | Updates create-variant tests to deserialize wrapper result shapes. |
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Commands/Settings/SettingsGetCommandTests.cs | Adds test verifying settings wrapper result shape. |
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Commands/Security/DataAccessRoleListCommandTests.cs | Adds tests verifying role list wrapper and null-omission behavior. |
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Commands/Security/DataAccessRoleGetCommandTests.cs | Adds test verifying role get wrapper result shape. |
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Commands/Security/DataAccessRoleCreateOrUpdateCommandTests.cs | Updates test to deserialize the new upsert wrapper result. |
| tools/Fabric.Mcp.Tools.OneLake/src/Models/OneLakeJsonContext.cs | Registers OneLake wrapper result types for AOT-safe serialization. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutListCommand.cs | Changes list result to object-root wrapper type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutGetCommand.cs | Changes get result to object-root wrapper type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateS3CompatibleCommand.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateOneLakeCommand.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateOneDriveSharePointCommand.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateGcsCommand.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateDataverseCommand.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateAzureBlobCommand.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateAmazonS3Command.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Shortcut/ShortcutCreateAdlsGen2Command.cs | Wraps create result in object-root command result type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Settings/SettingsGetCommand.cs | Changes settings result to object-root wrapper type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Security/DataAccessRoleListCommand.cs | Changes list result to object-root wrapper type (with null-omission attributes). |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Security/DataAccessRoleGetCommand.cs | Changes get result to object-root wrapper type. |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/Security/DataAccessRoleCreateOrUpdateCommand.cs | Changes upsert result to object-root wrapper type. |
| tools/Fabric.Mcp.Tools.Docs/tests/Fabric.Mcp.Tools.Docs.Tests/Commands/GetWorkloadDefinitionCommandTests.cs | Updates tests to validate wrapper output and fields. |
| tools/Fabric.Mcp.Tools.Docs/tests/Fabric.Mcp.Tools.Docs.Tests/Commands/GetWorkloadApisCommandTests.cs | Updates tests to validate wrapper output and fields. |
| tools/Fabric.Mcp.Tools.Docs/tests/Fabric.Mcp.Tools.Docs.Tests/Commands/GetPlatformApisCommandTests.cs | Updates tests to validate wrapper output and fields. |
| tools/Fabric.Mcp.Tools.Docs/tests/Fabric.Mcp.Tools.Docs.Tests/Commands/GetBestPracticesCommandTests.cs | Updates tests to validate wrapper output and fields. |
| tools/Fabric.Mcp.Tools.Docs/tests/Fabric.Mcp.Tools.Docs.Tests/Commands/CombinedWorkflowTests.cs | Updates combined workflow test to deserialize wrapper and validate nested JSON content. |
| tools/Fabric.Mcp.Tools.Docs/src/Commands/PublicApis/GetWorkloadApisCommand.cs | Wraps public API result in an object-root wrapper with stable JSON name. |
| tools/Fabric.Mcp.Tools.Docs/src/Commands/PublicApis/GetPlatformApisCommand.cs | Wraps public API result in an object-root wrapper with stable JSON name. |
| tools/Fabric.Mcp.Tools.Docs/src/Commands/FabricJsonContext.cs | Registers Fabric Docs wrapper result types for AOT-safe serialization. |
| tools/Fabric.Mcp.Tools.Docs/src/Commands/BestPractices/GetWorkloadDefinitionCommand.cs | Wraps definition string in an object-root wrapper with stable JSON name. |
| tools/Fabric.Mcp.Tools.Docs/src/Commands/BestPractices/GetBestPracticesCommand.cs | Wraps best-practices list in an object-root wrapper with stable JSON name. |
| tools/Azure.Mcp.Tools.WellArchitectedFramework/tests/Azure.Mcp.Tools.WellArchitectedFramework.Tests/Commands/ServiceGuide/ServiceGuideGetCommandTests.cs | Updates tests to validate wrapper output shape and field access. |
| tools/Azure.Mcp.Tools.WellArchitectedFramework/src/Commands/WellArchitectedFrameworkJsonContext.cs | Registers the new wrapper result type for AOT-safe serialization. |
| tools/Azure.Mcp.Tools.WellArchitectedFramework/src/Commands/ServiceGuide/ServiceGuideGetCommand.cs | Wraps guidance list into an object-root command result. |
| tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerGetCommandTests.cs | Updates tests to validate wrapper output and server list behavior. |
| tools/Azure.Mcp.Tools.Sql/src/Commands/SqlJsonContext.cs | Registers SQL wrapper result types for AOT-safe serialization. |
| tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerGetCommand.cs | Wraps server list output into an object-root command result. |
| tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexQueryCommandTests.cs | Updates test to validate wrapper output and JSON shape. |
| tools/Azure.Mcp.Tools.Search/src/Commands/SearchJsonContext.cs | Registers search wrapper result types for AOT-safe serialization. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexQueryCommand.cs | Wraps index query results into an object-root command result. |
| tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs | Updates test to validate wrapper output deserialization. |
| tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/ResourceLogQueryCommandTests.cs | Updates test to validate wrapper output deserialization. |
| tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Instrumentation/Commands/InstrumentationCommandResultTests.cs | Adds tests ensuring instrumentation commands return object-root payloads. |
| tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelListCommandTests.cs | Updates test to validate wrapper output and JSON property access. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/MonitorJsonContext.cs | Registers monitor wrapper result types for AOT-safe serialization. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/WorkspaceLogQueryCommand.cs | Wraps log query results into an object-root command result. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/ResourceLogQueryCommand.cs | Wraps log query results into an object-root command result. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Instrumentation/SendEnhancementSelectCommand.cs | Wraps string result into an object-root command result. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Instrumentation/SendBrownfieldAnalysisCommand.cs | Wraps string result into an object-root command result. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Instrumentation/OrchestratorStartCommand.cs | Wraps string result into an object-root command result. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/Instrumentation/OrchestratorNextCommand.cs | Wraps string result into an object-root command result. |
| tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelListCommand.cs | Wraps health model list into an object-root command result. |
| tools/Azure.Mcp.Tools.Functions/tests/Azure.Mcp.Tools.Functions.Tests/Project/ProjectGetCommandTests.cs | Updates tests for singleton-to-object result normalization. |
| tools/Azure.Mcp.Tools.Functions/tests/Azure.Mcp.Tools.Functions.Tests/Language/LanguageListCommandTests.cs | Updates tests for singleton-to-object result normalization. |
| tools/Azure.Mcp.Tools.Functions/tests/Azure.Mcp.Tools.Functions.Tests/FunctionsCommandTests.cs | Updates tool-level tests to deserialize normalized object results. |
| tools/Azure.Mcp.Tools.Functions/src/Commands/Project/ProjectGetCommand.cs | Changes project template result from singleton array to single object result. |
| tools/Azure.Mcp.Tools.Functions/src/Commands/Language/LanguageListCommand.cs | Changes language list result from singleton array to single object result. |
| tools/Azure.Mcp.Tools.Functions/src/Commands/FunctionsJsonContext.cs | Removes now-unneeded list registrations; keeps normalized object registrations. |
| tools/Azure.Mcp.Tools.AzureTerraformBestPractices/tests/Azure.Mcp.Tools.AzureTerraformBestPractices.Tests/AzureTerraformBestPracticesGetCommandTests.cs | Updates tests to validate wrapper output shape. |
| tools/Azure.Mcp.Tools.AzureTerraformBestPractices/src/Commands/AzureTerraformBestPracticesJsonContext.cs | Registers new wrapper result type for AOT-safe serialization. |
| tools/Azure.Mcp.Tools.AzureTerraformBestPractices/src/Commands/AzureTerraformBestPracticesGetCommand.cs | Wraps best-practices output into an object-root command result. |
| tools/Azure.Mcp.Tools.AzureBestPractices/tests/Azure.Mcp.Tools.AzureBestPractices.Tests/BestPracticesCommandTests.cs | Updates tests to validate wrapper outputs for multiple scenarios. |
| tools/Azure.Mcp.Tools.AzureBestPractices/tests/Azure.Mcp.Tools.AzureBestPractices.Tests/AIAppBestPracticesCommandTests.cs | Updates test to validate wrapper output shape. |
| tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/BestPracticesCommand.cs | Wraps best-practices output into an object-root command result. |
| tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AzureBestPracticesJsonContext.cs | Registers best-practices wrapper result types for AOT-safe serialization. |
| tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AIAppBestPracticesCommand.cs | Wraps best-practices output into an object-root command result. |
| tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationApplyCommandTests.cs | Updates tests to validate wrapper output shape and caching behavior. |
| tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationApplyCommand.cs | Wraps recommendation rules into an object-root command result. |
| tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs | Registers new wrapper result type for AOT-safe serialization. |
| servers/Fabric.Mcp.Server/changelog-entries/1784946362379.yaml | Adds breaking-change entry for Fabric Docs and OneLake output shape normalization. |
| servers/Azure.Mcp.Server/changelog-entries/1784946361604.yaml | Adds breaking-change entry for Azure tool output shape normalization. |
| core/Microsoft.Mcp.Core/src/Models/ModelsJsonContext.cs | Updates core model JSON context for ToolsList result shape normalization. |
| core/Microsoft.Mcp.Core/src/Areas/Tools/Commands/ToolsListCommand.cs | Consolidates ToolsList variants into a single object-root result contract. |
| core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Tools/ToolsListCommandTests.cs | Updates tests to validate ToolsList now emits object-root payloads. |
|
|
||
| [JsonConverter(typeof(ToolsListResultConverter))] | ||
| public sealed record ToolsListResult( | ||
| public sealed record ToolsListCommandResult( |
Contributor
There was a problem hiding this comment.
This is a breaking change on the JSON response shape. I'm fine with it overall, but we are changing the response for azmcp tools list, which will break a lot of CLI usage. This is changing tool listing from:
[
{tool},
{tool},
...
]to
{
"Commands": [
{tool},
{tool},
...
]
}
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?
This PR normalizes command results that currently expose raw arrays, singleton arrays, loosely shaped payloads, mismatched generic result contracts, or multiple object variants. It keeps rename-only churn out of scope while making the affected Azure, core, and Fabric command outputs consistently object-rooted and AOT-safe.
The implementation:
ToolsListCommandvariants into one nullable result contract and omits the inactive field;TResultdeclarations andResponseResult.Createmetadata with the emitted object;Commands that were already normalized on
main, intentional message-only/payload-free commands, and candidates whose only change would be a*Resultto*CommandResultrename are deliberately excluded.Validation completed:
Build-Local.ps1 -VerifyNpxcompleted builds, trimming, and package generation, but its final cache cleanup encountered a persistent environmentalEPERMon a lockedD:\npm-cache\_npxdirectory.GitHub issue number?
N/A
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 PipelineInvoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess to the repo need to validate the contents of this PR before leaving a comment with the text/azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.