FinalStandards Track
| Field | Value |
|---|---|
| SEP | 1330 |
| Title | Elicitation Enum Schema Improvements and Standards Compliance |
| Status | Final |
| Type | Standards Track |
| Created | 2025-08-11 |
| Author(s) | chughtapan |
| Sponsor | None |
| PR | #1330 |
Abstract
This SEP proposes improvements to enum schema definitions in MCP, deprecating the non-standardenumNames property in favor of JSON Schema-compliant patterns, and introducing additional support for multi-select enum schemas in addition to single choice schemas. The new schemas have been validated against the JSON specification.
Schema Changes: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1148
Typescript SDK Changes: https://github.com/modelcontextprotocol/typescript-sdk/pull/1077
Python SDK Changes: https://github.com/modelcontextprotocol/python-sdk/pull/1246
Client Implementation: https://github.com/evalstate/fast-agent/pull/324/files
Working Demo: https://asciinema.org/a/anBvJdqEmTjw0JkKYOooQa5Ta
Motivation
The existing schema for enums uses a non-standard approach to adding titles to enumerated values. It also limits use of enums in Elicitation (and any other schema object that should adoptEnumSchema in the future) to a single selection model. It is a common pattern to ask the user to select multiple entries. In the UI, this amounts to the difference between using checkboxes or radio buttons.
For these reasons, we propose the following non-breaking minor improvements to the EnumSchema for improving user and developer experience.
- Keep the existing
EnumSchemaas “Legacy”- It uses a non-standard approach for adding titles to enumerated values
- Mark it as Legacy but still support it for now.
- As per @dsp-ant When we have a proper deprecation strategy, we’ll mark it deprecated
- Introduce the distinction between Untitled and Titled enums.
- If the enumerated values are sufficient, no separate title need be specified for each value.
- If the enumerated values are not optimal for display, a title may be specified for each value.
- Introduce the distinction between Single and Multi-select enums.
- If only one value can be selected, a Single select schema can be used
- If more than one value can be selected, a Multi-select schema can be used
- In
ElicitResponse, add array as anadditionalPropertytype- Allows multiple selection of enumerated values to be returned to the server
Specification
1. Mark Current EnumSchema with Non-Standard enumNames Property as “Legacy”
The current MCP specification uses a non-standard enumNames property for providing display names for enum values. We propose to mark enumNames property as legacy, suggest using TitledSingleSelectEnum, a standards compliant enum type we define below.
2. Define Single Selection Enums (with Titled and Untitled varieties)
Enums may or may not need titles. The enumerated values may be human readable and fine for display. In which case an untitled implementation using the JSON Schema keywordenum is simpler. Adding titles requires the enum array to be replaced with an array of objects using const and title.
3. Introduce Multiple Selection Enums (with Titled and Untitled varieties)
While elicitation does not support arbitrary JSON types like arrays and objects so clients can display the selection choice easily, multiple selection enumerations can be easily implemented.4. Combine All Varieties as EnumSchema
The final EnumSchema rolls up the legacy, multi-select, and single-select schemas as one, defined as:
5. Extend ElicitResult
The current elicitation result schema only allows returning primitive types. We extend this to include string arrays for MultiSelectEnums:Instance Schema Examples
Single-Select Without Titles (No change)
Legacy Single Select With Titles
Single-Select with Titles
Multi-Select Without Titles
Multi-Select with Titles
Rationale
- Standards Compliance: Aligns with official JSON Schema specification. Standard patterns work with existing JSON Schema validators
- Flexibility: Supports both plain enums and enums with display names for single and multiple choice enums.
- Client Implementation: shows that the additional overhead of implementing a group of checkboxes v/s a single checkbox is minimal: https://github.com/evalstate/fast-agent/pull/324/files
Backwards Compatibility
TheLegacyEnumSchema type maintains backwards compatible during the migration period. Existing implementations using enumNames will continue to work until a protocol-wide deprecation strategy is implemented, and this schema is removed.
Reference Implementation
Schema Changes: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1148 Typescript SDK Changes: https://github.com/modelcontextprotocol/typescript-sdk/pull/1077 Python SDK Changes: https://github.com/modelcontextprotocol/python-sdk/pull/1246 Client Implementation: https://github.com/evalstate/fast-agent/pull/324/files Working Demo: https://asciinema.org/a/anBvJdqEmTjw0JkKYOooQa5TaSecurity Considerations
No security implications identified. This change is purely about schema structure and standards compliance.Appendix
Validations
Using stored validations in the JSON Schema Validator at https://www.jsonschemavalidator.net/ we validate:- All of the example instance schemas from this document against the proposed JSON meta-schema
EnumSchemain the next section. - Valid and invalid values against the example instance schemas from this document.
Legacy Single Selection
EnumSchemavalidating a legacy single select instance schema with titles- The legacy titled single select instance schema validating a correct single selection
- The legacy titled single select instance schema validating an incorrect single selection
Single Selection
EnumSchemavalidating a single select instance schema without titlesEnumSchemavalidating a single select instance schema with titles- The untitled single select instance schema validating a correct single selection
- The untitled single select instance schema invalidating an incorrect single selection
- The titled single select instance schema validating a correct single selection
- The titled single select instance schema invalidating an incorrect single selection
Multiple Selection
EnumSchemavalidating the multi-select instance schema without titlesEnumSchemavalidating the multi-select instance schema with titles- The untitled multi-select instance schema validating a correct multiple selection The untitled multi-select instance schema validating invalidating an incorrect multiple selection The titled multi-select instance schema validating a correct multiple selection The titled multi-select instance schema validating invalidating an incorrect multiple selection
JSON meta-schema
This is our proposal for the replacement of the currentEnumSchema in the specification’s schema.json.