Skip to content

Add outputSchema and structuredContent infrastructure with App Config pilot#3000

Draft
vcolin7 wants to merge 3 commits into
vcolin7/input-output-schema-v2from
vcolin7/output-schema-infra
Draft

Add outputSchema and structuredContent infrastructure with App Config pilot#3000
vcolin7 wants to merge 3 commits into
vcolin7/input-output-schema-v2from
vcolin7/output-schema-infra

Conversation

@vcolin7

@vcolin7 vcolin7 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Stacked on #2995 (base branch = vcolin7/input-output-schema-v2). This is PR 2 of the MCP schema modernization series, so it only shows its own 3 commits. Please review/merge after #2995; GitHub will retarget this PR to main automatically once #2995 merges and the branch it's based on gets deleted.

Modernizes the Azure MCP Server to advertise outputSchema on tools/list and return structuredContent on tools/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) and BaseCommand<TOptions, TResult> expose the command's result JsonTypeInfo plus a SetResult helper. ResultTypeInfo defaults to null, so this is strictly opt-in: un-migrated commands advertise no outputSchema and are completely unaffected.
  • OptionSchemaGenerator.CreateOutputSchema derives a JSON Schema from the result type via JsonSchemaExporter (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 a value property.
  • CommandFactoryToolLoader emits outputSchema and builds a matching structuredContent payload; RegistryToolLoader passes both through for external/registry servers.

App Configuration pilot

  • Migrated 5 commands (account list, keyvalue get/set/delete, keyvalue lock set) to declare ResultTypeInfo and call SetResult, so they now advertise outputSchema and return structuredContent.

Reviewer notes

  • structuredContent shaping mirrors the schema wrapping: object results are mirrored as-is; arrays/scalars are wrapped under value so the payload validates against the advertised schema.
  • additionalProperties is intentionally left unset on outputs (forward-compatible as servers add fields), unlike inputs where it is false.
  • ResultTypeInfo is deliberately virtual with a null default rather than abstract; a later PR tightens this with a discovery test once every namespace is migrated.
  • Tests are decoupled from any shipping tool: CreateOutputSchema and TryBuildStructuredContent are covered directly using a sample result record and a real serialized CommandResponse.

GitHub issue number?

N/A

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 (N/A — shared schema infrastructure plus the App Configuration pilot namespace; no tools are added or renamed, only their advertised output schema)
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation (N/A — no tool names or descriptions change)
    • 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 (N/A — descriptions unchanged)
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json (N/A — no new/renamed tools)
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label (N/A)
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description (N/A)
  • 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

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access 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.

@github-project-automation github-project-automation Bot moved this to Untriaged in Azure MCP Server Jul 7, 2026
@github-actions github-actions Bot added the tools-AppConfig AppConfig label Jul 7, 2026
@vcolin7 vcolin7 requested review from alzimmermsft and g2vinay July 7, 2026 00:40
@vcolin7 vcolin7 self-assigned this Jul 7, 2026
@vcolin7 vcolin7 moved this from Untriaged to In Progress in Azure MCP Server Jul 7, 2026
@vcolin7 vcolin7 modified the milestones: 2026-06, 2026-07 Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant