Merge pull request #250 from modelcontextprotocol/devcrocod/kotlin-quickstart-server-patch0
simplify creating input schema for kotlin server in quickstart
This commit is contained in:
commit
af2c937a7c
1 changed files with 10 additions and 16 deletions
|
|
@ -1273,16 +1273,12 @@ server.addTool(
|
||||||
Get weather alerts for a US state. Input is Two-letter US state code (e.g. CA, NY)
|
Get weather alerts for a US state. Input is Two-letter US state code (e.g. CA, NY)
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
inputSchema = Tool.Input(
|
inputSchema = Tool.Input(
|
||||||
properties = JsonObject(
|
properties = buildJsonObject {
|
||||||
mapOf(
|
putJsonObject("state") {
|
||||||
"state" to JsonObject(
|
put("type", "string")
|
||||||
mapOf(
|
put("description", "Two-letter US state code (e.g. CA, NY)")
|
||||||
"type" to JsonPrimitive("string"),
|
}
|
||||||
"description" to JsonPrimitive("Two-letter US state code (e.g. CA, NY)")
|
},
|
||||||
)
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
required = listOf("state")
|
required = listOf("state")
|
||||||
)
|
)
|
||||||
) { request ->
|
) { request ->
|
||||||
|
|
@ -1305,12 +1301,10 @@ server.addTool(
|
||||||
Get weather forecast for a specific latitude/longitude
|
Get weather forecast for a specific latitude/longitude
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
inputSchema = Tool.Input(
|
inputSchema = Tool.Input(
|
||||||
properties = JsonObject(
|
properties = buildJsonObject {
|
||||||
mapOf(
|
putJsonObject("latitude") { put("type", "number") }
|
||||||
"latitude" to JsonObject(mapOf("type" to JsonPrimitive("number"))),
|
putJsonObject("longitude") { put("type", "number") }
|
||||||
"longitude" to JsonObject(mapOf("type" to JsonPrimitive("number"))),
|
},
|
||||||
)
|
|
||||||
),
|
|
||||||
required = listOf("latitude", "longitude")
|
required = listOf("latitude", "longitude")
|
||||||
)
|
)
|
||||||
) { request ->
|
) { request ->
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue