SEP: 1034 Add default values for all primitive types in elicitation schemas#1035
Conversation
There was a problem hiding this comment.
The use of enumNames is not compliant with the JSON schema specification. I've called out the locations where changes are needed and what the options are to associate a title with an enumerated value.
In short, enum is a valid keyword, but there is no acceptable way to associate a human readable title with it. The alternative is oneOf and anyOf used with const + title.
|
@cliffhall Thank you the review. I think that makes perfect sense. |
|
Thanks @chughtapan - I was going to say that adding optional defaults is separate to the enumNames discussion (#1035 is also not a breaking change). |
|
Thanks @evalstate - Yeah I think it makes perfect sense to keep this a non-breaking change. |
I added some thoughts about the actual schema changes needed in that PR. We need to make sure that the schema supports single-selection and multi-selection from an enumerated set. I proposed a schema shape that should cover that. |
|
@chughtapan - i see that this now has conflicts in |
| "title": "Environment", | ||
| "enum": ["development", "staging", "production"], | ||
| "enumNames": ["Development", "Staging", "Production"] | ||
| "enumNames": ["Development", "Staging", "Production"], |
There was a problem hiding this comment.
This goes counter to our other proposal for enums doesn't it?
pcarleton
left a comment
There was a problem hiding this comment.
I did one last pass over this PR and it all LGTM
(Change was accepted by the Core Maintainers on 2025-08-22 via async discord vote)
|
this needs a Docs maintainer for final ✅ maybe @bhosmer-ant ? |
Implement support for default values in elicitation schemas as specified in SEP-1034. The Python SDK already supported this through Pydantic's automatic inclusion of defaults in JSON schemas - only tests and documentation updates were needed. modelcontextprotocol/modelcontextprotocol#1034 modelcontextprotocol/modelcontextprotocol#1035
Motivation and Context
This PR implements the proposal in #1034 to enable default values in elicitation schemas for all primitive types.
How Has This Been Tested?
Breaking Changes
None - the default values are optional and existing flows will work as it is.
Types of changes
Checklist
Additional context
#1034 and references within demonstrate prototype client implementation