Add outputSchema and structuredContent infrastructure with App Config pilot#3000
Draft
vcolin7 wants to merge 3 commits into
Draft
Add outputSchema and structuredContent infrastructure with App Config pilot#3000vcolin7 wants to merge 3 commits into
vcolin7 wants to merge 3 commits into
Conversation
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?
Modernizes the Azure MCP Server to advertise
outputSchemaontools/listand returnstructuredContentontools/call, aligning with MCP spec 2025-11-25. This PR lands the reusable core infrastructure plus App Configuration as the first opt-in pilot namespace. Every other namespace is untouched and keeps behaving exactly as before.Core infrastructure
IBaseCommand.ResultTypeInfo(default-interface member) andBaseCommand<TOptions, TResult>expose the command's resultJsonTypeInfoplus aSetResulthelper.ResultTypeInfodefaults tonull, so this is strictly opt-in: un-migrated commands advertise nooutputSchemaand are completely unaffected.OptionSchemaGenerator.CreateOutputSchemaderives a JSON Schema from the result type viaJsonSchemaExporter(the same approach PR 1 used for inputs). The spec requires the schema root to be{"type":"object"}, so non-object results (arrays/scalars) are wrapped under avalueproperty.CommandFactoryToolLoaderemitsoutputSchemaand builds a matchingstructuredContentpayload;RegistryToolLoaderpasses both through for external/registry servers.App Configuration pilot
account list,keyvalue get/set/delete,keyvalue lock set) to declareResultTypeInfoand callSetResult, so they now advertiseoutputSchemaand returnstructuredContent.Reviewer notes
structuredContentshaping mirrors the schema wrapping: object results are mirrored as-is; arrays/scalars are wrapped undervalueso the payload validates against the advertised schema.additionalPropertiesis intentionally left unset on outputs (forward-compatible as servers add fields), unlike inputs where it isfalse.ResultTypeInfois deliberatelyvirtualwith anulldefault rather thanabstract; a later PR tightens this with a discovery test once every namespace is migrated.CreateOutputSchemaandTryBuildStructuredContentare covered directly using a sample result record and a real serializedCommandResponse.GitHub issue number?
N/A
Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentation (N/A — no tool names or descriptions change)README.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 prompts (N/A — descriptions unchanged)consolidated-tools.json(N/A — no new/renamed tools)breaking-changelabel (N/A)servers/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.