Skip to content

Conversation

@KKonstantinov
Copy link
Contributor

Extend SEP-1330 by @cliffhall to provide compatibility with SEP-1034.

Original Author: @cliffhall
Original PR: #1077

Motivation and Context

Client-side defaulting of the new enum types.

How Has This Been Tested?

Unit tests

Breaking Changes

None

Types of changes

  • 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

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

cliffhall and others added 10 commits November 3, 2025 17:30
…ay return type. See [SEP-1330](modelcontextprotocol/modelcontextprotocol#1330)

* In types.ts
  - add UntitledSingleSelectEnumSchema, TitledSingleSelectEnumSchema, LegacyTitledEnumSchema
    - add SingleSelectEnumSchema that is a union of these three
  - add UntitledMultiSelectEnumSchema, TitledMultiSelectEnumSchema
    - add MultiSelectEnumSchema that is a union of these two
  - refactor EnumSchemaSchema to be a union of SingleSelectEnumSchema and MultiSelectEnumSchema

* In elicitation.test.ts
  - simplify tests by extracting the duplicated client and server creation and connection into a beforeEach run in the describe for each flow
  - add positive/negative tests for all enum permutations (single-select, multi-select, titled, untitled, and legacy
    - "should succeed with valid selection in single-select untitled enum"
    - "should succeed with valid selection in single-select titled enum"
    - "should succeed with valid selection in single-select titled legacy enum"
    - "should succeed with valid selection in multi-select untitled enum"
    - "should succeed with valid selection in multi-select titled enum"
    - "should reject invalid selection in single-select untitled enum"
    - "should reject invalid selection in single-select titled enum"
    - "should reject invalid selection in single-select titled legacy enum"
    - "should reject invalid selection in multi-select untitled enum"
    - "should reject invalid selection in multi-select titled enum"
…pe. See [SEP-1330](modelcontextprotocol/modelcontextprotocol#1330)

* In types.ts
  - Set UntitledMultiSelectEnumSchema and TitledMultiSelectEnumSchema
    - set default to z.array(z.string()).optional()
…on-for-sep-1330' into update-enum-schema-and-elicitation-for-sep-1330
  - fix default return types on single-select with titles
  - In "should succeed with valid selection in multi-select untitled enum"
    - rename prop to colors
* In types.ts
  - add string array to ElicitResultSchema
  - Replace @ts-expect-error erroneously removed for "pattern" types

* In types.ts
  - follow the pattern of the other primitive types
    - name the zod schemas with SchemaSchema at the end
    - export types inferred from enum schemas with just Schema at the end

* In spec.types.test.ts
  - add tests for enum types
@KKonstantinov KKonstantinov requested a review from a team as a code owner November 11, 2025 16:21
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1100

commit: ff03c92

@felixweinberger felixweinberger merged commit 9f06b6b into modelcontextprotocol:main Nov 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SEP-1330: Elicitation Enum Schema Improvements

3 participants