@@ -146,16 +146,16 @@ private async Task<McpResult> PromptWithHttp(
146146 . Deserialize < Dictionary < string , JsonElement > > ( argsJson )
147147 ? . ToDictionary (
148148 kvp => kvp . Key ,
149- kvp => kvp . Value . ValueKind switch
149+ kvp => ( object ? ) ( kvp . Value . ValueKind switch
150150 {
151151 JsonValueKind . String => ( object ) kvp . Value . GetString ( ) ! ,
152152 JsonValueKind . True => true ,
153153 JsonValueKind . False => false ,
154154 JsonValueKind . Number when kvp . Value . TryGetInt64 ( out var l ) => l ,
155155 JsonValueKind . Number => ( object ) kvp . Value . GetDouble ( ) ,
156156 _ => ( object ) kvp . Value
157- } )
158- ?? new Dictionary < string , object > ( ) ;
157+ } ) )
158+ ?? new Dictionary < string , object ? > ( ) ;
159159
160160 var toolResult = await mcpClient . CallToolAsync ( toolName , argsDict ) ;
161161 var resultText = string . Join ( "\n " , toolResult . Content
@@ -291,16 +291,16 @@ private async Task<McpResult> PromptWithAnthropic(
291291 . Deserialize < Dictionary < string , JsonElement > > ( inputElement . GetRawText ( ) )
292292 ? . ToDictionary (
293293 kvp => kvp . Key ,
294- kvp => kvp . Value . ValueKind switch
294+ kvp => ( object ? ) ( kvp . Value . ValueKind switch
295295 {
296296 JsonValueKind . String => ( object ) kvp . Value . GetString ( ) ! ,
297297 JsonValueKind . True => true ,
298298 JsonValueKind . False => false ,
299299 JsonValueKind . Number when kvp . Value . TryGetInt64 ( out var l ) => l ,
300300 JsonValueKind . Number => ( object ) kvp . Value . GetDouble ( ) ,
301301 _ => ( object ) kvp . Value
302- } )
303- ?? new Dictionary < string , object > ( ) ;
302+ } ) )
303+ ?? new Dictionary < string , object ? > ( ) ;
304304
305305 var toolResult = await mcpClient . CallToolAsync ( toolName , argsDict ) ;
306306 var resultText = string . Join ( "\n " , toolResult . Content
0 commit comments