-
Notifications
You must be signed in to change notification settings - Fork 1.4k
SEP-1330: Update EnumSchema and extend Elicitation result #1077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
cliffhall
wants to merge
9
commits into
modelcontextprotocol:main
from
cliffhall:update-enum-schema-and-elicitation-for-sep-1330
Closed
SEP-1330: Update EnumSchema and extend Elicitation result #1077
cliffhall
wants to merge
9
commits into
modelcontextprotocol:main
from
cliffhall:update-enum-schema-and-elicitation-for-sep-1330
+526
−215
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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"
commit: |
…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
- removed @ts-expect-error instances
- 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
This was referenced Nov 10, 2025
9 tasks
Contributor
|
Hey @cliffhall thanks for this one! Closing this one in favor of #1100 by @KKonstantinov which is this PR with some rebase / merge conflict fixes on top (authorship of your commits is preserved in that PR!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In
types.tsUntitledSingleSelectEnumSchema,TitledSingleSelectEnumSchema, andLegacyTitledEnumSchemaSingleSelectEnumSchemathat is a union of these threeUntitledMultiSelectEnumSchemaandTitledMultiSelectEnumSchemaMultiSelectEnumSchemathat is a union of these twoEnumSchemaSchemato be a union ofSingleSelectEnumSchemaandMultiSelectEnumSchemaElicitResultSchema- add string array as possible return typeIn
elicitation.test.tsMotivation and Context
Update
EnumSchemaand extend Elicitation result to support string array return type. See SEP-1330How Has This Been Tested?
Locally, all tests pass. New tests added.
CURRENTLY: spec.types test is failing because the spec changes aren't merged.
Breaking Changes
Nope.
Types of changes
Checklist
Additional context