@@ -219,7 +219,7 @@ public record JSONRPCRequest( // @formatter:off
219219 public record JSONRPCNotification ( // @formatter:off
220220 @ JsonProperty ("jsonrpc" ) String jsonrpc ,
221221 @ JsonProperty ("method" ) String method ,
222- @ JsonProperty ("params" ) Object params ) implements JSONRPCMessage {// @formatter:on
222+ @ JsonProperty ("params" ) Object params ) implements JSONRPCMessage { // @formatter:on
223223 }
224224
225225 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
@@ -230,14 +230,14 @@ public record JSONRPCResponse( // @formatter:off
230230 @ JsonProperty ("jsonrpc" ) String jsonrpc ,
231231 @ JsonProperty ("id" ) Object id ,
232232 @ JsonProperty ("result" ) Object result ,
233- @ JsonProperty ("error" ) JSONRPCError error ) implements JSONRPCMessage {// @formatter:on
233+ @ JsonProperty ("error" ) JSONRPCError error ) implements JSONRPCMessage { // @formatter:on
234234
235235 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
236236 @ JsonIgnoreProperties (ignoreUnknown = true )
237- public record JSONRPCError (// @formatter:off
237+ public record JSONRPCError ( // @formatter:off
238238 @ JsonProperty ("code" ) int code ,
239239 @ JsonProperty ("message" ) String message ,
240- @ JsonProperty ("data" ) Object data ) {// @formatter:on
240+ @ JsonProperty ("data" ) Object data ) { // @formatter:on
241241 }
242242 }
243243
@@ -250,7 +250,7 @@ public record InitializeRequest( // @formatter:off
250250 @ JsonProperty ("protocolVersion" ) String protocolVersion ,
251251 @ JsonProperty ("capabilities" ) ClientCapabilities capabilities ,
252252 @ JsonProperty ("clientInfo" ) Implementation clientInfo ,
253- @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request {// @formatter:on
253+ @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request { // @formatter:on
254254
255255 public InitializeRequest (String protocolVersion , ClientCapabilities capabilities , Implementation clientInfo ) {
256256 this (protocolVersion , capabilities , clientInfo , null );
@@ -263,7 +263,7 @@ public record InitializeResult( // @formatter:off
263263 @ JsonProperty ("protocolVersion" ) String protocolVersion ,
264264 @ JsonProperty ("capabilities" ) ServerCapabilities capabilities ,
265265 @ JsonProperty ("serverInfo" ) Implementation serverInfo ,
266- @ JsonProperty ("instructions" ) String instructions ) {// @formatter:on
266+ @ JsonProperty ("instructions" ) String instructions ) { // @formatter:on
267267 }
268268
269269 /**
@@ -288,7 +288,7 @@ public record ClientCapabilities( // @formatter:off
288288 @ JsonProperty ("experimental" ) Map <String , Object > experimental ,
289289 @ JsonProperty ("roots" ) RootCapabilities roots ,
290290 @ JsonProperty ("sampling" ) Sampling sampling ,
291- @ JsonProperty ("elicitation" ) Elicitation elicitation ) {// @formatter:on
291+ @ JsonProperty ("elicitation" ) Elicitation elicitation ) { // @formatter:on
292292
293293 /**
294294 * Roots define the boundaries of where servers can operate within the filesystem,
@@ -376,7 +376,7 @@ public record ServerCapabilities( // @formatter:off
376376 @ JsonProperty ("logging" ) LoggingCapabilities logging ,
377377 @ JsonProperty ("prompts" ) PromptCapabilities prompts ,
378378 @ JsonProperty ("resources" ) ResourceCapabilities resources ,
379- @ JsonProperty ("tools" ) ToolCapabilities tools ) {// @formatter:on
379+ @ JsonProperty ("tools" ) ToolCapabilities tools ) { // @formatter:on
380380
381381 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
382382 public record CompletionCapabilities () {
@@ -465,21 +465,23 @@ public ServerCapabilities build() {
465465 */
466466 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
467467 @ JsonIgnoreProperties (ignoreUnknown = true )
468- public record Implementation (// @formatter:off
468+ public record Implementation ( // @formatter:off
469469 @ JsonProperty ("name" ) String name ,
470470 @ JsonProperty ("title" ) String title ,
471- @ JsonProperty ("version" ) String version ) implements BaseMetadata {// @formatter:on
471+ @ JsonProperty ("version" ) String version ) implements BaseMetadata { // @formatter:on
472472
473473 public Implementation (String name , String version ) {
474474 this (name , null , version );
475475 }
476476 }
477477
478478 // Existing Enums and Base Types (from previous implementation)
479- public enum Role {// @formatter:off
479+ public enum Role {
480+
481+ // @formatter:off
480482 @ JsonProperty ("user" ) USER ,
481483 @ JsonProperty ("assistant" ) ASSISTANT
482- }// @formatter:on
484+ } // @formatter:on
483485
484486 // ---------------------------
485487 // Resource Interfaces
@@ -581,7 +583,7 @@ public record Resource( // @formatter:off
581583 @ JsonProperty ("description" ) String description ,
582584 @ JsonProperty ("mimeType" ) String mimeType ,
583585 @ JsonProperty ("size" ) Long size ,
584- @ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , ResourceContent {// @formatter:on
586+ @ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , ResourceContent { // @formatter:on
585587
586588 /**
587589 * @deprecated Only exists for backwards-compatibility purposes. Use
@@ -692,7 +694,7 @@ public record ResourceTemplate( // @formatter:off
692694 @ JsonProperty ("title" ) String title ,
693695 @ JsonProperty ("description" ) String description ,
694696 @ JsonProperty ("mimeType" ) String mimeType ,
695- @ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , BaseMetadata {// @formatter:on
697+ @ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , BaseMetadata { // @formatter:on
696698
697699 public ResourceTemplate (String uriTemplate , String name , String description , String mimeType ,
698700 Annotations annotations ) {
@@ -704,7 +706,7 @@ public ResourceTemplate(String uriTemplate, String name, String description, Str
704706 @ JsonIgnoreProperties (ignoreUnknown = true )
705707 public record ListResourcesResult ( // @formatter:off
706708 @ JsonProperty ("resources" ) List <Resource > resources ,
707- @ JsonProperty ("nextCursor" ) String nextCursor ) {// @formatter:on
709+ @ JsonProperty ("nextCursor" ) String nextCursor ) { // @formatter:on
708710 }
709711
710712 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
@@ -718,7 +720,7 @@ public record ListResourceTemplatesResult( // @formatter:off
718720 @ JsonIgnoreProperties (ignoreUnknown = true )
719721 public record ReadResourceRequest ( // @formatter:off
720722 @ JsonProperty ("uri" ) String uri ,
721- @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request {// @formatter:on
723+ @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request { // @formatter:on
722724
723725 public ReadResourceRequest (String uri ) {
724726 this (uri , null );
@@ -840,7 +842,7 @@ public record PromptArgument( // @formatter:off
840842 @ JsonProperty ("name" ) String name ,
841843 @ JsonProperty ("title" ) String title ,
842844 @ JsonProperty ("description" ) String description ,
843- @ JsonProperty ("required" ) Boolean required ) implements BaseMetadata {// @formatter:on
845+ @ JsonProperty ("required" ) Boolean required ) implements BaseMetadata { // @formatter:on
844846
845847 public PromptArgument (String name , String description , Boolean required ) {
846848 this (name , null , description , required );
@@ -874,7 +876,7 @@ public record PromptMessage( // @formatter:off
874876 @ JsonIgnoreProperties (ignoreUnknown = true )
875877 public record ListPromptsResult ( // @formatter:off
876878 @ JsonProperty ("prompts" ) List <Prompt > prompts ,
877- @ JsonProperty ("nextCursor" ) String nextCursor ) {// @formatter:on
879+ @ JsonProperty ("nextCursor" ) String nextCursor ) { // @formatter:on
878880 }
879881
880882 /**
@@ -885,7 +887,7 @@ public record ListPromptsResult( // @formatter:off
885887 */
886888 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
887889 @ JsonIgnoreProperties (ignoreUnknown = true )
888- public record GetPromptRequest (// @formatter:off
890+ public record GetPromptRequest ( // @formatter:off
889891 @ JsonProperty ("name" ) String name ,
890892 @ JsonProperty ("arguments" ) Map <String , Object > arguments ,
891893 @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request { // @formatter:on
@@ -922,7 +924,7 @@ public record GetPromptResult( // @formatter:off
922924 @ JsonIgnoreProperties (ignoreUnknown = true )
923925 public record ListToolsResult ( // @formatter:off
924926 @ JsonProperty ("tools" ) List <Tool > tools ,
925- @ JsonProperty ("nextCursor" ) String nextCursor ) {// @formatter:on
927+ @ JsonProperty ("nextCursor" ) String nextCursor ) { // @formatter:on
926928 }
927929
928930 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
@@ -981,7 +983,7 @@ public record Tool( // @formatter:off
981983 @ JsonProperty ("description" ) String description ,
982984 @ JsonProperty ("inputSchema" ) JsonSchema inputSchema ,
983985 @ JsonProperty ("outputSchema" ) Map <String , Object > outputSchema ,
984- @ JsonProperty ("annotations" ) ToolAnnotations annotations ) {// @formatter:on
986+ @ JsonProperty ("annotations" ) ToolAnnotations annotations ) { // @formatter:on
985987
986988 /**
987989 * @deprecated Only exists for backwards-compatibility purposes. Use
@@ -1114,10 +1116,10 @@ private static JsonSchema parseSchema(String schema) {
11141116 */
11151117 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
11161118 @ JsonIgnoreProperties (ignoreUnknown = true )
1117- public record CallToolRequest (// @formatter:off
1119+ public record CallToolRequest ( // @formatter:off
11181120 @ JsonProperty ("name" ) String name ,
11191121 @ JsonProperty ("arguments" ) Map <String , Object > arguments ,
1120- @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request {// @formatter:on
1122+ @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request { // @formatter:on
11211123
11221124 public CallToolRequest (String name , String jsonArguments ) {
11231125 this (name , parseJsonArguments (jsonArguments ), null );
@@ -1199,7 +1201,7 @@ public CallToolRequest build() {
11991201 public record CallToolResult ( // @formatter:off
12001202 @ JsonProperty ("content" ) List <Content > content ,
12011203 @ JsonProperty ("isError" ) Boolean isError ,
1202- @ JsonProperty ("structuredContent" ) Map <String , Object > structuredContent ) {// @formatter:on
1204+ @ JsonProperty ("structuredContent" ) Map <String , Object > structuredContent ) { // @formatter:on
12031205
12041206 // backwards compatibility constructor
12051207 public CallToolResult (List <Content > content , Boolean isError ) {
@@ -1329,7 +1331,7 @@ public CallToolResult build() {
13291331 // ---------------------------
13301332 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
13311333 @ JsonIgnoreProperties (ignoreUnknown = true )
1332- public record ModelPreferences (// @formatter:off
1334+ public record ModelPreferences ( // @formatter:off
13331335 @ JsonProperty ("hints" ) List <ModelHint > hints ,
13341336 @ JsonProperty ("costPriority" ) Double costPriority ,
13351337 @ JsonProperty ("speedPriority" ) Double speedPriority ,
@@ -1394,15 +1396,15 @@ public static ModelHint of(String name) {
13941396
13951397 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
13961398 @ JsonIgnoreProperties (ignoreUnknown = true )
1397- public record SamplingMessage (// @formatter:off
1399+ public record SamplingMessage ( // @formatter:off
13981400 @ JsonProperty ("role" ) Role role ,
13991401 @ JsonProperty ("content" ) Content content ) { // @formatter:on
14001402 }
14011403
14021404 // Sampling and Message Creation
14031405 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
14041406 @ JsonIgnoreProperties (ignoreUnknown = true )
1405- public record CreateMessageRequest (// @formatter:off
1407+ public record CreateMessageRequest ( // @formatter:off
14061408 @ JsonProperty ("messages" ) List <SamplingMessage > messages ,
14071409 @ JsonProperty ("modelPreferences" ) ModelPreferences modelPreferences ,
14081410 @ JsonProperty ("systemPrompt" ) String systemPrompt ,
@@ -1411,7 +1413,7 @@ public record CreateMessageRequest(// @formatter:off
14111413 @ JsonProperty ("maxTokens" ) int maxTokens ,
14121414 @ JsonProperty ("stopSequences" ) List <String > stopSequences ,
14131415 @ JsonProperty ("metadata" ) Map <String , Object > metadata ,
1414- @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request {// @formatter:on
1416+ @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request { // @formatter:on
14151417
14161418 // backwards compatibility constructor
14171419 public CreateMessageRequest (List <SamplingMessage > messages , ModelPreferences modelPreferences ,
@@ -1517,20 +1519,20 @@ public CreateMessageRequest build() {
15171519
15181520 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
15191521 @ JsonIgnoreProperties (ignoreUnknown = true )
1520- public record CreateMessageResult (// @formatter:off
1522+ public record CreateMessageResult ( // @formatter:off
15211523 @ JsonProperty ("role" ) Role role ,
15221524 @ JsonProperty ("content" ) Content content ,
15231525 @ JsonProperty ("model" ) String model ,
15241526 @ JsonProperty ("stopReason" ) StopReason stopReason ) { // @formatter:on
15251527
15261528 public enum StopReason {
15271529
1528- // @formatter:off
1529- @ JsonProperty ("endTurn" ) END_TURN ("endTurn" ),
1530- @ JsonProperty ("stopSequence" ) STOP_SEQUENCE ("stopSequence" ),
1531- @ JsonProperty ("maxTokens" ) MAX_TOKENS ("maxTokens" ),
1532- @ JsonProperty ("unknown" ) UNKNOWN ("unknown" );
1533- // @formatter:on
1530+ // @formatter:off
1531+ @ JsonProperty ("endTurn" ) END_TURN ("endTurn" ),
1532+ @ JsonProperty ("stopSequence" ) STOP_SEQUENCE ("stopSequence" ),
1533+ @ JsonProperty ("maxTokens" ) MAX_TOKENS ("maxTokens" ),
1534+ @ JsonProperty ("unknown" ) UNKNOWN ("unknown" );
1535+ // @formatter:on
15341536
15351537 private final String value ;
15361538
@@ -1603,10 +1605,10 @@ public CreateMessageResult build() {
16031605 */
16041606 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
16051607 @ JsonIgnoreProperties (ignoreUnknown = true )
1606- public record ElicitRequest (// @formatter:off
1608+ public record ElicitRequest ( // @formatter:off
16071609 @ JsonProperty ("message" ) String message ,
16081610 @ JsonProperty ("requestedSchema" ) Map <String , Object > requestedSchema ,
1609- @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request {// @formatter:on
1611+ @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request { // @formatter:on
16101612
16111613 // backwards compatibility constructor
16121614 public ElicitRequest (String message , Map <String , Object > requestedSchema ) {
@@ -1657,11 +1659,13 @@ public ElicitRequest build() {
16571659
16581660 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
16591661 @ JsonIgnoreProperties (ignoreUnknown = true )
1660- public record ElicitResult (// @formatter:off
1662+ public record ElicitResult ( // @formatter:off
16611663 @ JsonProperty ("action" ) Action action ,
1662- @ JsonProperty ("content" ) Map <String , Object > content ) {// @formatter:on
1664+ @ JsonProperty ("content" ) Map <String , Object > content ) { // @formatter:on
16631665
1664- public enum Action {// @formatter:off
1666+ public enum Action {
1667+
1668+ // @formatter:off
16651669 @ JsonProperty ("accept" ) ACCEPT ,
16661670 @ JsonProperty ("decline" ) DECLINE ,
16671671 @ JsonProperty ("cancel" ) CANCEL
@@ -1699,7 +1703,7 @@ public ElicitResult build() {
16991703 // ---------------------------
17001704 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
17011705 @ JsonIgnoreProperties (ignoreUnknown = true )
1702- public record PaginatedRequest (// @formatter:off
1706+ public record PaginatedRequest ( // @formatter:off
17031707 @ JsonProperty ("cursor" ) String cursor ,
17041708 @ JsonProperty ("_meta" ) Map <String , Object > meta ) implements Request { // @formatter:on
17051709
@@ -1736,11 +1740,11 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) {
17361740 */
17371741 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
17381742 @ JsonIgnoreProperties (ignoreUnknown = true )
1739- public record ProgressNotification (// @formatter:off
1743+ public record ProgressNotification ( // @formatter:off
17401744 @ JsonProperty ("progressToken" ) String progressToken ,
17411745 @ JsonProperty ("progress" ) Double progress ,
17421746 @ JsonProperty ("total" ) Double total ,
1743- @ JsonProperty ("message" ) String message ) {// @formatter:on
1747+ @ JsonProperty ("message" ) String message ) { // @formatter:on
17441748 }
17451749
17461750 /**
@@ -1764,10 +1768,10 @@ public record ResourcesUpdatedNotification(@JsonProperty("uri") String uri) {
17641768 * @param data JSON-serializable logging data.
17651769 */
17661770 @ JsonIgnoreProperties (ignoreUnknown = true )
1767- public record LoggingMessageNotification (// @formatter:off
1771+ public record LoggingMessageNotification ( // @formatter:off
17681772 @ JsonProperty ("level" ) LoggingLevel level ,
17691773 @ JsonProperty ("logger" ) String logger ,
1770- @ JsonProperty ("data" ) String data ) {// @formatter:on
1774+ @ JsonProperty ("data" ) String data ) { // @formatter:on
17711775
17721776 public static Builder builder () {
17731777 return new Builder ();
@@ -1803,7 +1807,9 @@ public LoggingMessageNotification build() {
18031807 }
18041808 }
18051809
1806- public enum LoggingLevel {// @formatter:off
1810+ public enum LoggingLevel {
1811+
1812+ // @formatter:off
18071813 @ JsonProperty ("debug" ) DEBUG (0 ),
18081814 @ JsonProperty ("info" ) INFO (1 ),
18091815 @ JsonProperty ("notice" ) NOTICE (2 ),
@@ -1844,7 +1850,7 @@ public sealed interface CompleteReference permits PromptReference, ResourceRefer
18441850
18451851 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
18461852 @ JsonIgnoreProperties (ignoreUnknown = true )
1847- public record PromptReference (// @formatter:off
1853+ public record PromptReference ( // @formatter:off
18481854 @ JsonProperty ("type" ) String type ,
18491855 @ JsonProperty ("name" ) String name ,
18501856 @ JsonProperty ("title" ) String title ) implements McpSchema .CompleteReference , BaseMetadata { // @formatter:on
@@ -1865,9 +1871,9 @@ public String identifier() {
18651871
18661872 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
18671873 @ JsonIgnoreProperties (ignoreUnknown = true )
1868- public record ResourceReference (// @formatter:off
1874+ public record ResourceReference ( // @formatter:off
18691875 @ JsonProperty ("type" ) String type ,
1870- @ JsonProperty ("uri" ) String uri ) implements McpSchema .CompleteReference {// @formatter:on
1876+ @ JsonProperty ("uri" ) String uri ) implements McpSchema .CompleteReference { // @formatter:on
18711877
18721878 public ResourceReference (String uri ) {
18731879 this ("ref/resource" , uri );
@@ -1881,11 +1887,11 @@ public String identifier() {
18811887
18821888 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
18831889 @ JsonIgnoreProperties (ignoreUnknown = true )
1884- public record CompleteRequest (// @formatter:off
1890+ public record CompleteRequest ( // @formatter:off
18851891 @ JsonProperty ("ref" ) McpSchema .CompleteReference ref ,
18861892 @ JsonProperty ("argument" ) CompleteArgument argument ,
18871893 @ JsonProperty ("_meta" ) Map <String , Object > meta ,
1888- @ JsonProperty ("context" ) CompleteContext context ) implements Request {// @formatter:on
1894+ @ JsonProperty ("context" ) CompleteContext context ) implements Request { // @formatter:on
18891895
18901896 public CompleteRequest (McpSchema .CompleteReference ref , CompleteArgument argument , Map <String , Object > meta ) {
18911897 this (ref , argument , meta , null );
@@ -1913,7 +1919,7 @@ public record CompleteResult(@JsonProperty("completion") CompleteCompletion comp
19131919 public record CompleteCompletion ( // @formatter:off
19141920 @ JsonProperty ("values" ) List <String > values ,
19151921 @ JsonProperty ("total" ) Integer total ,
1916- @ JsonProperty ("hasMore" ) Boolean hasMore ) {// @formatter:on
1922+ @ JsonProperty ("hasMore" ) Boolean hasMore ) { // @formatter:on
19171923 }
19181924 }
19191925
0 commit comments