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)
568
568
throw new ArgumentException ( "Parameter is missing a name." , nameof ( parameter ) ) ;
569
569
}
570
570
571
- // Resolve the contract used to marshal the value from JSON -- can throw if not supported or not found.
572
571
Type parameterType = parameter . ParameterType ;
573
- JsonTypeInfo typeInfo = serializerOptions . GetTypeInfo ( parameterType ) ;
574
572
575
573
// For CancellationToken parameters, we always bind to the token passed directly to InvokeAsync.
576
574
if ( parameterType == typeof ( CancellationToken ) )
@@ -606,6 +604,8 @@ static bool IsAsyncMethod(MethodInfo method)
606
604
}
607
605
608
606
// 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 ) ;
609
609
return ( arguments , _ ) =>
610
610
{
611
611
// 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