-
Notifications
You must be signed in to change notification settings - Fork 403
feat(SEP-1330): Elicitation Enum Schema Improvements Implementation #537
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
feat(SEP-1330): Elicitation Enum Schema Improvements Implementation #537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements SEP-1330 Elicitation Enum Schema Improvements, introducing a comprehensive schema system for single and multi-select enums with optional human-readable titles. The implementation maintains backward compatibility through a LegacyEnumSchema while providing a new builder-based API for constructing enum schemas compliant with the updated MCP specification.
Key Changes:
- Introduced four new enum schema variants:
UntitledSingleSelectEnumSchema,TitledSingleSelectEnumSchema,UntitledMultiSelectEnumSchema, andTitledMultiSelectEnumSchema - Added
EnumSchemaBuilderwith fluent API for configuring enum schemas with support for single/multi-select modes, titles, descriptions, and default values - Enhanced schema inference in
from_json_schemato automatically detect and transform enum fields from JSON schemas, including reference resolution and property normalization
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
examples/servers/src/elicitation_stdio.rs |
Enhanced elicitation example with UserType enum demonstrating titled single-select functionality; updated error handling and output streams |
crates/rmcp/src/model/elicitation_schema.rs |
Core implementation of new enum schema types, builder pattern, and schema inference logic with reference resolution and property normalization |
crates/rmcp/tests/test_elicitation.rs |
Updated test to use new EnumSchema::builder() API instead of direct vector-based enum creation |
crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json |
JSON schema definitions for new enum schema variants, supporting both current and legacy formats |
crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json |
Updated current schema with new enum type definitions matching the implementation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c5f342a to
faeba48
Compare
Implemented #524 Elicitation Enum Schema Improvements and Standards Compliance.
Motivation and Context
SEP-1330: Elicitation Enum Schema Improvements introduce new schema for enum type for elicitation. This PR implements its specifications: single/multi select options with/without titles.
Details:
This code will serialized to specification format.
How Has This Been Tested?
Tested with mcpinspector. It correctly understands single select option for enum. But does not work with multi-select options.
Breaking Changes
Yes. By default elicitation
Types of changes
Checklist
Additional context
Closes #524