@@ -381,14 +381,16 @@ public InitializeResult(String protocolVersion, ServerCapabilities capabilities,
381381 * @param roots Present if the client supports listing roots
382382 * @param sampling Present if the client supports sampling from an LLM
383383 * @param elicitation Present if the client supports elicitation from the server
384+ * @param tasks Present if the client supports tasks operations
384385 */
385386 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
386387 @ JsonIgnoreProperties (ignoreUnknown = true )
387388 public record ClientCapabilities ( // @formatter:off
388389 @ JsonProperty ("experimental" ) Map <String , Object > experimental ,
389390 @ JsonProperty ("roots" ) RootCapabilities roots ,
390391 @ JsonProperty ("sampling" ) Sampling sampling ,
391- @ JsonProperty ("elicitation" ) Elicitation elicitation ) { // @formatter:on
392+ @ JsonProperty ("elicitation" ) Elicitation elicitation ,
393+ @ JsonProperty ("tasks" ) ClientCapabilities .TaskCapabilities tasks ) { // @formatter:on
392394
393395 /**
394396 * Present if the client supports listing roots.
@@ -424,6 +426,57 @@ public record Sampling() {
424426 public record Elicitation () {
425427 }
426428
429+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
430+ public record TaskCapabilities ( // @formatter:off
431+ @ JsonProperty ("list" ) TaskCapabilities .List list ,
432+ @ JsonProperty ("cancel" ) TaskCapabilities .Cancel cancel ,
433+ @ JsonProperty ("requests" ) TaskCapabilities .Requests requests ) {// @formatter:on
434+
435+ /**
436+ * Client supports the tasks/list operation
437+ */
438+ public record List () {
439+ }
440+
441+ /**
442+ * Client supports the tasks/cancel operation
443+ */
444+ public record Cancel () {
445+ }
446+
447+ /**
448+ * Client supports task-augmented requests
449+ */
450+ public record Requests ( // @formatter:off
451+ @ JsonProperty ("sampling" ) Requests .Sampling sampling ,
452+ @ JsonProperty ("elicitation" ) Requests .Elicitation elicitation ) { // @formatter:on
453+
454+ /**
455+ * Client supports task-augmented sampling requests
456+ */
457+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
458+ public record Sampling (@ JsonProperty ("createMessage" ) Sampling .CreateMessage createMessage ) {
459+ /**
460+ * Client supports task-augmented sampling/createMessage requests
461+ */
462+ public record CreateMessage () {
463+ }
464+ }
465+
466+ /**
467+ * Client supports task-augmented elicitation requests
468+ */
469+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
470+ public record Elicitation (@ JsonProperty ("elicitation" ) Elicitation .Create create ) {
471+ /**
472+ * Client supports task-augmented elicitation/create requests
473+ */
474+ public record Create () {
475+ }
476+ }
477+ }
478+ }
479+
427480 public static Builder builder () {
428481 return new Builder ();
429482 }
@@ -438,6 +491,8 @@ public static class Builder {
438491
439492 private Elicitation elicitation ;
440493
494+ private ClientCapabilities .TaskCapabilities tasks ;
495+
441496 public Builder experimental (Map <String , Object > experimental ) {
442497 this .experimental = experimental ;
443498 return this ;
@@ -458,8 +513,13 @@ public Builder elicitation() {
458513 return this ;
459514 }
460515
516+ public Builder tasks (ClientCapabilities .TaskCapabilities tasks ) {
517+ this .tasks = tasks ;
518+ return this ;
519+ }
520+
461521 public ClientCapabilities build () {
462- return new ClientCapabilities (experimental , roots , sampling , elicitation );
522+ return new ClientCapabilities (experimental , roots , sampling , elicitation , tasks );
463523 }
464524
465525 }
@@ -478,6 +538,7 @@ public ClientCapabilities build() {
478538 * @param prompts Present if the server offers any prompt templates
479539 * @param resources Present if the server offers any resources to read
480540 * @param tools Present if the server offers any tools to call
541+ * @param tasks Present if the server supports tasks operations
481542 */
482543 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
483544 @ JsonIgnoreProperties (ignoreUnknown = true )
@@ -487,7 +548,8 @@ public record ServerCapabilities( // @formatter:off
487548 @ JsonProperty ("logging" ) LoggingCapabilities logging ,
488549 @ JsonProperty ("prompts" ) PromptCapabilities prompts ,
489550 @ JsonProperty ("resources" ) ResourceCapabilities resources ,
490- @ JsonProperty ("tools" ) ToolCapabilities tools ) { // @formatter:on
551+ @ JsonProperty ("tools" ) ToolCapabilities tools ,
552+ @ JsonProperty ("tasks" ) ServerCapabilities .TaskCapabilities tasks ) { // @formatter:on
491553
492554 /**
493555 * Present if the server supports argument autocompletion suggestions.
@@ -535,6 +597,47 @@ public record ResourceCapabilities(@JsonProperty("subscribe") Boolean subscribe,
535597 public record ToolCapabilities (@ JsonProperty ("listChanged" ) Boolean listChanged ) {
536598 }
537599
600+ /**
601+ * Present if the server supports task management operations.
602+ *
603+ * @param list Server supports the tasks/list operation
604+ * @param cancel Server supports the tasks/cancel operation
605+ * @param requests supports task-augmented tools/call requests
606+ */
607+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
608+ public record TaskCapabilities ( // @formatter:off
609+ @ JsonProperty ("list" ) TaskCapabilities .List list ,
610+ @ JsonProperty ("cancel" ) TaskCapabilities .Cancel cancel ,
611+ @ JsonProperty ("requests" ) TaskCapabilities .Requests requests ) { // @formatter:on
612+
613+ /**
614+ * Server supports the tasks/list operation
615+ **/
616+ public record List () {
617+ }
618+
619+ /**
620+ * Server supports the tasks/cancel operation
621+ */
622+ public record Cancel () {
623+ }
624+
625+ /**
626+ * Server supports task-augmented requests
627+ */
628+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
629+ public record Requests (@ JsonProperty ("tools" ) TaskCapabilities .Requests .Tools tools ) {
630+ /**
631+ * Present if the server supports task-augmented tools/call requests
632+ */
633+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
634+ public record Tools (@ JsonProperty ("call" ) Tools .Call call ) {
635+ public record Call () {
636+ }
637+ }
638+ }
639+ }
640+
538641 /**
539642 * Create a mutated copy of this object with the specified changes.
540643 * @return A new Builder instance with the same values as this object.
@@ -568,6 +671,8 @@ public static class Builder {
568671
569672 private ToolCapabilities tools ;
570673
674+ private TaskCapabilities tasks ;
675+
571676 public Builder completions () {
572677 this .completions = new CompletionCapabilities ();
573678 return this ;
@@ -598,8 +703,13 @@ public Builder tools(Boolean listChanged) {
598703 return this ;
599704 }
600705
706+ public Builder tasks (ServerCapabilities .TaskCapabilities tasks ) {
707+ this .tasks = tasks ;
708+ return this ;
709+ }
710+
601711 public ServerCapabilities build () {
602- return new ServerCapabilities (completions , experimental , logging , prompts , resources , tools );
712+ return new ServerCapabilities (completions , experimental , logging , prompts , resources , tools , tasks );
603713 }
604714
605715 }
0 commit comments