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 a McpSchema.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 Details

  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • referenceKey

      public McpSchema.CompleteReference referenceKey()
      Returns the value of the referenceKey record component.
      Returns:
      the value of the referenceKey record component
    • completionHandler

      public BiFunction<McpTransportContext,McpSchema.CompleteRequest,reactor.core.publisher.Mono<McpSchema.CompleteResult>> completionHandler()
      Returns the value of the completionHandler record component.
      Returns:
      the value of the completionHandler record component