Skip to content

Commit 39fa9cc

Browse files
reakaleekclaude
andcommitted
MCP: fix integration tests broken by CallToolResult return type change
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4ebbcad commit 39fa9cc

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests-integration/Mcp.Remote.IntegrationTests/SearchToolsIntegrationTests.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Text.Json;
66
using AwesomeAssertions;
77
using Elastic.Documentation.Mcp.Remote.Responses;
8+
using ModelContextProtocol.Protocol;
89

910
namespace Mcp.Remote.IntegrationTests;
1011

@@ -24,9 +25,10 @@ public async Task SemanticSearch_ReturnsResults()
2425
Assert.SkipUnless(canConnect, "Elasticsearch is not connected");
2526

2627
// Act
27-
var resultJson = await searchTools.SemanticSearch(
28+
var result = await searchTools.SemanticSearch(
2829
"elasticsearch getting started",
2930
cancellationToken: TestContext.Current.CancellationToken);
31+
var resultJson = ((TextContentBlock)result.Content[0]).Text;
3032

3133
// Assert
3234
Output.WriteLine($"Result: {resultJson}");
@@ -53,10 +55,11 @@ public async Task SemanticSearch_WithProductFilter()
5355
Assert.SkipUnless(canConnect, "Elasticsearch is not connected");
5456

5557
// Act
56-
var resultJson = await searchTools.SemanticSearch(
58+
var result = await searchTools.SemanticSearch(
5759
"getting started",
5860
productFilter: "elasticsearch",
5961
cancellationToken: TestContext.Current.CancellationToken);
62+
var resultJson = ((TextContentBlock)result.Content[0]).Text;
6063

6164
// Assert
6265
Output.WriteLine($"Result: {resultJson}");
@@ -81,10 +84,11 @@ public async Task FindRelatedDocs_ReturnsRelated()
8184
Assert.SkipUnless(canConnect, "Elasticsearch is not connected");
8285

8386
// Act
84-
var resultJson = await searchTools.FindRelatedDocs(
87+
var result = await searchTools.FindRelatedDocs(
8588
"data streams",
8689
limit: 5,
8790
cancellationToken: TestContext.Current.CancellationToken);
91+
var resultJson = ((TextContentBlock)result.Content[0]).Text;
8892

8993
// Assert
9094
Output.WriteLine($"Result: {resultJson}");

0 commit comments

Comments
 (0)