McpException

class McpException @JvmOverloads constructor(val code: Int, message: String, val data: JsonElement? = null, cause: Throwable? = null) : Exception(source)

Represents an error specific to the MCP protocol.

Parameters

message

The error message.

cause

The original cause.

Constructors

Link copied to clipboard
constructor(code: Int, message: String, data: JsonElement? = null, cause: Throwable? = null)

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
val code: Int

The MCP/JSON‑RPC error code.

Link copied to clipboard

Optional additional error payload as a JSON element; null when not provided.

Link copied to clipboard
expect open val message: String?