Documentation / @agentick/mcp / rethrowAsProtocolError
Function: rethrowAsProtocolError()
rethrowAsProtocolError(
err):boolean
Defined in: protocol/errors.ts:154
Re-throw a caller-supplied error as a clean protocol error if it is shaped like one (has code). Strips the McpError prefix so the client receives a single prefix on round-trip.
Returns false if the error is not protocol-shaped — caller should treat it as an execution error or other failure.
Parameters
err
unknown
Returns
boolean