public static class McpServerFeatures.AsyncPromptSpecification extends Object
Example prompt specification:
new McpServerFeatures.AsyncPromptSpecification(
new Prompt("analyze", "Code analysis template"),
(exchange, request) -> {
String code = request.getArguments().get("code");
return Mono.just(new GetPromptResult(
"Analyze this code:\n\n" + code + "\n\nProvide feedback on:"));
})
formatted templates. The function's first argument is an
McpAsyncServerExchange upon which the server can interact with the
connected client. The second arguments is a
McpSchema.GetPromptRequest.Copyright © 2025. All rights reserved.