Package io.modelcontextprotocol.server
Record Class McpStatelessServerFeatures.AsyncCompletionSpecification
java.lang.Object
java.lang.Record
io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncCompletionSpecification
- Record Components:
referenceKey- The unique key representing the completion reference.completionHandler- The asynchronous function that processes completion requests and returns results. The function's argument is aMcpSchema.CompleteRequest.
- Enclosing class:
- McpStatelessServerFeatures
public static record McpStatelessServerFeatures.AsyncCompletionSpecification(McpSchema.CompleteReference referenceKey, BiFunction<McpTransportContext,McpSchema.CompleteRequest,reactor.core.publisher.Mono<McpSchema.CompleteResult>> completionHandler)
extends Record
Specification of a completion handler function with asynchronous execution support.
Completions generate AI model outputs based on prompt or resource references and
user-provided arguments. This abstraction enables:
- Customizable response generation logic
- Parameter-driven template expansion
- Dynamic interaction with connected clients
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncCompletionSpecification(McpSchema.CompleteReference referenceKey, BiFunction<McpTransportContext, McpSchema.CompleteRequest, reactor.core.publisher.Mono<McpSchema.CompleteResult>> completionHandler) Creates an instance of aAsyncCompletionSpecificationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionBiFunction<McpTransportContext,McpSchema.CompleteRequest, reactor.core.publisher.Mono<McpSchema.CompleteResult>> Returns the value of thecompletionHandlerrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thereferenceKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AsyncCompletionSpecification
public AsyncCompletionSpecification(McpSchema.CompleteReference referenceKey, BiFunction<McpTransportContext, McpSchema.CompleteRequest, reactor.core.publisher.Mono<McpSchema.CompleteResult>> completionHandler) Creates an instance of aAsyncCompletionSpecificationrecord class.- Parameters:
referenceKey- the value for thereferenceKeyrecord componentcompletionHandler- the value for thecompletionHandlerrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
referenceKey
Returns the value of thereferenceKeyrecord component.- Returns:
- the value of the
referenceKeyrecord component
-
completionHandler
public BiFunction<McpTransportContext,McpSchema.CompleteRequest, completionHandler()reactor.core.publisher.Mono<McpSchema.CompleteResult>> Returns the value of thecompletionHandlerrecord component.- Returns:
- the value of the
completionHandlerrecord component
-