Skip to content

Fix Foundry Serialization issue.#904

Merged
g2vinay merged 3 commits intomicrosoft:mainfrom
g2vinay:fix-foundry-serialization-issue
Oct 23, 2025
Merged

Fix Foundry Serialization issue.#904
g2vinay merged 3 commits intomicrosoft:mainfrom
g2vinay:fix-foundry-serialization-issue

Conversation

@g2vinay
Copy link
Copy Markdown
Contributor

@g2vinay g2vinay commented Oct 21, 2025

Fixes #621 foundry serialization issue.

@g2vinay g2vinay changed the title fix serialization Fix Foundry Serialization issue. Oct 21, 2025
@joshfree joshfree added bug Something isn't working server-Azure.Mcp Azure.Mcp.Server tools-Foundry Azure AI Foundry labels Oct 21, 2025
@joshfree joshfree added this to the 2025-10 milestone Oct 21, 2025
@joshfree joshfree moved this from Untriaged to In Progress in Azure MCP Server Oct 21, 2025
Comment thread tools/Azure.Mcp.Tools.Foundry/src/Commands/FoundryJsonContext.cs Outdated
Copy link
Copy Markdown
Member

@anuchandy anuchandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Vinay, lgtm!

@g2vinay g2vinay marked this pull request as ready for review October 23, 2025 16:56
@g2vinay g2vinay requested review from a team and xiangyan99 as code owners October 23, 2025 16:56
@g2vinay g2vinay merged commit 7e3597d into microsoft:main Oct 23, 2025
21 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a serialization issue in the Foundry service by replacing the generic JSON serialization approach with a properly configured source-generated JSON context. The change ensures AOT-safe serialization of tool definitions.

Key Changes:

  • Replaced dynamic type info retrieval with source-generated JSON serialization context
  • Added missing type registrations to FoundryJsonContext for ToolDefinitionAIFunction and its list type

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tools/Azure.Mcp.Tools.Foundry/src/Services/FoundryService.cs Updated serialization call to use FoundryJsonContext instead of dynamic type info
tools/Azure.Mcp.Tools.Foundry/src/Commands/FoundryJsonContext.cs Added JSON serializable attributes for ToolDefinitionAIFunction types and required namespace import

@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Oct 23, 2025
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server-Azure.Mcp Azure.Mcp.Server tools-Foundry Azure AI Foundry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

A serialization error occurred when connecting to the AI Foundry agent.

4 participants