11/*
2- * Copyright 2024-2024 the original author or authors.
2+ * Copyright 2024-2026 the original author or authors.
33 */
44
55package io .modelcontextprotocol .spec ;
66
77import java .io .IOException ;
88import java .util .ArrayList ;
9- import java .util .Arrays ;
109import java .util .HashMap ;
1110import java .util .List ;
1211import java .util .Map ;
3433 * @author Luca Chang
3534 * @author Surbhi Bansal
3635 * @author Anurag Pant
36+ * @author Dariusz Jędrzejczyk
3737 */
3838public final class McpSchema {
3939
@@ -1177,10 +1177,6 @@ public Prompt(String name, String description, List<PromptArgument> arguments) {
11771177 public Prompt (String name , String title , String description , List <PromptArgument > arguments ) {
11781178 this (name , title , description , arguments , null );
11791179 }
1180-
1181- public static Prompt withDefaults (String name , String description , List <PromptArgument > arguments ) {
1182- return new Prompt (name , null , description , arguments != null ? arguments : new ArrayList <>(), null );
1183- }
11841180 }
11851181
11861182 /**
@@ -2317,9 +2313,13 @@ public LoggingMessageNotification build() {
23172313 }
23182314 }
23192315
2316+ /**
2317+ * Severity levels for MCP log messages, ordered from least to most severe. The
2318+ * numeric {@link #level()} can be used to compare severities. Deserialization is
2319+ * case-insensitive and returns {@code null} for unrecognized values.
2320+ */
23202321 public enum LoggingLevel {
23212322
2322- // @formatter:off
23232323 @ JsonProperty ("debug" ) DEBUG (0 ),
23242324 @ JsonProperty ("info" ) INFO (1 ),
23252325 @ JsonProperty ("notice" ) NOTICE (2 ),
@@ -2328,7 +2328,6 @@ public enum LoggingLevel {
23282328 @ JsonProperty ("critical" ) CRITICAL (5 ),
23292329 @ JsonProperty ("alert" ) ALERT (6 ),
23302330 @ JsonProperty ("emergency" ) EMERGENCY (7 );
2331- // @formatter:on
23322331
23332332 private final int level ;
23342333
@@ -2372,6 +2371,12 @@ public record SetLevelRequest(@JsonProperty("level") LoggingLevel level) {
23722371 // ---------------------------
23732372 // Autocomplete
23742373 // ---------------------------
2374+
2375+ /**
2376+ * A reference to a prompt or resource that can be used as input for completion
2377+ * requests. Implementations are identified by a {@code "type"} discriminator field
2378+ * whose value maps to a concrete subtype via {@code @JsonSubTypes}.
2379+ */
23752380 @ JsonTypeInfo (use = JsonTypeInfo .Id .NAME , include = JsonTypeInfo .As .EXISTING_PROPERTY , property = "type" ,
23762381 visible = true )
23772382 @ JsonSubTypes ({ @ JsonSubTypes .Type (value = PromptReference .class , name = PromptReference .TYPE ),
@@ -2546,6 +2551,11 @@ public record CompleteCompletion( // @formatter:off
25462551 // ---------------------------
25472552 // Content Types
25482553 // ---------------------------
2554+
2555+ /**
2556+ * A polymorphic content value that can appear in messages and tool results. The
2557+ * concrete type is determined by the {@code "type"} JSON property.
2558+ */
25492559 @ JsonTypeInfo (use = JsonTypeInfo .Id .NAME , include = JsonTypeInfo .As .PROPERTY , property = "type" )
25502560 @ JsonSubTypes ({ @ JsonSubTypes .Type (value = TextContent .class , name = "text" ),
25512561 @ JsonSubTypes .Type (value = ImageContent .class , name = "image" ),
0 commit comments