Skip to content

Commit b9468e2

Browse files
committed
Serialize structured content not result
1 parent fc571e2 commit b9468e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public override async ValueTask<CallToolResult> InvokeAsync(
263263
// If there is structuredOutput we must stringify it, as the MCP specification requires Content to be for backwards compatibility
264264
// but otherwise not differ
265265
Content = [new TextContentBlock { Text = structuredContent == null ? text :
266-
JsonSerializer.Serialize(result, AIFunction.JsonSerializerOptions.GetTypeInfo(typeof(object)))}],
266+
JsonSerializer.Serialize(structuredContent, AIFunction.JsonSerializerOptions.GetTypeInfo(typeof(object)))}],
267267
StructuredContent = structuredContent,
268268
},
269269

0 commit comments

Comments
 (0)