File tree Expand file tree Collapse file tree 5 files changed +17
-43
lines changed
kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types
kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/server Expand file tree Collapse file tree 5 files changed +17
-43
lines changed Original file line number Diff line number Diff line change 11package io.modelcontextprotocol.kotlin.sdk.types
22
3+ import io.modelcontextprotocol.kotlin.sdk.types.Icon.Theme.Dark
4+ import io.modelcontextprotocol.kotlin.sdk.types.Icon.Theme.Light
35import kotlinx.serialization.SerialName
46import kotlinx.serialization.Serializable
57import kotlinx.serialization.json.JsonObject
@@ -26,6 +28,14 @@ public val SUPPORTED_PROTOCOL_VERSIONS: List<String> = listOf(
2628public sealed interface WithMeta {
2729 @SerialName(" _meta" )
2830 public val meta: JsonObject ?
31+
32+ @Deprecated(
33+ message = " Use 'meta' instead." ,
34+ replaceWith = ReplaceWith (" meta" ),
35+ )
36+ @Suppress(" PropertyName" , " VariableNaming" )
37+ public val _meta : JsonObject
38+ get() = meta ? : EmptyJsonObject
2939}
3040
3141// ============================================================================
Original file line number Diff line number Diff line change @@ -237,13 +237,4 @@ public data class ListPromptsResult(
237237 @SerialName(" _meta" )
238238 override val meta : JsonObject ? = null ,
239239) : ServerResult,
240- PaginatedResult {
241-
242- @Deprecated(
243- message = " Use 'meta' instead." ,
244- replaceWith = ReplaceWith (" meta" ),
245- )
246- @Suppress(" PropertyName" , " VariableNaming" )
247- public val _meta : JsonObject ?
248- get() = meta
249- }
240+ PaginatedResult
Original file line number Diff line number Diff line change @@ -223,16 +223,7 @@ public data class ListResourcesResult(
223223 @SerialName(" _meta" )
224224 override val meta : JsonObject ? = null ,
225225) : ServerResult,
226- PaginatedResult {
227-
228- @Deprecated(
229- message = " Use 'meta' instead." ,
230- replaceWith = ReplaceWith (" meta" ),
231- )
232- @Suppress(" PropertyName" , " VariableNaming" )
233- public val _meta : JsonObject ?
234- get() = meta
235- }
226+ PaginatedResult
236227
237228// ============================================================================
238229// resources/read
@@ -442,13 +433,4 @@ public data class ListResourceTemplatesResult(
442433 @SerialName(" _meta" )
443434 override val meta : JsonObject ? = null ,
444435) : ServerResult,
445- PaginatedResult {
446-
447- @Deprecated(
448- message = " Use 'meta' instead." ,
449- replaceWith = ReplaceWith (" meta" ),
450- )
451- @Suppress(" PropertyName" , " VariableNaming" )
452- public val _meta : JsonObject ?
453- get() = meta
454- }
436+ PaginatedResult
Original file line number Diff line number Diff line change @@ -259,13 +259,4 @@ public data class ListToolsResult(
259259 @SerialName(" _meta" )
260260 override val meta : JsonObject ? = null ,
261261) : ServerResult,
262- PaginatedResult {
263-
264- @Deprecated(
265- message = " Use 'meta' instead." ,
266- replaceWith = ReplaceWith (" meta" ),
267- )
268- @Suppress(" PropertyName" , " VariableNaming" )
269- public val _meta : JsonObject ?
270- get() = meta
271- }
262+ PaginatedResult
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import io.modelcontextprotocol.kotlin.sdk.Implementation
1515import io.modelcontextprotocol.kotlin.sdk.Method
1616import io.modelcontextprotocol.kotlin.sdk.Prompt
1717import io.modelcontextprotocol.kotlin.sdk.ServerCapabilities
18+ import io.modelcontextprotocol.kotlin.sdk.types.McpException
1819import kotlinx.coroutines.CompletableDeferred
1920import kotlinx.coroutines.test.runTest
2021import org.junit.jupiter.api.Nested
@@ -93,16 +94,15 @@ class OldSchemaServerPromptsTest : OldSchemaAbstractServerFeaturesTest() {
9394
9495 // then
9596 assertTrue(result, " Prompt should be removed successfully" )
96- val mcpException = shouldThrow<IllegalStateException > {
97+ val mcpException = shouldThrow<McpException > {
9798 client.getPrompt(
9899 GetPromptRequest (
99100 name = testPrompt.name,
100101 arguments = null ,
101102 ),
102103 )
103104 }
104- mcpException shouldHaveMessage
105- " JSONRPCError(code=InternalError, message=Prompt not found: ${testPrompt.name} , data={})"
105+ mcpException shouldHaveMessage " MCP error -32603: Prompt not found: ${testPrompt.name} "
106106
107107 client.listPrompts() shouldNotBeNull {
108108 prompts.firstOrNull { it.name == testPrompt.name } shouldBe null
You can’t perform that action at this time.
0 commit comments