File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/ModelContextProtocol/Server Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -568,9 +568,7 @@ static bool IsAsyncMethod(MethodInfo method)
568568 throw new ArgumentException ( "Parameter is missing a name." , nameof ( parameter ) ) ;
569569 }
570570
571- // Resolve the contract used to marshal the value from JSON -- can throw if not supported or not found.
572571 Type parameterType = parameter . ParameterType ;
573- JsonTypeInfo typeInfo = serializerOptions . GetTypeInfo ( parameterType ) ;
574572
575573 // For CancellationToken parameters, we always bind to the token passed directly to InvokeAsync.
576574 if ( parameterType == typeof ( CancellationToken ) )
@@ -606,6 +604,8 @@ static bool IsAsyncMethod(MethodInfo method)
606604 }
607605
608606 // For all other parameters, create a marshaller that tries to extract the value from the arguments dictionary.
607+ // Resolve the contract used to marshal the value from JSON -- can throw if not supported or not found.
608+ JsonTypeInfo typeInfo = serializerOptions . GetTypeInfo ( parameterType ) ;
609609 return ( arguments , _ ) =>
610610 {
611611 // If the parameter has an argument specified in the dictionary, return that argument.
You can’t perform that action at this time.
0 commit comments