Skip to content

Commit cac189d

Browse files
authored
Merge branch 'main' into tigina/server-refactoring
2 parents 67aef86 + 35e51a5 commit cac189d

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
**/build/reports/
6767
6868
- name: Publish Test Report
69-
uses: mikepenz/action-junit-report@v5
69+
uses: mikepenz/action-junit-report@v6
7070
if: ${{ !cancelled() }} # always run even if the previous step fails
7171
with:
7272
report_paths: '**/test-results/**/TEST-*.xml'

kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/ServerSession.kt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public open class ServerSession(
107107
* @return The result of the ping request.
108108
* @throws IllegalStateException If for some reason the method is not supported or the connection is closed.
109109
*/
110-
public suspend fun ping(): EmptyRequestResult = request<EmptyRequestResult>(PingRequest())
110+
public suspend fun ping(): EmptyRequestResult = request(PingRequest())
111111

112112
/**
113113
* Creates a message using the server's sampling capability.
@@ -121,8 +121,12 @@ public open class ServerSession(
121121
params: CreateMessageRequest,
122122
options: RequestOptions? = null,
123123
): CreateMessageResult {
124-
logger.debug { "Creating message with params: $params" }
125-
return request<CreateMessageResult>(params, options)
124+
logger.debug {
125+
"Creating message with ${params.messages.size} messages, maxTokens=${params.maxTokens}, " +
126+
"temperature=${params.temperature}, systemPrompt=${if (params.systemPrompt != null) "present" else "absent"}"
127+
}
128+
logger.trace { "Full createMessage params: $params" }
129+
return request(params, options)
126130
}
127131

128132
/**
@@ -138,15 +142,19 @@ public open class ServerSession(
138142
options: RequestOptions? = null,
139143
): ListRootsResult {
140144
logger.debug { "Listing roots with params: $params" }
141-
return request<ListRootsResult>(ListRootsRequest(params), options)
145+
return request(ListRootsRequest(params), options)
142146
}
143147

144148
public suspend fun createElicitation(
145149
message: String,
146150
requestedSchema: RequestedSchema,
147151
options: RequestOptions? = null,
148152
): CreateElicitationResult {
149-
logger.debug { "Creating elicitation with message: $message" }
153+
logger.debug {
154+
"Creating elicitation with message length=${message.length}, " +
155+
"schema properties count=${requestedSchema.properties.size}"
156+
}
157+
logger.trace { "Full elicitation message: $message, requestedSchema: $requestedSchema" }
150158
return request(CreateElicitationRequest(message, requestedSchema), options)
151159
}
152160

0 commit comments

Comments
 (0)