Skip to content

Remove LegacyTitledEnumSchema API#1309

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/remove-obsolete-api
Closed

Remove LegacyTitledEnumSchema API#1309
Copilot wants to merge 2 commits intomainfrom
copilot/remove-obsolete-api

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Breaking Change

Removes the deprecated LegacyTitledEnumSchema class from the elicitation API. The legacy schema used enumNames for titled enum options; migrate to TitledSingleSelectEnumSchema which uses oneOf with const/title per SEP-1330.

Changes

Protocol Changes

  • Removed LegacyTitledEnumSchema class and related converter logic
  • JSON with enumNames property now deserializes as UntitledSingleSelectEnumSchema (ignoring enumNames)
  • Removed LegacyTitledEnumSchema from GetDefaultAsJsonElement switch expression

Diagnostics

  • Removed obsoletions constants for MCP9001
  • Added comment reserving MCP9001 to prevent ID reuse

Tests & Documentation

  • Removed LegacyTitledEnumSchema tests and conformance server usage
  • Updated elicitation.md and XML documentation

Migration

Before:

new ElicitRequestParams.LegacyTitledEnumSchema
{
    Enum = ["dev", "staging", "prod"],
    EnumNames = ["Development", "Staging", "Production"]
}

After:

new ElicitRequestParams.TitledSingleSelectEnumSchema
{
    OneOf = [
        new() { Const = "dev", Title = "Development" },
        new() { Const = "staging", Title = "Staging" },
        new() { Const = "prod", Title = "Production" }
    ]
}
Original prompt

Remove the [Obsolete] LegacyTitledEnumSchema API and label the PR that does this as a breaking-change.

Created from Copilot CLI via the copilot delegate command.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

BREAKING CHANGE: Removed the [Obsolete] LegacyTitledEnumSchema API and related Obsoletions constants. The LegacyTitledEnumSchema class used enumNames for titled enums and has been replaced by TitledSingleSelectEnumSchema using oneOf with const/title. JSON with enumNames will now deserialize as UntitledSingleSelectEnumSchema (ignoring enumNames).

- Removed LegacyTitledEnumSchema class from ElicitRequestParams.cs
- Removed LegacyTitledEnumSchema from JSON converter (deserialization now ignores enumNames)
- Removed LegacyTitledEnumSchema from GetDefaultAsJsonElement method
- Removed obsoletions constants and added comment that MCP9001 cannot be reused
- Removed LegacyTitledEnumSchema tests from EnumSchemaTests.cs
- Removed LegacyTitledEnumSchema tests from ElicitationDefaultValuesTests.cs
- Removed LegacyTitledEnumSchema tests from PrimitiveSchemaDefinitionTests.cs
- Removed LegacyTitledEnumSchema usage from ConformanceTools.cs
- Updated documentation in elicitation.md
- Updated XML documentation comments to remove references

Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
@jeffhandley
Copy link
Collaborator

@mikekistler @stephentoub - Do you think it's appropriate to go ahead and remove this? We declared in https://modelcontextprotocol.github.io/csharp-sdk/versioning.html#obsolete-apis, "Within a MAJOR version update, obsolete APIs might be removed." It's our only obsolete API.

Copilot AI changed the title [WIP] Remove the [Obsolete] LegacyTitledEnumSchema API Remove LegacyTitledEnumSchema API Feb 19, 2026
Copilot AI requested a review from jeffhandley February 19, 2026 09:06
@stephentoub
Copy link
Contributor

Do you think it's appropriate to go ahead and remove this

It's still in the spec:
https://github.com/modelcontextprotocol/modelcontextprotocol/blob/b84af972500d77e2f42b139c24ecaa8091aa3201/schema/2025-11-25/schema.ts#L2448

/**
 * Use TitledSingleSelectEnumSchema instead.
 * This interface will be removed in a future version.
 *
 * @category `elicitation/create`
 */
export interface LegacyTitledEnumSchema {
  type: "string";
  title?: string;
  description?: string;
  enum: string[];
  /**
   * (Legacy) Display names for enum values.
   * Non-standard according to JSON schema 2020-12.
   */
  enumNames?: string[];
  default?: string;
}

@mikekistler
Copy link
Contributor

I was going to say yes, but then @stephentoub found that it is still in the spec, so I think we should probably keep it -- sadly.

@stephentoub
Copy link
Contributor

@jeffhandley
Copy link
Collaborator

Keeping this in until it's removed from the spec and conformance tests, meaning first opportunity to delete would be 2.0.0.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments