The errors of an MCP client (Effect's McpClientError).
Every client operation fails with one McpClientError whose reason
says why: the transport failed, the server answered with a JSON-RPC
error (ProtocolError, with its code) or an HTTP error status, the
deadline passed, a limit was exceeded, a result did not validate, or the
tool reported an error. Handle one kind with
fx.catch_reason(McpClientError, TimeoutError, handler).
Values#
| Attribute | Type | Description |
|---|---|---|
REASONS | tuple[type[McpClientErrorReason], ...] | |
MCP_CLIENT_ERROR_REASON | S.Bottom[AnyReason, Mapping[str, object]] | The schema of every reason (Effect's |
MCP_CLIENT_ERROR | S.Bottom[McpClientError, Mapping[str, object]] | The schema of |
Types#
| Type | Definition | Description |
|---|---|---|
AnyReason | type AnyReason = TransportError | ProtocolError | HttpError | UnsupportedError | ClosedError | TimeoutError | LimitError | ConfigurationError | ValidationError | ToolError |
Classes#
McpClientErrorReasonTransportErrorProtocolErrorHttpErrorUnsupportedErrorClosedErrorTimeoutErrorLimitErrorConfigurationErrorValidationErrorToolErrorMcpClientError
Functions#
is_mcp_client_error#
is_mcp_client_error(u) -> bool| Parameter | Type | Description |
|---|---|---|
u | object |
Returns bool
def is_mcp_client_error(u: object) -> bool:
return isinstance(u, McpClientError)is_mcp_client_error_reason#
is_mcp_client_error_reason(u) -> bool| Parameter | Type | Description |
|---|---|---|
u | object |
Returns bool
def is_mcp_client_error_reason(u: object) -> bool:
return isinstance(u, McpClientErrorReason)