Enum Class McpErrorKind

java.lang.Object
java.lang.Enum<McpErrorKind>
org.apache.juneau.rest.server.mcp.McpErrorKind
All Implemented Interfaces:
Serializable, Comparable<McpErrorKind>, Constable

public enum McpErrorKind extends Enum<McpErrorKind>
Revision-neutral classification of a dispatch failure.

The core raises a kind; each revision maps kinds to its own JSON-RPC error codes via McpRevision.errorCode(McpErrorKind). Several kinds legitimately map to the same code on a given revision — the point of the enum is that the core never has to know which.

  • Enum Constant Details

    • INVALID_REQUEST

      public static final McpErrorKind INVALID_REQUEST
      The JSON-RPC envelope itself was unusable (absent or empty method, null envelope).
    • UNKNOWN_METHOD

      public static final McpErrorKind UNKNOWN_METHOD
      The requested top-level JSON-RPC method is not implemented by this revision.
    • TOOL_NOT_FOUND

      public static final McpErrorKind TOOL_NOT_FOUND
      A tools/call named a tool that is not registered.
    • PROMPT_NOT_FOUND

      public static final McpErrorKind PROMPT_NOT_FOUND
      A prompts/get named a prompt that is not registered.
    • RESOURCE_NOT_FOUND

      public static final McpErrorKind RESOURCE_NOT_FOUND
      A resources/read named a resource that is not registered.
    • INVALID_PARAMS

      public static final McpErrorKind INVALID_PARAMS
      A required parameter was missing, or a parameter had the wrong JSON shape.
    • INTERNAL_ERROR

      public static final McpErrorKind INTERNAL_ERROR
      A handler threw an unexpected exception.
    • PARSE_ERROR

      public static final McpErrorKind PARSE_ERROR
      The request body could not be parsed as JSON.

      No dispatch path raises this kind today — JSON parsing happens in the REST layer before dispatch is reached. The constant exists so a revision's code table is complete; that is not the same claim as the path being reachable.

  • Method Details

    • values

      public static McpErrorKind[] 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 McpErrorKind 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