@@ -578,6 +578,16 @@ public record Resource( // @formatter:off
578
578
@ JsonProperty ("size" ) Long size ,
579
579
@ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , ResourceContent {// @formatter:on
580
580
581
+ /**
582
+ * @deprecated Only exists for backwards-compatibility purposes. Use
583
+ * {@link Resource#builder()} instead.
584
+ */
585
+ @ Deprecated
586
+ public Resource (String uri , String name , String description , String mimeType , Long size ,
587
+ Annotations annotations ) {
588
+ this (uri , name , null , description , mimeType , null , annotations );
589
+ }
590
+
581
591
/**
582
592
* @deprecated Only exists for backwards-compatibility purposes. Use
583
593
* {@link Resource#builder()} instead.
@@ -677,8 +687,13 @@ public record ResourceTemplate( // @formatter:off
677
687
@ JsonProperty ("title" ) String title ,
678
688
@ JsonProperty ("description" ) String description ,
679
689
@ JsonProperty ("mimeType" ) String mimeType ,
680
- @ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , BaseMetadata {
681
- } // @formatter:on
690
+ @ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , BaseMetadata {// @formatter:on
691
+
692
+ public ResourceTemplate (String uriTemplate , String name , String description , String mimeType ,
693
+ Annotations annotations ) {
694
+ this (uriTemplate , name , null , description , mimeType , annotations );
695
+ }
696
+ }
682
697
683
698
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
684
699
@ JsonIgnoreProperties (ignoreUnknown = true )
@@ -802,8 +817,12 @@ public record Prompt( // @formatter:off
802
817
@ JsonProperty ("name" ) String name ,
803
818
@ JsonProperty ("title" ) String title ,
804
819
@ JsonProperty ("description" ) String description ,
805
- @ JsonProperty ("arguments" ) List <PromptArgument > arguments ) implements BaseMetadata {
806
- } // @formatter:on
820
+ @ JsonProperty ("arguments" ) List <PromptArgument > arguments ) implements BaseMetadata { // @formatter:on
821
+
822
+ public Prompt (String name , String description , List <PromptArgument > arguments ) {
823
+ this (name , null , description , arguments != null ? arguments : new ArrayList <>());
824
+ }
825
+ }
807
826
808
827
/**
809
828
* Describes an argument that a prompt can accept.
@@ -819,8 +838,12 @@ public record PromptArgument( // @formatter:off
819
838
@ JsonProperty ("name" ) String name ,
820
839
@ JsonProperty ("title" ) String title ,
821
840
@ JsonProperty ("description" ) String description ,
822
- @ JsonProperty ("required" ) Boolean required ) implements BaseMetadata {
823
- }// @formatter:on
841
+ @ JsonProperty ("required" ) Boolean required ) implements BaseMetadata {// @formatter:on
842
+
843
+ public PromptArgument (String name , String description , Boolean required ) {
844
+ this (name , null , description , required );
845
+ }
846
+ }
824
847
825
848
/**
826
849
* Describes a message returned as part of a prompt.
@@ -946,6 +969,15 @@ public record Tool( // @formatter:off
946
969
@ JsonProperty ("inputSchema" ) JsonSchema inputSchema ,
947
970
@ JsonProperty ("annotations" ) ToolAnnotations annotations ) implements BaseMetadata { // @formatter:on
948
971
972
+ /**
973
+ * @deprecated Only exists for backwards-compatibility purposes. Use
974
+ * {@link Tool#builder()} instead.
975
+ */
976
+ @ Deprecated
977
+ public Tool (String name , String description , JsonSchema inputSchema , ToolAnnotations annotations ) {
978
+ this (name , null , description , inputSchema , annotations );
979
+ }
980
+
949
981
public Tool (String name , String description , String schema ) {
950
982
this (name , null , description , parseSchema (schema ), null );
951
983
}
@@ -1688,17 +1720,21 @@ public sealed interface CompleteReference permits PromptReference, ResourceRefer
1688
1720
public record PromptReference (// @formatter:off
1689
1721
@ JsonProperty ("type" ) String type ,
1690
1722
@ JsonProperty ("name" ) String name ,
1691
- @ JsonProperty ("title" ) String title ) implements McpSchema .CompleteReference , BaseMetadata {
1723
+ @ JsonProperty ("title" ) String title ) implements McpSchema .CompleteReference , BaseMetadata { // @formatter:on
1692
1724
1693
- public PromptReference (String name ) {
1694
- this ("ref/prompt" , name , null );
1695
- }
1725
+ public PromptReference (String type , String name ) {
1726
+ this (type , name , null );
1727
+ }
1696
1728
1697
- @ Override
1698
- public String identifier () {
1699
- return name ();
1700
- }
1701
- }// @formatter:on
1729
+ public PromptReference (String name ) {
1730
+ this ("ref/prompt" , name , null );
1731
+ }
1732
+
1733
+ @ Override
1734
+ public String identifier () {
1735
+ return name ();
1736
+ }
1737
+ }
1702
1738
1703
1739
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
1704
1740
@ JsonIgnoreProperties (ignoreUnknown = true )
@@ -1911,6 +1947,17 @@ public record ResourceLink( // @formatter:off
1911
1947
@ JsonProperty ("size" ) Long size ,
1912
1948
@ JsonProperty ("annotations" ) Annotations annotations ) implements Annotated , Content , ResourceContent { // @formatter:on
1913
1949
1950
+ /**
1951
+ * @deprecated Only exists for backwards-compatibility purposes. Use
1952
+ * {@link ResourceLink#ResourceLink(String, String, String, String, String, Long, Annotations)}
1953
+ * instead.
1954
+ */
1955
+ @ Deprecated
1956
+ public ResourceLink (String name , String uri , String description , String mimeType , Long size ,
1957
+ Annotations annotations ) {
1958
+ this (name , null , uri , description , mimeType , size , annotations );
1959
+ }
1960
+
1914
1961
public static Builder builder () {
1915
1962
return new Builder ();
1916
1963
}
0 commit comments