Skip to content

Conversation

@pbezglasny
Copy link
Contributor

@pbezglasny pbezglasny commented Jan 5, 2026

Motivation and Context

Improve enum elicitation builder: switch to typesage implementation with better readability

Also:

  • set legacy return type for required_enum/optional_enum to match previous version return type
  • fix deprecation version to correct next version

How Has This Been Tested?

Unit/integration tests

Breaking Changes

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

@github-actions github-actions bot added T-core Core library changes T-model Model/data structure changes labels Jan 5, 2026
@pbezglasny pbezglasny force-pushed the enum_elicitation_improvements branch from 8992e5b to 4ba8260 Compare January 5, 2026 23:32
@alexhancock
Copy link
Collaborator

Can you provide more context on the motivation behind the changes?

@pbezglasny
Copy link
Contributor Author

@alexhancock previously in #539 added builder for eliciation enum. I rewrite it in more type safe manner to improve user experience. Also, small fixes before 0.13 release to backward capability with 0.12.

@alexhancock alexhancock self-requested a review January 14, 2026 21:14
@alexhancock alexhancock merged commit e49aef6 into modelcontextprotocol:main Jan 14, 2026
11 checks passed
@alexhancock
Copy link
Collaborator

@pbezglasny Got it. I had already cut for #620

Are the backwards compat improvements worth re-cutting?

@pbezglasny
Copy link
Contributor Author

@alexhancock
Well only difference, that

pub fn required_enum(self, name: impl Into<String>, values: Vec<String>) -> Self {
now return legacy format for fully backward capability (format described here),

// Continue to support the current EnumSchema as Legacy

/**
  * Legacy: Use TitledSingleSelectEnumSchema instead. 
  * This interface will be removed in a future version.
  */
export interface LegacyEnumSchema {
  type: "string";
  title?: string;
  description?: string;
  enum: string[];
  enumNames?: string[]; // Titles for enum values (non-standard, legacy)
}

in the cut it return new format for untitled singlar enum

// Single select enum without titles 
export type UntitledSingleSelectEnumSchema = {
      type: "string";
      title?: string;
      description?: string;
      enum: string[]; // Plain enum without titles
    };

It's basically the same schema, so it's supposed to work as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-model Model/data structure changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants