Skip to content

feat: Add JSON Schema integration with kotlinx-schema (#300)#520

Draft
kpavlov wants to merge 1 commit intomainfrom
kpavlov/kotlinx-schema
Draft

feat: Add JSON Schema integration with kotlinx-schema (#300)#520
kpavlov wants to merge 1 commit intomainfrom
kpavlov/kotlinx-schema

Conversation

@kpavlov
Copy link
Contributor

@kpavlov kpavlov commented Feb 12, 2026

Add JSON Schema integration with kotlinx-schema

This is not replacing the existing ToolSchema object with JsonSchema from kotlinx-schema yet, but only adds convenient converters.

  • Introduce asToolSchema extension functions for seamless conversion of JSON Schema to ToolSchema.
  • Add support for JsonObject, JsonSchema, and FunctionCallingSchema conversions.
  • Integrate kotlinx-schema and kotlinx-schema-generator dependencies into the project.
  • Include multiple test cases to validate schema conversion functionality.
  • Extend documentation with examples and usage guidelines for JSON Schema integration.

Motivation and Context

See #300

How Has This Been Tested?

Unit tests

Breaking Changes

No

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

#526

@kpavlov kpavlov added the enhancement New feature or request label Feb 12, 2026
@kpavlov kpavlov changed the title feat: Add JSON Schema integration with kotlinx-schema feat: Add JSON Schema integration with kotlinx-schema (#300) Feb 12, 2026
@kpavlov kpavlov force-pushed the kpavlov/kotlinx-schema branch from 1f046c8 to 8725d23 Compare March 1, 2026 18:56
- Introduce `asToolSchema` extension functions for seamless conversion of JSON Schema to `ToolSchema`.
- Add support for `JsonObject`, `JsonSchema`, and `FunctionCallingSchema` conversions.
- Integrate `kotlinx-schema` and `kotlinx-schema-generator` dependencies into the project.
- Include multiple test cases to validate schema conversion functionality.
- Extend documentation with examples and usage guidelines for JSON Schema integration.
@kpavlov kpavlov force-pushed the kpavlov/kotlinx-schema branch from 8725d23 to dd3e872 Compare March 2, 2026 17:47
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...elcontextprotocol/kotlin/sdk/types/tools.schema.kt 66.66% 0 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants