fix(client): serialize inputSchema as input_schema (#97)
This commit is contained in:
parent
9f00f22596
commit
9341f1e42f
2 changed files with 6 additions and 2 deletions
|
|
@ -3,6 +3,9 @@
|
||||||
package io.modelcontextprotocol.kotlin.sdk
|
package io.modelcontextprotocol.kotlin.sdk
|
||||||
|
|
||||||
import io.modelcontextprotocol.kotlin.sdk.shared.McpJson
|
import io.modelcontextprotocol.kotlin.sdk.shared.McpJson
|
||||||
|
import kotlinx.serialization.EncodeDefault
|
||||||
|
import kotlinx.serialization.ExperimentalSerializationApi
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.json.JsonElement
|
import kotlinx.serialization.json.JsonElement
|
||||||
import kotlinx.serialization.json.JsonObject
|
import kotlinx.serialization.json.JsonObject
|
||||||
|
|
@ -1043,6 +1046,7 @@ public data class Tool(
|
||||||
/**
|
/**
|
||||||
* A JSON object defining the expected parameters for the tool.
|
* A JSON object defining the expected parameters for the tool.
|
||||||
*/
|
*/
|
||||||
|
@SerialName("input_schema")
|
||||||
val inputSchema: Input,
|
val inputSchema: Input,
|
||||||
) {
|
) {
|
||||||
@Serializable
|
@Serializable
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class ToolSerializationTest {
|
||||||
{
|
{
|
||||||
"name": "get_weather",
|
"name": "get_weather",
|
||||||
"description": "Get the current weather in a given location",
|
"description": "Get the current weather in a given location",
|
||||||
"inputSchema": {
|
"input_schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"location": {
|
"location": {
|
||||||
|
|
@ -54,4 +54,4 @@ class ToolSerializationTest {
|
||||||
assertEquals(expected = getWeatherTool, actual = tool)
|
assertEquals(expected = getWeatherTool, actual = tool)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue