File tree 1 file changed +14
-16
lines changed
samples/weather-stdio-server/src/main/kotlin/io/modelcontextprotocol/sample/server
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`() {
58
58
Get weather alerts for a US state. Input is Two-letter US state code (e.g. CA, NY)
59
59
""" .trimIndent(),
60
60
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
+ },
71
67
required = listOf (" state" )
72
68
)
73
69
) { request ->
@@ -90,12 +86,14 @@ fun `run mcp server`() {
90
86
Get weather forecast for a specific latitude/longitude
91
87
""" .trimIndent(),
92
88
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
+ },
99
97
required = listOf (" latitude" , " longitude" )
100
98
)
101
99
) { request ->
You can’t perform that action at this time.
0 commit comments