File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed
samples/weather-stdio-server/src/main/kotlin/io/modelcontextprotocol/sample/server Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -58,16 +58,12 @@ fun `run mcp server`() {
5858 Get weather alerts for a US state. Input is Two-letter US state code (e.g. CA, NY)
5959 """ .trimIndent(),
6060 inputSchema = Tool .Input (
61- properties = JsonObject (
62- mapOf (
63- " state" to JsonObject (
64- mapOf (
65- " type" to JsonPrimitive (" string" ),
66- " description" to JsonPrimitive (" Two-letter US state code (e.g. CA, NY)" )
67- )
68- ),
69- )
70- ),
61+ properties = buildJsonObject {
62+ putJsonObject(" state" ) {
63+ put(" type" , " string" )
64+ put(" description" , " Two-letter US state code (e.g. CA, NY)" )
65+ }
66+ },
7167 required = listOf (" state" )
7268 )
7369 ) { request ->
@@ -90,12 +86,14 @@ fun `run mcp server`() {
9086 Get weather forecast for a specific latitude/longitude
9187 """ .trimIndent(),
9288 inputSchema = Tool .Input (
93- properties = JsonObject (
94- mapOf (
95- " latitude" to JsonObject (mapOf (" type" to JsonPrimitive (" number" ))),
96- " longitude" to JsonObject (mapOf (" type" to JsonPrimitive (" number" ))),
97- )
98- ),
89+ properties = buildJsonObject {
90+ putJsonObject(" latitude" ) {
91+ put(" type" , " number" )
92+ }
93+ putJsonObject(" longitude" ) {
94+ put(" type" , " number" )
95+ }
96+ },
9997 required = listOf (" latitude" , " longitude" )
10098 )
10199 ) { request ->
You can’t perform that action at this time.
0 commit comments