@@ -143,9 +143,10 @@ impl std::fmt::Display for ProtocolVersion {
143
143
}
144
144
145
145
impl ProtocolVersion {
146
+ pub const V_2025_06_18 : Self = Self ( Cow :: Borrowed ( "2025-06-18" ) ) ;
146
147
pub const V_2025_03_26 : Self = Self ( Cow :: Borrowed ( "2025-03-26" ) ) ;
147
148
pub const V_2024_11_05 : Self = Self ( Cow :: Borrowed ( "2024-11-05" ) ) ;
148
- pub const LATEST : Self = Self :: V_2025_03_26 ;
149
+ pub const LATEST : Self = Self :: V_2025_06_18 ;
149
150
}
150
151
151
152
impl Serialize for ProtocolVersion {
@@ -167,6 +168,7 @@ impl<'de> Deserialize<'de> for ProtocolVersion {
167
168
match s. as_str ( ) {
168
169
"2024-11-05" => return Ok ( ProtocolVersion :: V_2024_11_05 ) ,
169
170
"2025-03-26" => return Ok ( ProtocolVersion :: V_2025_03_26 ) ,
171
+ "2025-06-18" => return Ok ( ProtocolVersion :: V_2025_06_18 ) ,
170
172
_ => { }
171
173
}
172
174
Ok ( ProtocolVersion ( Cow :: Owned ( s) ) )
@@ -1173,6 +1175,75 @@ pub struct ListRootsResult {
1173
1175
const_string ! ( RootsListChangedNotificationMethod = "notifications/roots/list_changed" ) ;
1174
1176
pub type RootsListChangedNotification = NotificationNoParam < RootsListChangedNotificationMethod > ;
1175
1177
1178
+ // =============================================================================
1179
+ // ELICITATION (INTERACTIVE USER INPUT)
1180
+ // =============================================================================
1181
+
1182
+ // Method constants for elicitation operations.
1183
+ // Elicitation allows servers to request interactive input from users during tool execution.
1184
+ const_string ! ( ElicitationCreateRequestMethod = "elicitation/create" ) ;
1185
+ const_string ! ( ElicitationResponseNotificationMethod = "notifications/elicitation/response" ) ;
1186
+
1187
+ /// Represents the possible actions a user can take in response to an elicitation request.
1188
+ ///
1189
+ /// When a server requests user input through elicitation, the user can:
1190
+ /// - Accept: Provide the requested information and continue
1191
+ /// - Decline: Refuse to provide the information but continue the operation
1192
+ /// - Cancel: Stop the entire operation
1193
+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq , Eq ) ]
1194
+ #[ serde( rename_all = "lowercase" ) ]
1195
+ #[ cfg_attr( feature = "schemars" , derive( schemars:: JsonSchema ) ) ]
1196
+ pub enum ElicitationAction {
1197
+ /// User accepts the request and provides the requested information
1198
+ Accept ,
1199
+ /// User declines to provide the information but allows the operation to continue
1200
+ Decline ,
1201
+ /// User cancels the entire operation
1202
+ Cancel ,
1203
+ }
1204
+
1205
+ /// Parameters for creating an elicitation request to gather user input.
1206
+ ///
1207
+ /// This structure contains everything needed to request interactive input from a user:
1208
+ /// - A human-readable message explaining what information is needed
1209
+ /// - A JSON schema defining the expected structure of the response
1210
+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
1211
+ #[ serde( rename_all = "camelCase" ) ]
1212
+ #[ cfg_attr( feature = "schemars" , derive( schemars:: JsonSchema ) ) ]
1213
+ pub struct CreateElicitationRequestParam {
1214
+ /// Human-readable message explaining what input is needed from the user.
1215
+ /// This should be clear and provide sufficient context for the user to understand
1216
+ /// what information they need to provide.
1217
+ pub message : String ,
1218
+
1219
+ /// JSON Schema defining the expected structure and validation rules for the user's response.
1220
+ /// This allows clients to validate input and provide appropriate UI controls.
1221
+ /// Must be a valid JSON Schema Draft 2020-12 object.
1222
+ pub requested_schema : JsonObject ,
1223
+ }
1224
+
1225
+ /// The result returned by a client in response to an elicitation request.
1226
+ ///
1227
+ /// Contains the user's decision (accept/decline/cancel) and optionally their input data
1228
+ /// if they chose to accept the request.
1229
+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
1230
+ #[ serde( rename_all = "camelCase" ) ]
1231
+ #[ cfg_attr( feature = "schemars" , derive( schemars:: JsonSchema ) ) ]
1232
+ pub struct CreateElicitationResult {
1233
+ /// The user's decision on how to handle the elicitation request
1234
+ pub action : ElicitationAction ,
1235
+
1236
+ /// The actual data provided by the user, if they accepted the request.
1237
+ /// Must conform to the JSON schema specified in the original request.
1238
+ /// Only present when action is Accept.
1239
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1240
+ pub content : Option < Value > ,
1241
+ }
1242
+
1243
+ /// Request type for creating an elicitation to gather user input
1244
+ pub type CreateElicitationRequest =
1245
+ Request < ElicitationCreateRequestMethod , CreateElicitationRequestParam > ;
1246
+
1176
1247
// =============================================================================
1177
1248
// TOOL EXECUTION RESULTS
1178
1249
// =============================================================================
@@ -1303,7 +1374,8 @@ ts_union!(
1303
1374
| SubscribeRequest
1304
1375
| UnsubscribeRequest
1305
1376
| CallToolRequest
1306
- | ListToolsRequest ;
1377
+ | ListToolsRequest
1378
+ | CreateElicitationRequest ;
1307
1379
) ;
1308
1380
1309
1381
ts_union ! (
@@ -1315,7 +1387,7 @@ ts_union!(
1315
1387
) ;
1316
1388
1317
1389
ts_union ! (
1318
- export type ClientResult = CreateMessageResult | ListRootsResult | EmptyResult ;
1390
+ export type ClientResult = CreateMessageResult | ListRootsResult | CreateElicitationResult | EmptyResult ;
1319
1391
) ;
1320
1392
1321
1393
impl ClientResult {
@@ -1330,7 +1402,8 @@ ts_union!(
1330
1402
export type ServerRequest =
1331
1403
| PingRequest
1332
1404
| CreateMessageRequest
1333
- | ListRootsRequest ;
1405
+ | ListRootsRequest
1406
+ | CreateElicitationRequest ;
1334
1407
) ;
1335
1408
1336
1409
ts_union ! (
@@ -1355,6 +1428,7 @@ ts_union!(
1355
1428
| ReadResourceResult
1356
1429
| CallToolResult
1357
1430
| ListToolsResult
1431
+ | CreateElicitationResult
1358
1432
| EmptyResult
1359
1433
;
1360
1434
) ;
0 commit comments