diff --git a/samples/microsoft.extensions.ai/tools/ToolsConsole/McpAIFunction.cs b/samples/microsoft.extensions.ai/tools/ToolsConsole/McpAIFunction.cs index bc0bd1e..7a22519 100644 --- a/samples/microsoft.extensions.ai/tools/ToolsConsole/McpAIFunction.cs +++ b/samples/microsoft.extensions.ai/tools/ToolsConsole/McpAIFunction.cs @@ -43,7 +43,7 @@ public class McpAIFunction : AIFunction // Call the tool through mcpdotnet var result = await _client.CallToolAsync( _tool.Name, - argDict.Count == 0 ? null: argDict, + argDict.Count == 0 ? new(): argDict, cancellationToken: cancellationToken ); diff --git a/src/mcpdotnet/Client/McpClient.cs b/src/mcpdotnet/Client/McpClient.cs index 2337ff4..71b07e9 100644 --- a/src/mcpdotnet/Client/McpClient.cs +++ b/src/mcpdotnet/Client/McpClient.cs @@ -346,7 +346,7 @@ internal class McpClient : IMcpClient new JsonRpcRequest { Method = "tools/call", - Params = CreateParametersDictionary(toolName, arguments) + Params = CreateParametersDictionary(toolName, arguments ?? new()) }, cancellationToken ).ConfigureAwait(false); diff --git a/src/mcpdotnet/mcpdotnet.csproj b/src/mcpdotnet/mcpdotnet.csproj index 819c647..ff0163b 100644 --- a/src/mcpdotnet/mcpdotnet.csproj +++ b/src/mcpdotnet/mcpdotnet.csproj @@ -9,7 +9,7 @@ mcpdotnet - 0.9.0.1 + 0.10.0.1 PederHP .NET client library for the Model Context Protocol (MCP) https://github.com/PederHP/mcpdotnet