Source code for smarter.apps.mcpclient.exceptions

"""MCPClient exceptions."""

from smarter.common.exceptions import SmarterException


[docs] class SmarterMCPClientException(SmarterException): """Base class for all mcpclient exceptions.""" @property def get_formatted_err_message(self): """The heading of this error's message.""" return "Smarter MCPClient error"
[docs] class SmarterMCPClientConfigurationError(SmarterMCPClientException): """An MCPClient is not configured correctly, e.g. its credentials Secret is missing.""" @property def get_formatted_err_message(self): """The heading of this error's message.""" return "Smarter MCPClient configuration error"
[docs] class SmarterMCPClientConnectionError(SmarterMCPClientException): """Smarter could not connect to an MCP server, or the server did not respond correctly.""" @property def get_formatted_err_message(self): """The heading of this error's message.""" return "Smarter MCPClient connection error"
[docs] class SmarterMCPClientToolError(SmarterMCPClientException): """An MCP server's tool reported an error, which is returned to the LLM and never cached.""" @property def get_formatted_err_message(self): """The heading of this error's message.""" return "Smarter MCPClient tool error"
[docs] class SmarterMCPClientPermissionError(SmarterMCPClientException): """A tool or resource is not allowed by an MCPClient's allowedTools or allowedResources.""" @property def get_formatted_err_message(self): """The heading of this error's message.""" return "Smarter MCPClient permission error"