Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions kotlin-sdk-core/api/kotlin-sdk-core.api
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
public final class io/modelcontextprotocol/kotlin/sdk/Annotations {
public static final field Companion Lio/modelcontextprotocol/kotlin/sdk/Annotations$Companion;
public fun <init> (Ljava/util/List;Lkotlin/time/Instant;Ljava/lang/Double;)V
public fun <init> (Ljava/util/List;Ljava/lang/String;Ljava/lang/Double;)V
public final fun component1 ()Ljava/util/List;
public final fun component2 ()Lkotlin/time/Instant;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/Double;
public final fun copy (Ljava/util/List;Lkotlin/time/Instant;Ljava/lang/Double;)Lio/modelcontextprotocol/kotlin/sdk/Annotations;
public static synthetic fun copy$default (Lio/modelcontextprotocol/kotlin/sdk/Annotations;Ljava/util/List;Lkotlin/time/Instant;Ljava/lang/Double;ILjava/lang/Object;)Lio/modelcontextprotocol/kotlin/sdk/Annotations;
public final fun copy (Ljava/util/List;Ljava/lang/String;Ljava/lang/Double;)Lio/modelcontextprotocol/kotlin/sdk/Annotations;
public static synthetic fun copy$default (Lio/modelcontextprotocol/kotlin/sdk/Annotations;Ljava/util/List;Ljava/lang/String;Ljava/lang/Double;ILjava/lang/Object;)Lio/modelcontextprotocol/kotlin/sdk/Annotations;
public fun equals (Ljava/lang/Object;)Z
public final fun getAudience ()Ljava/util/List;
public final fun getLastModified ()Lkotlin/time/Instant;
public final fun getLastModified ()Ljava/lang/String;
public final fun getPriority ()Ljava/lang/Double;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import kotlin.concurrent.atomics.AtomicLong
import kotlin.concurrent.atomics.ExperimentalAtomicApi
import kotlin.concurrent.atomics.incrementAndFetch
import kotlin.jvm.JvmInline
import kotlin.time.ExperimentalTime
import kotlin.time.Instant

public const val LATEST_PROTOCOL_VERSION: String = "2025-03-26"

Expand Down Expand Up @@ -302,6 +300,7 @@ public data class JSONRPCError(val code: ErrorCode, val message: String, val dat
public sealed interface NotificationParams : WithMeta

/* Cancellation */

/**
* This notification can be sent by either side to indicate that it is cancelling a previously issued request.
*
Expand Down Expand Up @@ -334,6 +333,7 @@ public data class CancelledNotification(override val params: Params) :
}

/* Initialization */

/**
* Describes the name and version of an MCP implementation.
*/
Expand Down Expand Up @@ -531,6 +531,7 @@ public data class InitializedNotification(override val params: Params = Params()
}

/* Ping */

/**
* A ping, issued by either the server or the client, to check that the other party is still alive.
* The receiver must promptly respond, or else it may be disconnected.
Expand Down Expand Up @@ -564,6 +565,7 @@ public sealed interface ProgressBase {
}

/* Progress notifications */

/**
* Represents a progress notification.
*
Expand Down Expand Up @@ -623,6 +625,7 @@ public data class ProgressNotification(override val params: Params) :
}

/* Pagination */

/**
* Represents a request supporting pagination.
*/
Expand Down Expand Up @@ -650,6 +653,7 @@ public sealed interface PaginatedResult : RequestResult {
}

/* Resources */

/**
* The contents of a specific resource or sub-resource.
*/
Expand Down Expand Up @@ -892,6 +896,7 @@ public data class ResourceUpdatedNotification(override val params: Params) : Ser
}

/* Prompts */

/**
* Describes an argument that a prompt can accept.
*/
Expand Down Expand Up @@ -1115,8 +1120,7 @@ public data class Annotations(
/**
* The moment the resource was last modified.
*/
@OptIn(ExperimentalTime::class)
val lastModified: Instant?,
val lastModified: String?,
/**
* Describes how important this data is for operating the server.
*
Expand Down Expand Up @@ -1162,6 +1166,7 @@ public data class PromptListChangedNotification(override val params: Params = Pa
}

/* Tools */

/**
* Additional properties describing a Tool to clients.
*
Expand Down Expand Up @@ -1345,6 +1350,7 @@ public data class ToolListChangedNotification(override val params: Params = Para
}

/* Logging */

/**
* The severity of a log message.
*/
Expand Down Expand Up @@ -1404,6 +1410,7 @@ public data class LoggingMessageNotification(override val params: Params) : Serv
}

/* Sampling */

/**
* Hints to use for model selection.
*/
Expand Down Expand Up @@ -1648,6 +1655,7 @@ public data class CompleteResult(val completion: Completion, override val _meta:
}

/* Roots */

/**
* Represents a root directory or file that the server can operate on.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import kotlin.test.assertIs
import kotlin.test.assertNotEquals
import kotlin.test.assertTrue
import kotlin.time.ExperimentalTime
import kotlin.time.Instant

class TypesTest {

Expand Down Expand Up @@ -243,15 +242,15 @@ class TypesTest {
fun `should serialize and deserialize annotations correctly`() {
val annotations = Annotations(
audience = listOf(Role.assistant),
lastModified = Instant.parse("2025-06-18T00:00:00Z"),
lastModified = "2025-06-18T00:00:00Z",
priority = 0.5,
)

val json = McpJson.encodeToString(annotations)
val decoded = McpJson.decodeFromString<Annotations>(json)

assertEquals(listOf(Role.assistant), decoded.audience)
assertEquals(Instant.parse("2025-06-18T00:00:00Z"), decoded.lastModified)
assertEquals("2025-06-18T00:00:00Z", decoded.lastModified)
assertEquals(0.5, decoded.priority)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ internal suspend fun WebSocketServerSession.mcpWebSocketEndpoint(block: () -> Se
try {
session = server.createSession(transport)
awaitCancellation()
} catch (e: CancellationException) {
} catch (_: CancellationException) {
session?.close()
}
}
Expand Down
Loading