-
Notifications
You must be signed in to change notification settings - Fork 546
Closed
Description
Repro:
- Create an
McpServerToolthat returns IEnumerable - Observe the following exception:
JsonTypeInfo metadata for type 'System.Collections.Generic.IEnumerable`1[ModelContextProtocol.Protocol.ContentBlock]' was not provided by TypeInfoResolver of type '[ModelContextProtocol.McpJsonUtilities+JsonContext, Microsoft.Extensions.AI.AIJsonUtilities+JsonContext]'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically
Looks like IEnumerable and similar for ContentBlock and derived types is not part of the json serializer context:
| internal sealed partial class JsonContext : JsonSerializerContext; |
Copilot
Metadata
Metadata
Assignees
Labels
No labels