nat.tool.mcp.exceptions#

Exceptions#

MCPError

Base exception for MCP-related errors.

MCPConnectionError

Exception for MCP connection failures.

MCPTimeoutError

Exception for MCP timeout errors.

MCPSSLError

Exception for MCP SSL/TLS errors.

MCPRequestError

Exception for MCP request errors.

MCPToolNotFoundError

Exception for when a specific MCP tool is not found.

MCPAuthenticationError

Exception for MCP authentication failures.

MCPProtocolError

Exception for MCP protocol-related errors.

Classes#

MCPErrorCategory

Categories of MCP errors for structured handling.

Module Contents#

class MCPErrorCategory#

Bases: str, enum.Enum

Categories of MCP errors for structured handling.

Initialize self. See help(type(self)) for accurate signature.

CONNECTION = 'connection'#
TIMEOUT = 'timeout'#
SSL = 'ssl'#
AUTHENTICATION = 'authentication'#
TOOL_NOT_FOUND = 'tool_not_found'#
PROTOCOL = 'protocol'#
UNKNOWN = 'unknown'#
exception MCPError(
message: str,
url: str,
category: MCPErrorCategory = MCPErrorCategory.UNKNOWN,
suggestions: list[str] | None = None,
original_exception: Exception | None = None,
)#

Bases: Exception

Base exception for MCP-related errors.

Initialize self. See help(type(self)) for accurate signature.

url#
category#
suggestions = []#
original_exception = None#
exception MCPConnectionError(
url: str,
original_exception: Exception | None = None,
)#

Bases: MCPError

Exception for MCP connection failures.

Initialize self. See help(type(self)) for accurate signature.

exception MCPTimeoutError(url: str, original_exception: Exception | None = None)#

Bases: MCPError

Exception for MCP timeout errors.

Initialize self. See help(type(self)) for accurate signature.

exception MCPSSLError(url: str, original_exception: Exception | None = None)#

Bases: MCPError

Exception for MCP SSL/TLS errors.

Initialize self. See help(type(self)) for accurate signature.

exception MCPRequestError(url: str, original_exception: Exception | None = None)#

Bases: MCPError

Exception for MCP request errors.

Initialize self. See help(type(self)) for accurate signature.

exception MCPToolNotFoundError(
tool_name: str,
url: str,
original_exception: Exception | None = None,
)#

Bases: MCPError

Exception for when a specific MCP tool is not found.

Initialize self. See help(type(self)) for accurate signature.

exception MCPAuthenticationError(
url: str,
original_exception: Exception | None = None,
)#

Bases: MCPError

Exception for MCP authentication failures.

Initialize self. See help(type(self)) for accurate signature.

exception MCPProtocolError(
url: str,
message: str = 'Protocol error',
original_exception: Exception | None = None,
)#

Bases: MCPError

Exception for MCP protocol-related errors.

Initialize self. See help(type(self)) for accurate signature.