Skip to main content
Glama
exceptions.jsโ€ข1.74 kB
export class ServiceException extends Error { $fault; $response; $retryable; $metadata; constructor(options) { super(options.message); Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype); this.name = options.name; this.$fault = options.$fault; this.$metadata = options.$metadata; } static isInstance(value) { if (!value) return false; const candidate = value; return (ServiceException.prototype.isPrototypeOf(candidate) || (Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server"))); } static [Symbol.hasInstance](instance) { if (!instance) return false; const candidate = instance; if (this === ServiceException) { return ServiceException.isInstance(instance); } if (ServiceException.isInstance(instance)) { if (candidate.name && this.name) { return this.prototype.isPrototypeOf(instance) || candidate.name === this.name; } return this.prototype.isPrototypeOf(instance); } return false; } } export const decorateServiceException = (exception, additions = {}) => { Object.entries(additions) .filter(([, v]) => v !== undefined) .forEach(([k, v]) => { if (exception[k] == undefined || exception[k] === "") { exception[k] = v; } }); const message = exception.message || exception.Message || "UnknownError"; exception.message = message; delete exception.Message; return exception; };

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/consigcody94/office-whisperer'

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