Enum Class McpClientCapability

java.lang.Object
java.lang.Enum<McpClientCapability>
org.springframework.ai.mcp.annotation.McpClientCapability
All Implemented Interfaces:
Serializable, Comparable<McpClientCapability>, Constable

public enum McpClientCapability extends Enum<McpClientCapability>
A client capability that a tool, prompt or resource cannot work without. Used in McpTool.requiredCapabilities(), McpPrompt.requiredCapabilities() and McpResource.requiredCapabilities().

On a 2026-07-28 ("modern") MCP server a client declares its capabilities in every request, and the server may only ask for input whose capability the request declares.

Since:
2.1.0
Author:
Christian Tzolov
  • Enum Constant Details

    • ELICITATION_FORM

      public static final McpClientCapability ELICITATION_FORM
      Form mode elicitation (elicitation.form): the method asks the user for structured input.
    • ELICITATION_URL

      public static final McpClientCapability ELICITATION_URL
      URL mode elicitation (elicitation.url): the method sends the user to a URL.
    • SAMPLING

      public static final McpClientCapability SAMPLING
      Sampling (sampling): the method asks the client's model for a completion.
    • ROOTS

      public static final McpClientCapability ROOTS
      Roots (roots): the method asks the client for its root URIs.
  • Method Details

    • values

      public static McpClientCapability[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static McpClientCapability valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null