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
|
## Known SDK Limitations
|
||||||
|
|
||||||
8 scenarios are expected to fail due to current SDK limitations (tracked in [
|
Scenarios, expected to fail due to current SDK limitations, are tracked in
|
||||||
`conformance-baseline.yml`](conformance-baseline.yml).
|
[`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 |
|
|
||||||
|
|
||||||
These failures reveal SDK gaps and are intentionally not fixed in this module.
|
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
|
[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
|
# Conformance test baseline - expected failures
|
||||||
# Add entries here as tests are identified as known SDK limitations
|
# Add entries here as tests are identified as known SDK limitations
|
||||||
server:
|
server:
|
||||||
- elicitation-sep1330-enums
|
|
||||||
- resources-templates-read
|
- resources-templates-read
|
||||||
|
|
||||||
client:
|
client:
|
||||||
|
|
|
||||||
|
|
@ -318,27 +318,22 @@ fun Server.registerConformanceTools() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
// Legacy titled (deprecated)
|
// Legacy titled (deprecated) - uses enum + enumNames arrays
|
||||||
put(
|
put(
|
||||||
"legacyEnum",
|
"legacyEnum",
|
||||||
buildJsonObject {
|
buildJsonObject {
|
||||||
put("type", JsonPrimitive("string"))
|
put("type", JsonPrimitive("string"))
|
||||||
put(
|
put(
|
||||||
"oneOf",
|
"enum",
|
||||||
|
JsonArray(listOf(JsonPrimitive("opt1"), JsonPrimitive("opt2"), JsonPrimitive("opt3"))),
|
||||||
|
)
|
||||||
|
put(
|
||||||
|
"enumNames",
|
||||||
JsonArray(
|
JsonArray(
|
||||||
listOf(
|
listOf(
|
||||||
buildJsonObject {
|
JsonPrimitive("Option One"),
|
||||||
put("const", JsonPrimitive("opt1"))
|
JsonPrimitive("Option Two"),
|
||||||
put("title", JsonPrimitive("Option One"))
|
JsonPrimitive("Option Three"),
|
||||||
},
|
|
||||||
buildJsonObject {
|
|
||||||
put("const", JsonPrimitive("opt2"))
|
|
||||||
put("title", JsonPrimitive("Option Two"))
|
|
||||||
},
|
|
||||||
buildJsonObject {
|
|
||||||
put("const", JsonPrimitive("opt3"))
|
|
||||||
put("title", JsonPrimitive("Option Three"))
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -367,7 +362,7 @@ fun Server.registerConformanceTools() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
// Titled multi-select
|
// Titled multi-select - uses items.anyOf with const/title pairs
|
||||||
put(
|
put(
|
||||||
"titledMulti",
|
"titledMulti",
|
||||||
buildJsonObject {
|
buildJsonObject {
|
||||||
|
|
@ -375,9 +370,8 @@ fun Server.registerConformanceTools() {
|
||||||
put(
|
put(
|
||||||
"items",
|
"items",
|
||||||
buildJsonObject {
|
buildJsonObject {
|
||||||
put("type", JsonPrimitive("string"))
|
|
||||||
put(
|
put(
|
||||||
"oneOf",
|
"anyOf",
|
||||||
JsonArray(
|
JsonArray(
|
||||||
listOf(
|
listOf(
|
||||||
buildJsonObject {
|
buildJsonObject {
|
||||||
|
|
@ -405,7 +399,7 @@ fun Server.registerConformanceTools() {
|
||||||
"Please review and update the form fields with defaults",
|
"Please review and update the form fields with defaults",
|
||||||
schema,
|
schema,
|
||||||
)
|
)
|
||||||
CallToolResult(listOf(TextContent(result.content.toString())))
|
CallToolResult(listOf(TextContent("Elicitation completed: action=${result.action}, content=${result.content}")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 12. Dynamic tool
|
// 12. Dynamic tool
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue