@@ -328,23 +328,59 @@ public static async Task<string> ElicitationSep1330Enums(
328328 {
329329 try
330330 {
331+ #pragma warning disable MCP9001 // LegacyTitledEnumSchema is deprecated but required for conformance testing
331332 var schema = new ElicitRequestParams . RequestSchema
332333 {
333334 Properties =
334335 {
335- [ "color" ] = new ElicitRequestParams . UntitledSingleSelectEnumSchema ( )
336+ // 1. Untitled single-select: { type: "string", enum: ["option1", "option2", "option3"] }
337+ [ "untitledSingle" ] = new ElicitRequestParams . UntitledSingleSelectEnumSchema ( )
336338 {
337- Description = "Choose a color " ,
338- Enum = [ "red " , "green " , "blue " ]
339+ Description = "Untitled single-select enum " ,
340+ Enum = [ "option1 " , "option2 " , "option3 " ]
339341 } ,
340- [ "size" ] = new ElicitRequestParams . UntitledSingleSelectEnumSchema ( )
342+ // 2. Titled single-select: { type: "string", oneOf: [{ const: "value1", title: "First Option" }, ...] }
343+ [ "titledSingle" ] = new ElicitRequestParams . TitledSingleSelectEnumSchema ( )
341344 {
342- Description = "Choose a size" ,
343- Enum = [ "small" , "medium" , "large" ] ,
344- Default = "medium"
345+ Description = "Titled single-select enum" ,
346+ OneOf = [
347+ new ElicitRequestParams . EnumSchemaOption { Const = "value1" , Title = "First Option" } ,
348+ new ElicitRequestParams . EnumSchemaOption { Const = "value2" , Title = "Second Option" } ,
349+ new ElicitRequestParams . EnumSchemaOption { Const = "value3" , Title = "Third Option" }
350+ ]
351+ } ,
352+ // 3. Legacy titled (deprecated): { type: "string", enum: ["opt1", "opt2", "opt3"], enumNames: ["Option One", "Option Two", "Option Three"] }
353+ [ "legacyEnum" ] = new ElicitRequestParams . LegacyTitledEnumSchema ( )
354+ {
355+ Description = "Legacy titled enum (deprecated)" ,
356+ Enum = [ "opt1" , "opt2" , "opt3" ] ,
357+ EnumNames = [ "Option One" , "Option Two" , "Option Three" ]
358+ } ,
359+ // 4. Untitled multi-select: { type: "array", items: { type: "string", enum: ["option1", "option2", "option3"] } }
360+ [ "untitledMulti" ] = new ElicitRequestParams . UntitledMultiSelectEnumSchema ( )
361+ {
362+ Description = "Untitled multi-select enum" ,
363+ Items = new ElicitRequestParams . UntitledEnumItemsSchema
364+ {
365+ Enum = [ "option1" , "option2" , "option3" ]
366+ }
367+ } ,
368+ // 5. Titled multi-select: { type: "array", items: { anyOf: [{ const: "value1", title: "First Choice" }, ...] } }
369+ [ "titledMulti" ] = new ElicitRequestParams . TitledMultiSelectEnumSchema ( )
370+ {
371+ Description = "Titled multi-select enum" ,
372+ Items = new ElicitRequestParams . TitledEnumItemsSchema
373+ {
374+ AnyOf = [
375+ new ElicitRequestParams . EnumSchemaOption { Const = "value1" , Title = "First Choice" } ,
376+ new ElicitRequestParams . EnumSchemaOption { Const = "value2" , Title = "Second Choice" } ,
377+ new ElicitRequestParams . EnumSchemaOption { Const = "value3" , Title = "Third Choice" }
378+ ]
379+ }
345380 }
346381 }
347382 } ;
383+ #pragma warning restore MCP9001
348384
349385 var result = await server . ElicitAsync ( new ElicitRequestParams
350386 {
@@ -354,8 +390,7 @@ public static async Task<string> ElicitationSep1330Enums(
354390
355391 if ( result . Action == "accept" && result . Content != null )
356392 {
357- return $ "Accepted with values: color={ result . Content [ "color" ] . GetString ( ) } , " +
358- $ "size={ result . Content [ "size" ] . GetString ( ) } ";
393+ return $ "Elicitation completed: action={ result . Action } , content={ result . Content } ";
359394 }
360395 else
361396 {
0 commit comments