-
Notifications
You must be signed in to change notification settings - Fork 402
feat(elicitation) implement SEP-1330 Elicitation Enum Schema Improvemvent #539
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
base: main
Are you sure you want to change the base?
feat(elicitation) implement SEP-1330 Elicitation Enum Schema Improvemvent #539
Conversation
…ents and Standards Compliance
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 to support enhanced enum selection capabilities for the MCP (Model Context Protocol) Rust SDK. The implementation adds support for single/multi-select enums with optional human-readable titles.
Key changes:
- Introduced new enum schema structures (
SingleSelectEnumSchema,MultiSelectEnumSchema) with titled and untitled variants to comply with the updated specification - Added
EnumSchemaBuilderwith a fluent API for configuring enum schemas including multi-select options, min/max items, and default values - Maintained backward compatibility by preserving the legacy enum schema structure
- Enhanced JSON schema inference to automatically detect and convert enum types in structs to the appropriate elicitation schema format
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/servers/src/elicitation_enum_inference.rs | New example demonstrating enum selection in elicitation forms with both titled and untitled single/multi-select options |
| examples/servers/Cargo.toml | Added example configuration for the new enum elicitation example |
| crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json | Updated JSON schema definitions to include new enum schema structures |
| crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json | Updated JSON schema definitions to include new enum schema structures |
| crates/rmcp/tests/test_elicitation.rs | Updated test to use new EnumSchema::builder() API instead of direct vector construction |
| crates/rmcp/src/model/elicitation_schema.rs | Core implementation of new enum schema types, builder pattern, and schema inference logic |
Comments suppressed due to low confidence (1)
crates/rmcp/src/model/elicitation_schema.rs:953
- Debug print statement left in production code. This
println!should be removed or replaced with proper logging (e.g.,tracing::debug!).
serde_json::from_value(serde_json::Value::Object(schema))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json
Outdated
Show resolved
Hide resolved
crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
Hi, @pbezglasny ! As I see, you've combined the implementation of #521 in this PR. I think it's worth mentioning this explicitly here. |
|
@bug-ops good point, thanks. I'll update PR description |
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.
There was another PR #537 that closed. In this PR is used standard way to parse json schema without modification using attributes of schemars
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