Skip to main content
Glama
exceptions.py1.42 kB
""" Custom exceptions for Payload CMS MCP Server. """ class PayloadMCPError(Exception): """Base exception for Payload MCP server.""" def __init__(self, message: str, details: dict = None): super().__init__(message) self.message = message self.details = details or {} class ConfigurationError(PayloadMCPError): """Raised when there's a configuration error.""" pass class AuthenticationError(PayloadMCPError): """Raised when JWT authentication fails.""" pass class APIError(PayloadMCPError): """Raised when API request fails.""" def __init__(self, message: str, status_code: int = None, response_data: dict = None): super().__init__(message) self.status_code = status_code self.response_data = response_data or {} class NotFoundError(APIError): """Raised when resource is not found.""" pass class ValidationError(PayloadMCPError): """Raised when data validation fails.""" def __init__(self, message: str, field: str = None, value: any = None, response_data: dict = None): super().__init__(message) self.field = field self.value = value self.response_data = response_data or {} class RateLimitError(APIError): """Raised when rate limit is exceeded.""" pass class ConnectionError(PayloadMCPError): """Raised when connection to Payload CMS fails.""" pass

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ohnicholas93/payload-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server