Skip to content

Commit 1fe273d

Browse files
committed
Add MrtrProtocolTests
1 parent e788171 commit 1fe273d

2 files changed

Lines changed: 593 additions & 19 deletions

File tree

src/ModelContextProtocol.Core/Client/McpClient.Methods.cs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,25 +1326,8 @@ private async ValueTask<TResult> SendRequestWithMrtrAsync<TParams, TResult>(
13261326

13271327
if (incompleteResult.InputRequests is { Count: > 0 } inputRequests)
13281328
{
1329-
IDictionary<string, InputResponse> inputResponses;
1330-
try
1331-
{
1332-
inputResponses = await ResolveInputRequestsAsync(inputRequests, cancellationToken).ConfigureAwait(false);
1333-
}
1334-
catch (OperationCanceledException)
1335-
{
1336-
throw;
1337-
}
1338-
catch (McpException)
1339-
{
1340-
throw;
1341-
}
1342-
catch (Exception ex)
1343-
{
1344-
// Wrap handler exceptions in McpProtocolException to match the legacy behavior
1345-
// where handler exceptions are encoded as JSON-RPC errors and decoded as McpProtocolException.
1346-
throw new McpProtocolException(ex.Message, ex, McpErrorCode.InternalError);
1347-
}
1329+
IDictionary<string, InputResponse> inputResponses =
1330+
await ResolveInputRequestsAsync(inputRequests, cancellationToken).ConfigureAwait(false);
13481331

13491332
// Serialize input responses into the parameters for the retry
13501333
var paramsNode = JsonSerializer.SerializeToNode(parameters, parametersTypeInfo) as JsonObject

0 commit comments

Comments
 (0)