@@ -8,14 +8,14 @@ import io.ktor.http.contentType
88import io.ktor.http.headers
99import io.ktor.serialization.kotlinx.json.json
1010import io.ktor.utils.io.streams.asInput
11- import io.modelcontextprotocol.kotlin.sdk.CallToolResult
12- import io.modelcontextprotocol.kotlin.sdk.Implementation
13- import io.modelcontextprotocol.kotlin.sdk.ServerCapabilities
14- import io.modelcontextprotocol.kotlin.sdk.TextContent
15- import io.modelcontextprotocol.kotlin.sdk.Tool
1611import io.modelcontextprotocol.kotlin.sdk.server.Server
1712import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions
1813import io.modelcontextprotocol.kotlin.sdk.server.StdioServerTransport
14+ import io.modelcontextprotocol.kotlin.sdk.types.CallToolResult
15+ import io.modelcontextprotocol.kotlin.sdk.types.Implementation
16+ import io.modelcontextprotocol.kotlin.sdk.types.ServerCapabilities
17+ import io.modelcontextprotocol.kotlin.sdk.types.TextContent
18+ import io.modelcontextprotocol.kotlin.sdk.types.ToolSchema
1919import kotlinx.coroutines.Job
2020import kotlinx.coroutines.runBlocking
2121import kotlinx.io.asSink
@@ -28,7 +28,8 @@ import kotlinx.serialization.json.put
2828import kotlinx.serialization.json.putJsonObject
2929
3030/* *
31- * Starts an MCP server that provides weather-related tools for fetching active weather alerts by state and weather forecasts by latitude/longitude.
31+ * Starts an MCP server that provides weather-related tools for fetching active
32+ * weather alerts by state and weather forecasts by latitude/longitude.
3233 */
3334fun runMcpServer () {
3435 // Base URL for the Weather API
@@ -72,7 +73,7 @@ fun runMcpServer() {
7273 description = """
7374 Get weather alerts for a US state. Input is Two-letter US state code (e.g. CA, NY)
7475 """ .trimIndent(),
75- inputSchema = Tool . Input (
76+ inputSchema = ToolSchema (
7677 properties = buildJsonObject {
7778 putJsonObject(" state" ) {
7879 put(" type" , " string" )
@@ -97,7 +98,7 @@ fun runMcpServer() {
9798 description = """
9899 Get weather forecast for a specific latitude/longitude
99100 """ .trimIndent(),
100- inputSchema = Tool . Input (
101+ inputSchema = ToolSchema (
101102 properties = buildJsonObject {
102103 putJsonObject(" latitude" ) {
103104 put(" type" , " number" )
0 commit comments