Skip to content

Commit fc76143

Browse files
committed
test: fix conformance-tests
1 parent c2f459e commit fc76143

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

conformance-tests/server-servlet/src/main/java/io/modelcontextprotocol/conformance/server/ConformanceServlet.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import io.modelcontextprotocol.spec.McpSchema.EmbeddedResource;
2121
import io.modelcontextprotocol.spec.McpSchema.GetPromptResult;
2222
import io.modelcontextprotocol.spec.McpSchema.ImageContent;
23-
import io.modelcontextprotocol.spec.McpSchema.JsonSchema;
2423
import io.modelcontextprotocol.spec.McpSchema.LoggingLevel;
2524
import io.modelcontextprotocol.spec.McpSchema.LoggingMessageNotification;
2625
import io.modelcontextprotocol.spec.McpSchema.ProgressNotification;
@@ -51,8 +50,8 @@ public class ConformanceServlet {
5150

5251
private static final String MCP_ENDPOINT = "/mcp";
5352

54-
private static final JsonSchema EMPTY_JSON_SCHEMA = new JsonSchema("object", Collections.emptyMap(), null, null,
55-
null, null);
53+
private static final Map<String, Object> EMPTY_JSON_SCHEMA = Map.of("type", "object", "properties",
54+
Collections.emptyMap());
5655

5756
// Minimal 1x1 red pixel PNG (base64 encoded)
5857
private static final String RED_PIXEL_PNG = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==";
@@ -326,10 +325,10 @@ private static List<McpServerFeatures.SyncToolSpecification> createToolSpecs() {
326325
.tool(Tool.builder()
327326
.name("test_sampling")
328327
.description("Tool that requests LLM sampling from client")
329-
.inputSchema(new JsonSchema("object",
328+
.inputSchema(Map.of("type", "object", "properties",
330329
Map.of("prompt",
331330
Map.of("type", "string", "description", "The prompt to send to the LLM")),
332-
List.of("prompt"), null, null, null))
331+
"required", List.of("prompt")))
333332
.build())
334333
.callHandler((exchange, request) -> {
335334
logger.info("Tool 'test_sampling' called");
@@ -355,10 +354,10 @@ private static List<McpServerFeatures.SyncToolSpecification> createToolSpecs() {
355354
.tool(Tool.builder()
356355
.name("test_elicitation")
357356
.description("Tool that requests user input from client")
358-
.inputSchema(new JsonSchema("object",
357+
.inputSchema(Map.of("type", "object", "properties",
359358
Map.of("message",
360359
Map.of("type", "string", "description", "The message to show the user")),
361-
List.of("message"), null, null, null))
360+
"required", List.of("message")))
362361
.build())
363362
.callHandler((exchange, request) -> {
364363
logger.info("Tool 'test_elicitation' called");

mcp-test/src/test/java/io/modelcontextprotocol/spec/McpSchemaTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.assertj.core.api.InstanceOfAssertFactories;
2222
import org.junit.jupiter.api.Test;
2323

24-
2524
import io.modelcontextprotocol.json.TypeRef;
2625
import net.javacrumbs.jsonunit.core.Option;
2726

0 commit comments

Comments
 (0)