Add conformance tests for SEP-1330 elicitation enums (#22)

* Add SEP-1330 conformance test for elicitation enum schemas

Adds server-side conformance test that validates servers properly request
elicitation with SEP-1330 enum schema improvements:
- Untitled single-select enum (type: string, enum: [...])
- Titled single-select enum (oneOf with const/title)
- Legacy titled enum (enumNames for backward compatibility)
- Untitled multi-select enum (type: array, items.enum)
- Titled multi-select enum (items.anyOf with const/title)

Test expects server to implement `test_elicitation_sep1330_enums` tool.

* Add reference server implementation for SEP-1330 conformance test

Adds test_elicitation_sep1330_enums tool to everything-server that
requests elicitation with all 5 enum schema variants. Also updates
SERVER_REQUIREMENTS.md with full specification.

* Fix prettier formatting

* only test active tests (#24)

* refactor maps to pull names from the test

* bring names back

* separate active from pending

* only test active

---------

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
This commit is contained in:
Felix Weinberger 2025-11-11 19:34:47 +00:00 • committed by GitHub
commit e19918d968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -463,6 +463,97 @@ If no progress token provided, just execute with delays.
**Reference**: [SEP-1034](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1034)
#### `test_elicitation_sep1330_enums`
**Arguments**: None
**Behavior**: Request user input from the client using `elicitation/create` with enum schema improvements (SEP-1330)
**Elicitation Request**:
```json
{
"method": "elicitation/create",
"params": {
"message": "Please select options from the enum fields",
"requestedSchema": {
"type": "object",
"properties": {
"untitledSingle": {
"type": "string",
"description": "Select one option",
"enum": ["option1", "option2", "option3"]
},
"titledSingle": {
"type": "string",
"description": "Select one option with titles",
"oneOf": [
{ "const": "value1", "title": "First Option" },
{ "const": "value2", "title": "Second Option" },
{ "const": "value3", "title": "Third Option" }
]
},
"legacyEnum": {
"type": "string",
"description": "Select one option (legacy)",
"enum": ["opt1", "opt2", "opt3"],
"enumNames": ["Option One", "Option Two", "Option Three"]
},
"untitledMulti": {
"type": "array",
"description": "Select multiple options",
"minItems": 1,
"maxItems": 3,
"items": {
"type": "string",
"enum": ["option1", "option2", "option3"]
}
},
"titledMulti": {
"type": "array",
"description": "Select multiple options with titles",
"minItems": 1,
"maxItems": 3,
"items": {
"anyOf": [
{ "const": "value1", "title": "First Choice" },
{ "const": "value2", "title": "Second Choice" },
{ "const": "value3", "title": "Third Choice" }
]
}
}
},
"required": []
}
}
}
```
**Returns**: Text content with the elicitation result
```json
{
"content": [
{
"type": "text",
"text": "Elicitation completed: action=<accept/decline/cancel>, content={...}"
}
]
}
```
**Implementation Note**: This tool tests SEP-1330 support for enum schema improvements including:
- Untitled single-select enums (type: string with enum array)
- Titled single-select enums (using oneOf with const/title objects)
- Legacy titled enums (using deprecated enumNames array)
- Untitled multi-select enums (type: array with items.enum)
- Titled multi-select enums (using items.anyOf with const/title objects)
If the client doesn't support elicitation (no `elicitation` capability), return an error.
**Reference**: [SEP-1330](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1330)
---
## 3. Resources Requirements