fix(conformance): correct SEP-1330 enum schemas in test_elicitation_sep1330_enums (#600)
## Correct SEP-1330 enum schemas in test_elicitation_sep1330_enums **NB! This PR contains changes from #599 and should be rebased and merged after #599 is merged.** Update conformance test according to [test requirements](https://github.com/modelcontextprotocol/conformance/blob/main/src/scenarios/server/elicitation-enums.ts#L14C1-L35C9). - Fix legacyEnum: was using `oneOf` with const/title pairs; now correctly uses `enum` + `enumNames` arrays per LegacyEnumSchema spec - Fix titledMulti: items were using `oneOf` with extra `type:"string"`; now correctly uses `anyOf` per TitledMultiSelectEnumSchema spec - Fix return text format to match expected "Elicitation completed: action=..., content=..." - Remove _elicitation-sep1330-enums_ from conformance baseline (test now passes) ## How Has This Been Tested? ```shell ./conformance-test/run-conformance.sh server ``` ## Breaking Changes No ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed --------- Co-authored-by: devcrocod <devcrocod@gmail.com>
This commit is contained in:
parent
736efe9dc0
commit
4ecd95218a
3 changed files with 14 additions and 28 deletions
|
|
@ -111,15 +111,8 @@ Tests the conformance server against all server scenarios:
|
|||
|
||||
## Known SDK Limitations
|
||||
|
||||
8 scenarios are expected to fail due to current SDK limitations (tracked in [
|
||||
`conformance-baseline.yml`](conformance-baseline.yml).
|
||||
|
||||
| Scenario | Suite | Root Cause |
|
||||
|---------------------------------------|--------|----------------------------------------------------------------------------------------------------------------|
|
||||
| `elicitation-sep1330-enums` | server | *(same as above)* |
|
||||
| `resources-templates-read` | server | SDK does not implement `addResourceTemplate()` with URI pattern matching; resources are looked up by exact URI |
|
||||
| `elicitation-sep1034-client-defaults` | client | SDK does not fill in `default` values from the elicitation request schema before sending the response |
|
||||
|
||||
Scenarios, expected to fail due to current SDK limitations, are tracked in
|
||||
[`conformance-baseline.yml`](conformance-baseline.yml).
|
||||
These failures reveal SDK gaps and are intentionally not fixed in this module.
|
||||
|
||||
[list-scenarios-command]: https://github.com/modelcontextprotocol/conformance/tree/main?tab=readme-ov-file#list-available-scenarios
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
# Conformance test baseline - expected failures
|
||||
# Add entries here as tests are identified as known SDK limitations
|
||||
server:
|
||||
- elicitation-sep1330-enums
|
||||
- resources-templates-read
|
||||
|
||||
client:
|
||||
|
|
|
|||
|
|
@ -318,27 +318,22 @@ fun Server.registerConformanceTools() {
|
|||
)
|
||||
},
|
||||
)
|
||||
// Legacy titled (deprecated)
|
||||
// Legacy titled (deprecated) - uses enum + enumNames arrays
|
||||
put(
|
||||
"legacyEnum",
|
||||
buildJsonObject {
|
||||
put("type", JsonPrimitive("string"))
|
||||
put(
|
||||
"oneOf",
|
||||
"enum",
|
||||
JsonArray(listOf(JsonPrimitive("opt1"), JsonPrimitive("opt2"), JsonPrimitive("opt3"))),
|
||||
)
|
||||
put(
|
||||
"enumNames",
|
||||
JsonArray(
|
||||
listOf(
|
||||
buildJsonObject {
|
||||
put("const", JsonPrimitive("opt1"))
|
||||
put("title", JsonPrimitive("Option One"))
|
||||
},
|
||||
buildJsonObject {
|
||||
put("const", JsonPrimitive("opt2"))
|
||||
put("title", JsonPrimitive("Option Two"))
|
||||
},
|
||||
buildJsonObject {
|
||||
put("const", JsonPrimitive("opt3"))
|
||||
put("title", JsonPrimitive("Option Three"))
|
||||
},
|
||||
JsonPrimitive("Option One"),
|
||||
JsonPrimitive("Option Two"),
|
||||
JsonPrimitive("Option Three"),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
@ -367,7 +362,7 @@ fun Server.registerConformanceTools() {
|
|||
)
|
||||
},
|
||||
)
|
||||
// Titled multi-select
|
||||
// Titled multi-select - uses items.anyOf with const/title pairs
|
||||
put(
|
||||
"titledMulti",
|
||||
buildJsonObject {
|
||||
|
|
@ -375,9 +370,8 @@ fun Server.registerConformanceTools() {
|
|||
put(
|
||||
"items",
|
||||
buildJsonObject {
|
||||
put("type", JsonPrimitive("string"))
|
||||
put(
|
||||
"oneOf",
|
||||
"anyOf",
|
||||
JsonArray(
|
||||
listOf(
|
||||
buildJsonObject {
|
||||
|
|
@ -405,7 +399,7 @@ fun Server.registerConformanceTools() {
|
|||
"Please review and update the form fields with defaults",
|
||||
schema,
|
||||
)
|
||||
CallToolResult(listOf(TextContent(result.content.toString())))
|
||||
CallToolResult(listOf(TextContent("Elicitation completed: action=${result.action}, content=${result.content}")))
|
||||
}
|
||||
|
||||
// 12. Dynamic tool
|
||||
|
|
|
|||
Loading…
Reference in a new issue