Skip to main content
Glama

DARPEngine

by DARPAI
errors.py1.33 kB
from fastapi import HTTPException from fastapi import status class FastApiError(HTTPException): def __init__(self, message: str, **kwargs) -> None: self.detail = {"message": message, **kwargs} class InvalidServerNameError(FastApiError): status_code: int = status.HTTP_400_BAD_REQUEST def __init__(self, name: str) -> None: message = "Name must have only letters, digits, underscore. Name must not start with digits." super().__init__(message=message, name=name) class ServerAlreadyExistsError(FastApiError): status_code: int = status.HTTP_400_BAD_REQUEST def __init__(self, dict_servers: list[dict]) -> None: servers_str = ", ".join(server["name"] for server in dict_servers) message = f"Server already exists: {servers_str}" super().__init__(message=message, servers=dict_servers) class ServersNotFoundError(FastApiError): status_code = status.HTTP_404_NOT_FOUND def __init__(self, ids: list[int]) -> None: super().__init__(message=f"Server(s) not found: {ids}", ids=ids) class NotAllowedError(FastApiError): status_code = status.HTTP_403_FORBIDDEN class InvalidData(FastApiError): status_code = status.HTTP_400_BAD_REQUEST class RemoteServerError(FastApiError): status_code = status.HTTP_503_SERVICE_UNAVAILABLE

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/DARPAI/darp_engine'

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