You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is using data classes to express all the types of MCP protocol. This might cause all the down-compatibility issues described in linked document, if the MCP protocol evolves.
Describe the solution you'd like
A possible way to overcome this issues is to stop using data classes in favor of classes with private constructors, and allow to create them only with builders. If the MCP protocol is extended, the new class properties can be put in any order in the private constructor, to follow the protocol evolution. Example of such an approach here:
Is your feature request related to a problem? Please describe.
The official Kotlin guidelines discourage use of data classes in public APIs:
https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api
This project is using data classes to express all the types of MCP protocol. This might cause all the down-compatibility issues described in linked document, if the MCP protocol evolves.
Describe the solution you'd like
A possible way to overcome this issues is to stop using data classes in favor of classes with private constructors, and allow to create them only with builders. If the MCP protocol is extended, the new class properties can be put in any order in the private constructor, to follow the protocol evolution. Example of such an approach here:
https://github.com/xemantic/xemantic-ai-tool-schema/blob/main/src/commonMain/kotlin/JsonSchema.kt
(e.g.
ObjectSchema
class). The tests are here:https://github.com/xemantic/xemantic-ai-tool-schema/blob/main/src/commonTest/kotlin/JsonSchemaTest.kt
If this is considered a way to go, I would be happy to prepare this PR.
The text was updated successfully, but these errors were encountered: