Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ModelContextProtocol.Core/Protocol/CallToolResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ public sealed class CallToolResult : Result
/// and potentially self-correct in subsequent requests.
/// </remarks>
[JsonPropertyName("isError")]
public bool IsError { get; set; }
public bool? IsError { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public async Task CallTool_Sse_EchoServer()

// assert
Assert.NotNull(result);
Assert.False(result.IsError);
Assert.Null(result.IsError);
var textContent = Assert.Single(result.Content.OfType<TextContentBlock>());
Assert.Equal("Echo: Hello MCP!", textContent.Text);
}
Expand All @@ -115,9 +115,9 @@ public async Task CallTool_EchoSessionId_ReturnsTheSameSessionId()
Assert.NotNull(result2);
Assert.NotNull(result3);

Assert.False(result1.IsError);
Assert.False(result2.IsError);
Assert.False(result3.IsError);
Assert.Null(result1.IsError);
Assert.Null(result2.IsError);
Assert.Null(result3.IsError);

var textContent1 = Assert.Single(result1.Content.OfType<TextContentBlock>());
var textContent2 = Assert.Single(result2.Content.OfType<TextContentBlock>());
Expand Down Expand Up @@ -298,7 +298,7 @@ public async Task CallTool_Sse_EchoServer_Concurrently()
);

Assert.NotNull(result);
Assert.False(result.IsError);
Assert.Null(result.IsError);
var textContent = Assert.Single(result.Content.OfType<TextContentBlock>());
Assert.Equal($"Echo: Hello MCP! {i}", textContent.Text);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ModelContextProtocol.AspNetCore.Tests/MapMcpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public async Task Sampling_DoesNotCloseStream_Prematurely()
}, cancellationToken: TestContext.Current.CancellationToken);

Assert.NotNull(result);
Assert.False(result.IsError);
Assert.Null(result.IsError);
var textContent = Assert.Single(result.Content);
Assert.Equal("text", textContent.Type);
Assert.Equal("Sampling completed successfully. Client responded: Sampling response from client", Assert.IsType<TextContentBlock>(textContent).Text);
Expand Down
6 changes: 3 additions & 3 deletions tests/ModelContextProtocol.Tests/ClientIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public async Task CallTool_Stdio_EchoServer(string clientId)

// assert
Assert.NotNull(result);
Assert.False(result.IsError);
Assert.Null(result.IsError);
var textContent = Assert.Single(result.Content.OfType<TextContentBlock>());
Assert.Equal("Echo: Hello MCP!", textContent.Text);
}
Expand All @@ -107,7 +107,7 @@ public async Task CallTool_Stdio_EchoSessionId_ReturnsEmpty()

// assert
Assert.NotNull(result);
Assert.False(result.IsError);
Assert.Null(result.IsError);
var textContent = Assert.Single(result.Content.OfType<TextContentBlock>());
Assert.Empty(textContent.Text);
}
Expand Down Expand Up @@ -485,7 +485,7 @@ public async Task CallTool_Stdio_MemoryServer()

// assert
Assert.NotNull(result);
Assert.False(result.IsError);
Assert.Null(result.IsError);
Assert.Single(result.Content, c => c.Type == "text");

await client.DisposeAsync();
Expand Down
Loading