Skip to content

Commit 155cc6f

Browse files
committed
Tweaks
1 parent 3677281 commit 155cc6f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ModelContextProtocol/Client/McpClientTool.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using ModelContextProtocol.Protocol.Types;
22
using ModelContextProtocol.Utils.Json;
3+
using ModelContextProtocol.Utils;
34
using Microsoft.Extensions.AI;
45
using System.Text.Json;
56

@@ -17,7 +18,7 @@ internal McpClientTool(IMcpClient client, Tool tool, string? name = null, string
1718
_client = client;
1819
ProtocolTool = tool;
1920
_name = name ?? tool.Name;
20-
_description = description ?? tool.Description;
21+
_description = description ?? tool.Description ?? string.Empty;
2122
}
2223

2324
/// <summary>
@@ -50,10 +51,10 @@ public McpClientTool WithDescription(string description)
5051
public Tool ProtocolTool { get; }
5152

5253
/// <inheritdoc/>
53-
public override string Name => _name!;
54+
public override string Name => _name;
5455

5556
/// <inheritdoc/>
56-
public override string Description => _description ?? string.Empty;
57+
public override string Description => _description;
5758

5859
/// <inheritdoc/>
5960
public override JsonElement JsonSchema => ProtocolTool.InputSchema;

0 commit comments

Comments
 (0)