Skip to content

feat: add default value support to string, number, and integer schemas#686

Merged
alexhancock merged 1 commit intomainfrom
sep-1034
Feb 26, 2026
Merged

feat: add default value support to string, number, and integer schemas#686
alexhancock merged 1 commit intomainfrom
sep-1034

Conversation

@DaleSeo
Copy link
Member

@DaleSeo DaleSeo commented Feb 25, 2026

Closes #521

Motivation and Context

The MCP SEP-1034 specification extends elicitation by adding default value support to all primitive schema types. BooleanSchema and EnumSchema already had default fields, but StringSchema, NumberSchema, and IntegerSchema did not. This caused the conformance test elicitation-sep1034-defaults to fail because these three types could not deserialize a default field from JSON.

How Has This Been Tested?

Updated the JSON schema snapshot to reflect the new fields

Breaking Changes

None. All new fields are Option<T> with #[serde(skip_serializing_if = "Option::is_none")], so existing code that constructs these schemas without a default value continues to work unchanged.

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

@DaleSeo DaleSeo self-assigned this Feb 25, 2026
@github-actions github-actions bot added T-test Testing related changes T-config Configuration file changes T-core Core library changes T-model Model/data structure changes labels Feb 25, 2026
@DaleSeo DaleSeo marked this pull request as ready for review February 25, 2026 17:21
@DaleSeo DaleSeo requested a review from a team as a code owner February 25, 2026 17:21
@alexhancock alexhancock merged commit 93bfb4a into main Feb 26, 2026
16 checks passed
@alexhancock alexhancock deleted the sep-1034 branch February 26, 2026 15:02
This was referenced Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-core Core library changes T-model Model/data structure changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SEP-1034: Default Values for Elicitation Schemas

2 participants