Add netstandard2.0 support (#33)

* Add netstandard2.0 support
This commit is contained in:
Stephen Toub 2025-03-07 14:46:40 -05:00 • committed by GitHub
commit 9c597aad90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,8 +37,7 @@ public static partial class McpServerBuilderExtensions
/// <param name="toolTypes">Types with marked methods to add as tools to the server.</param>
public static IMcpServerBuilder WithTools(this IMcpServerBuilder builder, params Type[] toolTypes)
{
ArgumentNullException.ThrowIfNull(toolTypes);
if (toolTypes.Length == 0)
if (toolTypes is null || toolTypes.Length == 0)
throw new ArgumentException("At least one tool type must be provided.", nameof(toolTypes));
var tools = new List<Tool>();