@@ -220,7 +220,8 @@ static AsyncToolSpecification fromSync(SyncToolSpecification tool) {
220
220
return null ;
221
221
}
222
222
return new AsyncToolSpecification (tool .tool (),
223
- (exchange , map ) -> Mono .fromCallable (() -> tool .call ().apply (exchange , map ))
223
+ (exchange , map ) -> Mono
224
+ .fromCallable (() -> tool .call ().apply (new McpSyncServerExchange (exchange ), map ))
224
225
.subscribeOn (Schedulers .boundedElastic ()));
225
226
}
226
227
}
@@ -259,7 +260,8 @@ static AsyncResourceSpecification fromSync(SyncResourceSpecification resource) {
259
260
return null ;
260
261
}
261
262
return new AsyncResourceSpecification (resource .resource (),
262
- (exchange , req ) -> Mono .fromCallable (() -> resource .readHandler ().apply (exchange , req ))
263
+ (exchange , req ) -> Mono
264
+ .fromCallable (() -> resource .readHandler ().apply (new McpSyncServerExchange (exchange ), req ))
263
265
.subscribeOn (Schedulers .boundedElastic ()));
264
266
}
265
267
}
@@ -301,7 +303,8 @@ static AsyncPromptSpecification fromSync(SyncPromptSpecification prompt) {
301
303
return null ;
302
304
}
303
305
return new AsyncPromptSpecification (prompt .prompt (),
304
- (exchange , req ) -> Mono .fromCallable (() -> prompt .promptHandler ().apply (exchange , req ))
306
+ (exchange , req ) -> Mono
307
+ .fromCallable (() -> prompt .promptHandler ().apply (new McpSyncServerExchange (exchange ), req ))
305
308
.subscribeOn (Schedulers .boundedElastic ()));
306
309
}
307
310
}
@@ -340,7 +343,7 @@ static AsyncPromptSpecification fromSync(SyncPromptSpecification prompt) {
340
343
* returning results
341
344
*/
342
345
public record SyncToolSpecification (McpSchema .Tool tool ,
343
- BiFunction <McpAsyncServerExchange , Map <String , Object >, McpSchema .CallToolResult > call ) {
346
+ BiFunction <McpSyncServerExchange , Map <String , Object >, McpSchema .CallToolResult > call ) {
344
347
}
345
348
346
349
/**
@@ -369,7 +372,7 @@ public record SyncToolSpecification(McpSchema.Tool tool,
369
372
* @param readHandler The function that handles resource read requests
370
373
*/
371
374
public record SyncResourceSpecification (McpSchema .Resource resource ,
372
- BiFunction <McpAsyncServerExchange , McpSchema .ReadResourceRequest , McpSchema .ReadResourceResult > readHandler ) {
375
+ BiFunction <McpSyncServerExchange , McpSchema .ReadResourceRequest , McpSchema .ReadResourceResult > readHandler ) {
373
376
}
374
377
375
378
/**
@@ -401,7 +404,7 @@ public record SyncResourceSpecification(McpSchema.Resource resource,
401
404
* formatted templates
402
405
*/
403
406
public record SyncPromptSpecification (McpSchema .Prompt prompt ,
404
- BiFunction <McpAsyncServerExchange , McpSchema .GetPromptRequest , McpSchema .GetPromptResult > promptHandler ) {
407
+ BiFunction <McpSyncServerExchange , McpSchema .GetPromptRequest , McpSchema .GetPromptResult > promptHandler ) {
405
408
}
406
409
407
410
// ---------------------------------------
0 commit comments