Class McpCompletionRef

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

public class McpCompletionRef extends Object
Revision-neutral identification of the declaration a completion/complete request targets.

Supersedes the wire-level closed CompletionReference family (PromptReference / ResourceTemplateReference). getTarget() is always an exact declaration: a prompt name or a registered uriTemplate string, never a concrete/expanded URI.

Use prompt(String) or resource(String) to construct an instance; this keeps neutral dispatch code free of free-form kind strings.

  • Constructor Details

  • Method Details

    • prompt

      public static McpCompletionRef prompt(String name)
      Creates a reference to a prompt argument completion target.
      Parameters:
      name - The exact prompt name. Can be null.
      Returns:
      A new reference. Never null.
    • resource

      public static McpCompletionRef resource(String uriTemplate)
      Creates a reference to a resource-template variable completion target.
      Parameters:
      uriTemplate - The exact registered URI template string. Can be null.
      Returns:
      A new reference. Never null.
    • getKind

      The kind of declaration this reference targets.
      Returns:
      The kind, or null if not set.
    • setKind

      Sets the kind of declaration this reference targets.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getTarget

      public String getTarget()
      The exact target declaration: a prompt name for McpCompletionRef.Kind.PROMPT, or a registered URI template string for McpCompletionRef.Kind.RESOURCE.
      Returns:
      The target, or null if not set.
    • setTarget

      Sets the exact target declaration.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.