Fix CallToolAsync for tools with no arguments (#18)

This commit is contained in:
Peder Holdgaard Pedersen 2025-02-07 09:26:42 +01:00 • committed by GitHub
commit c384c7d3de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
);