2020import io .modelcontextprotocol .spec .McpSchema .EmbeddedResource ;
2121import io .modelcontextprotocol .spec .McpSchema .GetPromptResult ;
2222import io .modelcontextprotocol .spec .McpSchema .ImageContent ;
23- import io .modelcontextprotocol .spec .McpSchema .JsonSchema ;
2423import io .modelcontextprotocol .spec .McpSchema .LoggingLevel ;
2524import io .modelcontextprotocol .spec .McpSchema .LoggingMessageNotification ;
2625import 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" );
0 commit comments