Skip to main content
Glama

Github Project Manager

api-errors.ts1.55 kB
export class ApiError extends Error { public readonly statusCode: number; public readonly endpoint?: string; public readonly details?: unknown; constructor(message: string, statusCode: number, endpoint?: string, details?: unknown) { super(message); this.name = 'ApiError'; this.statusCode = statusCode; this.endpoint = endpoint; this.details = details; } } export class UnauthorizedError extends ApiError { constructor(endpoint?: string, details?: unknown) { super('Unauthorized', 401, endpoint, details); this.name = 'UnauthorizedError'; } } export class ForbiddenError extends ApiError { constructor(endpoint?: string, details?: unknown) { super('Forbidden', 403, endpoint, details); this.name = 'ForbiddenError'; } } export class NotFoundError extends ApiError { constructor(endpoint?: string, details?: unknown) { super('Not Found', 404, endpoint, details); this.name = 'NotFoundError'; } } export class RateLimitError extends ApiError { public readonly resetAt?: number; constructor(endpoint?: string, details?: unknown, resetAt?: number) { super('Too Many Requests', 429, endpoint, details); this.name = 'RateLimitError'; this.resetAt = resetAt; } } export class ServerError extends ApiError { constructor(statusCode = 500, endpoint?: string, details?: unknown) { super('Server Error', statusCode, endpoint, details); this.name = 'ServerError'; } }

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/Monsoft-Solutions/model-context-protocols'

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