Skip to content

Commit dab40ad

Browse files
authored
Merge pull request #144 from joreilly/mcp_fix
mcp server json schema fix
2 parents ba70e3c + 9b57687 commit dab40ad

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mcp-server/src/main/kotlin/server.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import kotlinx.io.asSink
1111
import kotlinx.io.buffered
1212
import kotlinx.serialization.json.JsonObject
1313
import kotlinx.serialization.json.JsonPrimitive
14+
import kotlinx.serialization.json.buildJsonObject
1415
import kotlinx.serialization.json.jsonPrimitive
16+
import kotlinx.serialization.json.putJsonObject
1517

1618

1719
private val koin = initKoin(enableNetworkLogs = true).koin
@@ -47,12 +49,10 @@ fun configureServer(): Server {
4749
name = "get-emissions",
4850
description = "List emission info for a particular country",
4951
inputSchema = Tool.Input(
50-
properties = JsonObject(
51-
mapOf(
52-
"countryCode" to JsonPrimitive("string"),
53-
"year" to JsonPrimitive("date"),
54-
)
55-
),
52+
properties = buildJsonObject {
53+
putJsonObject("countryCode") { put("type", JsonPrimitive("string")) }
54+
putJsonObject("year") { put("type", JsonPrimitive("string")) }
55+
},
5656
required = listOf("countryCode", "year")
5757
)
5858

0 commit comments

Comments
 (0)