File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/ModelContextProtocol.Core/Server Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -372,13 +372,14 @@ internal static IReadOnlyList<object> CreateMetadata(MethodInfo method)
372372 var metaAttributes = method . GetCustomAttributes < McpMetaAttribute > ( ) ;
373373
374374 JsonObject ? meta = seedMeta ;
375+ JsonSerializerOptions options = serializerOptions ?? McpJsonUtilities . DefaultOptions ;
375376 foreach ( var attr in metaAttributes )
376377 {
377378 meta ??= new JsonObject ( ) ;
378379 // Only add the attribute property if it doesn't already exist in the seed
379380 if ( ! meta . ContainsKey ( attr . Name ) )
380381 {
381- meta [ attr . Name ] = JsonSerializer . SerializeToNode ( attr . Value , serializerOptions ?? McpJsonUtilities . DefaultOptions ) ;
382+ meta [ attr . Name ] = JsonSerializer . SerializeToNode ( attr . Value , options . GetTypeInfo ( typeof ( object ) ) ) ;
382383 }
383384 }
384385
You can’t perform that action at this time.
0 commit comments