Fix CallToolAsync for tools with no arguments (#18)
This commit is contained in:
parent
86f1edfe38
commit
c384c7d3de
3 changed files with 3 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ public class McpAIFunction : AIFunction
|
||||||
// Call the tool through mcpdotnet
|
// Call the tool through mcpdotnet
|
||||||
var result = await _client.CallToolAsync(
|
var result = await _client.CallToolAsync(
|
||||||
_tool.Name,
|
_tool.Name,
|
||||||
argDict.Count == 0 ? null: argDict,
|
argDict.Count == 0 ? new(): argDict,
|
||||||
cancellationToken: cancellationToken
|
cancellationToken: cancellationToken
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -346,7 +346,7 @@ internal class McpClient : IMcpClient
|
||||||
new JsonRpcRequest
|
new JsonRpcRequest
|
||||||
{
|
{
|
||||||
Method = "tools/call",
|
Method = "tools/call",
|
||||||
Params = CreateParametersDictionary(toolName, arguments)
|
Params = CreateParametersDictionary(toolName, arguments ?? new())
|
||||||
},
|
},
|
||||||
cancellationToken
|
cancellationToken
|
||||||
).ConfigureAwait(false);
|
).ConfigureAwait(false);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- license and package properties -->
|
<!-- license and package properties -->
|
||||||
<PackageId>mcpdotnet</PackageId>
|
<PackageId>mcpdotnet</PackageId>
|
||||||
<Version>0.9.0.1</Version>
|
<Version>0.10.0.1</Version>
|
||||||
<Authors>PederHP</Authors>
|
<Authors>PederHP</Authors>
|
||||||
<Description>.NET client library for the Model Context Protocol (MCP)</Description>
|
<Description>.NET client library for the Model Context Protocol (MCP)</Description>
|
||||||
<PackageProjectUrl>https://github.com/PederHP/mcpdotnet</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/PederHP/mcpdotnet</PackageProjectUrl>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue