McpException

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

Represents an error specific to the MCP protocol.

Parameters

message

the error message; used verbatim as Exception.message without an error-code prefix. Defaults to "MCP error $code" when not provided.

cause

the original cause

Constructors

Link copied to clipboard
constructor(code: Int, message: String = "MCP error ", 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

Link copied to clipboard
expect open val message: String?