From a3257ad254985b60bf3b2dfa5c46b9afbde3f8cb Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Mon, 14 Apr 2025 07:39:51 -0700 Subject: [PATCH] Remove unessesary $ and fix some typos --- src/ModelContextProtocol/Client/McpClient.cs | 4 ++-- src/ModelContextProtocol/Client/McpClientExtensions.cs | 8 ++++---- .../Protocol/Messages/ProgressToken.cs | 2 +- .../Server/AIFunctionMcpServerPrompt.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ModelContextProtocol/Client/McpClient.cs b/src/ModelContextProtocol/Client/McpClient.cs index eb197d622..d80f8fc38 100644 --- a/src/ModelContextProtocol/Client/McpClient.cs +++ b/src/ModelContextProtocol/Client/McpClient.cs @@ -55,7 +55,7 @@ public McpClient(IClientTransport clientTransport, McpClientOptions? options, IL { if (samplingCapability.SamplingHandler is not { } samplingHandler) { - throw new InvalidOperationException($"Sampling capability was set but it did not provide a handler."); + throw new InvalidOperationException("Sampling capability was set but it did not provide a handler."); } RequestHandlers.Set( @@ -72,7 +72,7 @@ public McpClient(IClientTransport clientTransport, McpClientOptions? options, IL { if (rootsCapability.RootsHandler is not { } rootsHandler) { - throw new InvalidOperationException($"Roots capability was set but it did not provide a handler."); + throw new InvalidOperationException("Roots capability was set but it did not provide a handler."); } RequestHandlers.Set( diff --git a/src/ModelContextProtocol/Client/McpClientExtensions.cs b/src/ModelContextProtocol/Client/McpClientExtensions.cs index f495e89cb..a86f7e60a 100644 --- a/src/ModelContextProtocol/Client/McpClientExtensions.cs +++ b/src/ModelContextProtocol/Client/McpClientExtensions.cs @@ -145,7 +145,7 @@ public static async Task> ListToolsAsync( /// /// /// Every iteration through the returned - /// will result in requerying the server and yielding the sequence of available tools. + /// will result in re-querying the server and yielding the sequence of available tools. /// /// /// @@ -248,7 +248,7 @@ public static async Task> ListPromptsAsync( /// /// /// Every iteration through the returned - /// will result in requerying the server and yielding the sequence of available prompts. + /// will result in re-querying the server and yielding the sequence of available prompts. /// /// /// @@ -396,7 +396,7 @@ public static async Task> ListResourceTemplatesAsync( /// /// /// Every iteration through the returned - /// will result in requerying the server and yielding the sequence of available resource templates. + /// will result in re-querying the server and yielding the sequence of available resource templates. /// /// /// @@ -510,7 +510,7 @@ public static async Task> ListResourcesAsync( /// /// /// Every iteration through the returned - /// will result in requerying the server and yielding the sequence of available resources. + /// will result in re-querying the server and yielding the sequence of available resources. /// /// /// diff --git a/src/ModelContextProtocol/Protocol/Messages/ProgressToken.cs b/src/ModelContextProtocol/Protocol/Messages/ProgressToken.cs index 1f7395258..ac5ceb184 100644 --- a/src/ModelContextProtocol/Protocol/Messages/ProgressToken.cs +++ b/src/ModelContextProtocol/Protocol/Messages/ProgressToken.cs @@ -37,7 +37,7 @@ public ProgressToken(long value) /// public override string? ToString() => - _token is string stringValue ? $"{stringValue}" : + _token is string stringValue ? stringValue : _token is long longValue ? longValue.ToString(CultureInfo.InvariantCulture) : null; diff --git a/src/ModelContextProtocol/Server/AIFunctionMcpServerPrompt.cs b/src/ModelContextProtocol/Server/AIFunctionMcpServerPrompt.cs index 85bf38cad..d3b48b6c0 100644 --- a/src/ModelContextProtocol/Server/AIFunctionMcpServerPrompt.cs +++ b/src/ModelContextProtocol/Server/AIFunctionMcpServerPrompt.cs @@ -263,7 +263,7 @@ public override async ValueTask GetAsync( Messages = [.. chatMessages.SelectMany(chatMessage => chatMessage.ToPromptMessages())], }, - null => throw new InvalidOperationException($"Null result returned from prompt function."), + null => throw new InvalidOperationException("Null result returned from prompt function."), _ => throw new InvalidOperationException($"Unknown result type '{result.GetType()}' returned from prompt function."), };