Class McpCompletionRequest

java.lang.Object
org.apache.juneau.rest.server.mcp.McpCompletionRequest

public class McpCompletionRequest extends Object
Revision-neutral invocation of an McpCompleter.

Supersedes the wire-level CompleteRequest bean. Built by a dated adapter after it has validated the incoming completion/complete request and resolved the target McpCompleter; by the time an adapter constructs one of these, getValue() is guaranteed non-null.

  • Constructor Details

  • Method Details

    • getRef

      The completion target.
      Returns:
      The reference, or null if not set.
    • setRef

      Sets the completion target.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getArgumentName

      The name of the prompt argument or template variable being completed.
      Returns:
      The argument name, or null if not set.
    • setArgumentName

      Sets the name of the prompt argument or template variable being completed.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getValue

      public String getValue()
      The current (partial) value being completed.

      Adapters must validate this as a non-null string before dispatching to a completer; this type does not itself enforce that constraint.

      Returns:
      The current value. Never null once an adapter has validated the request.
    • setValue

      Sets the current (partial) value being completed.
      Parameters:
      value - The new value.
      Returns:
      This object.
    • getContextArguments

      Additional already-resolved argument values supplied by the client for context.
      Returns:
      An immutable, insertion-ordered map. Never null; empty when the request omitted context.
    • setContextArguments

      Sets the additional already-resolved argument values supplied by the client for context.

      The supplied map is defensively copied into an immutable, insertion-ordered map. A null value normalizes to an immutable empty map, matching the contract for omitted context.

      Parameters:
      value - The new value. Can be null, which normalizes to an empty map.
      Returns:
      This object.