Commit 11ad2a7
SEP-1330 Elicitation Enum Schema Improvements and Standards Compliance (modelcontextprotocol#1148)
* Replace enumNames with standard-compliant oneOf pattern
The enumNames property is not a valid JSON Schema keyword. Updated
EnumSchema to use the standard-compliant oneOf pattern with const
and title keywords for each option, as recommended by JSON Schema
specification.
* Refactor enum schemas to support 3 distinct types
- SingleSelectEnumSchema: Supports both plain enum[] and oneOf with titles
- MultiSelectEnumSchema: Array type for multi-selection with/without titles
- DeprecatedEnumSchema: Maintains backward compatibility with enumNames
This replaces the non-standard enumNames approach with JSON Schema-compliant
patterns using oneOf/const for titled enums, while preserving backward
compatibility and adding multi-select support.
* nit: address tiny comment about # maxItems
* Refactor enum schemas with typed variants and array support
* Update enum examples in elicitation docs with validated schemas
* replace deprecated with legacy
* nits
* improve comment
* reset docs/specification/2025-06-18/schema.mdx
* fix
* Improve docs and add changelog entry
* add another doc comment
* add another doc comment
* Update multi-select to align with SEP-1330
* Fix default values on new elicitation schemas
* Make individual Schemas interfaces rather than type aliases
* run prettier
* update types based on discussion to match validation
---------
Co-authored-by: Tapan Chugh <[email protected]>
Co-authored-by: Cliff Hall <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Felix Weinberger <[email protected]>1 parent d847a00 commit 11ad2a7
File tree
5 files changed
+559
-44
lines changed- docs/specification/draft
- client
- schema/draft
5 files changed
+559
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
276 | 331 | | |
277 | 332 | | |
278 | 333 | | |
| |||
284 | 339 | | |
285 | 340 | | |
286 | 341 | | |
287 | | - | |
| 342 | + | |
288 | 343 | | |
289 | 344 | | |
290 | 345 | | |
| |||
0 commit comments