@@ -793,6 +793,11 @@ impl InitializeRequestParams {
793793 client_info,
794794 }
795795 }
796+
797+ pub fn with_protocol_version ( mut self , protocol_version : ProtocolVersion ) -> Self {
798+ self . protocol_version = protocol_version;
799+ self
800+ }
796801}
797802
798803impl RequestParamsMeta for InitializeRequestParams {
@@ -978,6 +983,30 @@ impl Implementation {
978983 website_url : None ,
979984 }
980985 }
986+
987+ /// Set the human-readable title.
988+ pub fn with_title ( mut self , title : impl Into < String > ) -> Self {
989+ self . title = Some ( title. into ( ) ) ;
990+ self
991+ }
992+
993+ /// Set the description.
994+ pub fn with_description ( mut self , description : impl Into < String > ) -> Self {
995+ self . description = Some ( description. into ( ) ) ;
996+ self
997+ }
998+
999+ /// Set the icons.
1000+ pub fn with_icons ( mut self , icons : Vec < Icon > ) -> Self {
1001+ self . icons = Some ( icons) ;
1002+ self
1003+ }
1004+
1005+ /// Set the website URL.
1006+ pub fn with_website_url ( mut self , website_url : impl Into < String > ) -> Self {
1007+ self . website_url = Some ( website_url. into ( ) ) ;
1008+ self
1009+ }
9811010}
9821011
9831012#[ derive( Debug , Serialize , Deserialize , Clone , PartialEq , Default ) ]
@@ -992,6 +1021,13 @@ pub struct PaginatedRequestParams {
9921021 pub cursor : Option < String > ,
9931022}
9941023
1024+ impl PaginatedRequestParams {
1025+ pub fn with_cursor ( mut self , cursor : Option < String > ) -> Self {
1026+ self . cursor = cursor;
1027+ self
1028+ }
1029+ }
1030+
9951031impl RequestParamsMeta for PaginatedRequestParams {
9961032 fn meta ( & self ) -> Option < & Meta > {
9971033 self . meta . as_ref ( )
@@ -1037,6 +1073,18 @@ impl ProgressNotificationParam {
10371073 message : None ,
10381074 }
10391075 }
1076+
1077+ /// Set the total number of items to process.
1078+ pub fn with_total ( mut self , total : f64 ) -> Self {
1079+ self . total = Some ( total) ;
1080+ self
1081+ }
1082+
1083+ /// Set a message describing the current progress.
1084+ pub fn with_message ( mut self , message : impl Into < String > ) -> Self {
1085+ self . message = Some ( message. into ( ) ) ;
1086+ self
1087+ }
10401088}
10411089
10421090pub type ProgressNotification = Notification < ProgressNotificationMethod , ProgressNotificationParam > ;
@@ -1116,6 +1164,12 @@ impl ReadResourceRequestParams {
11161164 uri : uri. into ( ) ,
11171165 }
11181166 }
1167+
1168+ /// Set the metadata for this request.
1169+ pub fn with_meta ( mut self , meta : Meta ) -> Self {
1170+ self . meta = Some ( meta) ;
1171+ self
1172+ }
11191173}
11201174
11211175impl RequestParamsMeta for ReadResourceRequestParams {
@@ -1289,6 +1343,12 @@ impl GetPromptRequestParams {
12891343 self . arguments = Some ( arguments) ;
12901344 self
12911345 }
1346+
1347+ /// Set the metadata for this request.
1348+ pub fn with_meta ( mut self , meta : Meta ) -> Self {
1349+ self . meta = Some ( meta) ;
1350+ self
1351+ }
12921352}
12931353
12941354impl RequestParamsMeta for GetPromptRequestParams {
@@ -2835,6 +2895,12 @@ impl CreateMessageResult {
28352895 self
28362896 }
28372897
2898+ /// Set the model identifier.
2899+ pub fn with_model ( mut self , model : impl Into < String > ) -> Self {
2900+ self . model = model. into ( ) ;
2901+ self
2902+ }
2903+
28382904 /// Validate the result per SEP-1577: role must be "assistant".
28392905 pub fn validate ( & self ) -> Result < ( ) , String > {
28402906 if self . message . role != Role :: Assistant {
0 commit comments